@use '../variables' as *;

// ========================================
// 首页-校招公告Tab样式
// ========================================
.home-announcement {
  font-size: 0.14rem;
  width: 100%;

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

  // 标题区域
  &__header {
    display: flex;
    justify-content: space-between;
    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;
  }

  &__filter-chips {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.14rem;
  }

  &__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 #E8F1F1;
    border-radius: 0.16rem;
    cursor: pointer;
    transition: box-shadow 0.2s, border-color 0.2s;
    overflow: hidden;

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

  // 卡片主体
  &__card-body {
    display: flex;
    padding: 0.16rem 0.20rem;
    gap: 0.12rem;
  }

  // 左侧logo容器
  &__card-logo-wrap {
    flex-shrink: 0;
  }

  &__card-logo {
    width: 0.48rem;
    height: 0.48rem;
    border-radius: 0.08rem;
    border: 1px solid #F4F4F4;
    object-fit: cover;

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

  // 右侧内容区
  &__card-content {
    flex: 1;
    min-width: 0;
  }

  // 标题行
  &__card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.06rem;
  }

  &__card-title {
    font-size: 0.16rem;
    line-height: 0.21rem;
    font-weight: 520;
    color: $text-dark;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
  }

  // 公司类型标签（蓝色）
  &__card-type-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.02rem 0.08rem;
    background: #ECF3FC;
    border-radius: 0.04rem;
    font-size: 0.12rem;
    line-height: 0.16rem;
    font-weight: 330;
    color: #2672E1;
    white-space: nowrap;
    margin-left: 0.08rem;
    flex-shrink: 0;
  }

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

  &__card-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.02rem 0.08rem;
    border-radius: 0.04rem;
    font-size: 0.12rem;
    line-height: 0.16rem;
    font-weight: 330;

    // 批次标签（青色）
    &--batch {
      background: #F0FAFB;
      color: $accent;
    }

    // 学历标签（橙色）
    &--edu {
      background: #FAF2ED;
      color: #D17E52;
      font-weight: 305;
    }
  }

  // 信息行（岗位/城市）
  &__card-info-line {
    display: flex;
    align-items: center;
    gap: 0.04rem;
    font-size: 0.14rem;
    line-height: 0.19rem;
    font-weight: 380;
    color: #64748B;
    margin-bottom: 0.04rem;

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

  &__card-icon {
    width: 0.16rem;
    height: 0.16rem;
    flex-shrink: 0;
  }

  // 卡片底部渐变条
  &__card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.10rem 0.20rem;
    background: linear-gradient(270deg, rgba(159, 208, 81, 0.08) 0%, rgba(82, 202, 209, 0.08) 62.02%);
  }

  &__card-update {
    font-size: 0.14rem;
    line-height: 0.19rem;
    font-weight: 330;
    color: #94A3B8;
  }

  &__card-deadline {
    font-size: 0.14rem;
    line-height: 0.19rem;
    font-weight: 520;
    color: $text-dark;
  }

  // ==================== 加载中 ====================
  &__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-announcement-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;
    }
  }

  // ==================== 首页版统计卡片 ====================
  &__stats-card {
    display: flex;
    align-items: center;
    padding: 0.20rem 0.24rem;
    gap: 0.40rem;
    background: $bg-white;
    border: 1px solid #F0F0F0;
    box-shadow: 0px 2px 6px rgba(15, 23, 42, 0.025);
    border-radius: 0.12rem;
  }

  &__stats-title-wrap {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.08rem;
  }

  &__stats-title {
    font-size: 0.16rem;
    line-height: 0.21rem;
    font-weight: 520;
    color: $text-dark;
  }

  &__stats-date {
    font-size: 0.12rem;
    line-height: 0.16rem;
    font-weight: 330;
    color: #64748B;
  }

  &__stats-data {
    display: flex;
    align-items: center;
    gap: 0.20rem;
  }

  &__stats-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.04rem;
  }

  &__stats-num {
    font-size: 0.30rem;
    line-height: 0.40rem;
    font-weight: 520;
    color: $accent;
  }

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

  &__stats-divider {
    width: 0;
    height: 0.52rem;
    border-left: 1px solid #F0F0F0;
  }
}

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