// 校招公告页面样式
@use '../variables' as *;

.announcement-page {
  display: flex;
  min-width: 12.8rem;

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

  // 页面标题
  &__title {
    font-size: 0.18rem;
    font-weight: 700;
    color: $text-dark;
    margin: 0;
    padding: 0;
    line-height: 1.1;
  }

  &__subtitle {
    font-size: 0.14rem;
    color: $text-light;
    padding: 0;
  }

  // 筛选条件外层
  &__filters-bar {
    border-radius: 0.12rem;
    margin: 0 0.24rem 0.12rem 0.24rem;
  }

  // 筛选面板 + 统计卡片横向排列
  &__filters-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.12rem;
  }

  // 筛选面板
  &__filters-panel {
    flex: 1;
    min-width: 0;
    background: $bg-white;
    border: 1px solid #F0F0F0;
    box-shadow: 0px 2px 6px rgba(15, 23, 42, 0.025);
    border-radius: 0.12rem;
    padding: 0.12rem 0.16rem;
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
  }

  // 筛选行
  &__filter-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 0.08rem 0.16rem;
    background: $bg-white;
  }

  &__filter-row-inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.16rem;
    flex: 1;
    min-width: 0;
  }

  // 筛选行标题
  &__filter-row-label {
    font-size: 0.12rem;
    line-height: 0.16rem;
    font-weight: 380;
    color: $text-middle;
    flex-shrink: 0;
    white-space: nowrap;
  }

  // chip组外层
  &__filter-chips-wrap {
    display: flex;
    align-items: flex-start;
    gap: 0.08rem;
    flex: 1;
    min-width: 0;

    > .industry-selector,
    > .job-category-selector,
    > .region-selector {
      flex-shrink: 0;
      margin-left: auto;
      align-self: flex-end;
    }
  }

  // chip组
  &__filter-chips {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    align-content: center;
    gap: 0.08rem;
    flex: 1;
    min-width: 0;
  }

  // 筛选chip
  &__filter-chip {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.04rem 0.08rem;
    background: #F3F4F6;
    border-radius: 0.04rem;
    font-size: 0.12rem;
    line-height: 0.16rem;
    font-weight: 330;
    color: $text-dark;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    transition: all 0.15s;
    border: 1px solid transparent;

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

    &--active {
      background: #F4FBFB;
      border-color: $accent;
      color: $accent;
      font-weight: 600;
    }

    &--active-solid {
      background: $accent;
      color: #FFFFFF;
      font-weight: 600;
      border-color: $accent;
    }
  }

  // 底部筛选行
  &__filter-row--bottom {}

  // 下拉按钮组容器
  &__filter-dropdowns {
    display: flex;
    align-items: center;
    gap: 0.08rem;
    flex-wrap: wrap;
  }

  // 下拉按钮项
  &__dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.02rem;
    padding: 0.04rem 0.08rem;
    border: 1px solid #F0F0F0;
    border-radius: 0.04rem;
    font-size: 0.12rem;
    line-height: 0.16rem;
    font-weight: 330;
    color: $text-dark;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    user-select: none;
    transition: all 0.15s;

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

    .el-range-separator {
      padding-bottom: 0.03rem !important;
    }
  }

  &__dropdown-arrow {
    width: 0.12rem;
    height: 0.12rem;
    color: $text-middle;
    flex-shrink: 0;
  }

  // 下拉菜单面板
  &__filter-dropdown {
    position: absolute;
    top: calc(100% + 0.06rem);
    left: 0;
    background: $bg-white;
    border: 1px solid #E8E8E8;
    border-radius: 0.08rem;
    padding: 0.04rem 0;
    box-shadow: 0 0.04rem 0.12rem rgba(0, 0, 0, 0.08);
    z-index: 20;
    min-width: 100%;
  }

  // 下拉菜单选项
  &__filter-dropdown-item {
    padding: 0.06rem 0.16rem;
    font-size: 0.12rem;
    color: $text-dark;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;

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

    &--active {
      color: $accent;
      font-weight: 600;
    }
  }

  // 清空筛选按钮
  &__clear-filters {
    font-size: 0.12rem;
    color: $text-middle;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;

    &:hover {
      color: $accent;
    }
  }

  // 搜索框
  &__search-box {
    display: flex;
    align-items: center;
    background: $bg-white;
    border-radius: 0.08rem;
    padding: 0.10rem 0.14rem;
    border: 1px solid #F0F0F0;

    &:focus-within {
      border-color: $accent;
    }
  }

  &__search-svg {
    width: 0.14rem;
    height: 0.14rem;
    color: $text-light;
    margin-right: 0.08rem;
    flex-shrink: 0;
    cursor: pointer;
  }

  &__search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: $text-dark;
    font-size: 0.12rem;

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

  // 热门搜索标签
  &__hot-search-label {
    font-size: 0.12rem;
    color: $text-middle;
    white-space: nowrap;
    margin-right: 0.07rem;
  }

  &__hot-search-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 0.24rem;
    padding: 0 0.1rem;
    border-radius: 0.04rem;
    font-size: 0.12rem;
    color: $accent;
    background: $bg-white;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    transition: all 0.15s;
    margin-right: 0.07rem;

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

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

  // 列表区域
  &__list {
    overflow-y: auto;
    height: calc(var(--app-height, 100vh) - 3.4rem);
    padding: 0 0.24rem 0.2rem;
  }

  // 表头
  &__table-header {
    display: flex;
    align-items: center;
    padding: 0.10rem 0.12rem;
    background: #F4FBFB;
    border-radius: 0.08rem 0.08rem 0 0;
    border-bottom: 1px solid #F0F0F0;
    font-size: 0.12rem;
    font-weight: 600;
    color: $text-dark;
    position: sticky;
    top: 0;
    z-index: 5;
    gap: 0.2rem;
    >span{
      flex: 1;
      text-align: center;
    }
  }

  // 表格行
  &__table-row {
    display: flex;
    align-items: center;
    padding: 0.12rem;
    background: $bg-white;
    border-bottom: 1px solid #F6F6F6;
    font-size: 0.12rem;
    color: $text-dark;
    transition: background 0.15s;
    gap: 0.2rem;

    &:hover {
      background: $theme-color;
    }

    &:last-child {
      border-bottom: none;
    }
    >span{
      flex: 1;
    }
    >div{
      flex: 1;
    }
  }

  // 表头列宽
  &__th, &__td {
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  &__th--time, &__td--time { min-width: 0.7rem; }
  &__th--company, &__td--company { width: 1.8rem; flex-shrink: 1; }
  &__th--title, &__td--title { width: 1.8rem; flex: 1; min-width: 1rem; }
  &__th--position, &__td--position { width: 1.5rem; }
  &__th--target, &__td--target { width: 1.2rem; }
  &__th--major, &__td--major { width: 1.6rem; }
  &__th--batch, &__td--batch { width: 1rem; }
  &__th--deadline, &__td--deadline { width: 0.9rem; }

  // 公司信息列
  &__td--company {
    white-space: normal;
  }

  &__company-info {
    display: flex;
    align-items: center;
    gap: 0.08rem;
  }

  &__company-logo {
    width: 0.32rem;
    height: 0.32rem;
    border-radius: 0.06rem;
    border: 1px solid #F4F4F4;
    flex-shrink: 0;
    object-fit: cover;

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

  &__company-text {
    min-width: 0;
  }

  &__company-name {
    font-size: 0.13rem;
    font-weight: 500;
    color: $text-dark;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  &__company-tags {
    display: flex;
    gap: 0.04rem;
    margin-top: 0.02rem;
    flex-wrap: wrap;
  }

  &__company-tag {
    font-size: 0.11rem;
    padding: 0.01rem 0.04rem;
    border-radius: 0.02rem;
    white-space: nowrap;

    &--industry {
      background: #EDF9FA;
      color: $accent;
    }
  }

  // 多行单元格
  &__td--position, &__td--target {
    white-space: normal;
    display: flex;
    flex-direction: column;
    gap: 0.02rem;
  }

  &__cell-line {
    font-size: 0.12rem;
    color: $text-dark;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  &__cell-sub {
    font-size: 0.11rem;
    color: $text-light;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  &__recruit-year {
    font-size: 0.12rem;
    color: #175CD3;
    background: #EFF8FF;
    padding: 0 0.08rem;
    border-radius: 0.04rem;
    display: inline-block;
    align-self: flex-start;
    height: 0.24rem;
    line-height: 0.24rem;
  }

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

  &__empty-img {
    width: 1.24rem;
    height: 1.3rem;
    display: block;
    margin: 1rem auto 0.2rem;
  }

  &__empty-title {
    font-size: 0.14rem;
    color: $text-light;
    margin-bottom: 0.08rem;
  }

  &__empty-subtitle {
    font-size: 0.14rem;
    color: $text-light;
  }

  &__empty-link {
    color: $accent;
    text-decoration: underline;
    cursor: pointer;

    &:hover {
      opacity: 0.75;
    }
  }

  // 加载状态
  &__loading-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.08rem;
    padding: 0.24rem 0;
    font-size: 0.13rem;
    color: $text-light;
  }

  &__loading-spinner {
    width: 0.18rem;
    height: 0.18rem;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: $accent;
    border-radius: 50%;
    animation: announcement-spin 0.6s linear infinite;
  }

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

  &__loading-more {
    text-align: center;
    padding: 0.16rem 0;
    font-size: 0.12rem;
    color: $text-light;
  }
}
