/**
 * [2026-02-17] 预种计划管理页面样式
 *
 * 包含：开关状态卡片、统计卡片、Tab 切换、数据表格
 * 风格与全局管理后台一致
 */

@use '@/styles/variables' as *;

.prePlanting {
  display: flex;
  flex-direction: column;
  gap: 24px;

  // 页面标题
  &__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  &__title {
    font-size: 24px;
    font-weight: 600;
    color: $text-primary;
  }

  // 团队过滤提示横幅
  &__teamBanner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: linear-gradient(135deg, #e8f4fd 0%, #d6eaf8 100%);
    border: 1px solid #90caf9;
    border-radius: 8px;
    font-size: 14px;
    color: #1565c0;
  }

  &__teamBannerLink {
    font-size: 14px;
    font-weight: 500;
    color: #1565c0;
    text-decoration: none;
    padding: 4px 12px;
    border-radius: 6px;
    background: rgba(21, 101, 192, 0.08);
    transition: background 0.2s;

    &:hover {
      background: rgba(21, 101, 192, 0.16);
      text-decoration: underline;
    }
  }

  // 开关状态卡片
  &__switchCard {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cc 100%);
    border: 1px solid #ffd666;
    border-radius: 12px;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;

    &--active {
      background: linear-gradient(135deg, #f6ffed 0%, #d9f7be 100%);
      border-color: #95de64;
    }
  }

  &__switchInfo {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  &__switchIcon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: rgba(255, 255, 255, 0.8);
  }

  &__switchTitle {
    font-size: 16px;
    font-weight: 600;
    color: $text-primary;
  }

  &__switchDesc {
    font-size: 13px;
    color: $text-secondary;
    margin-top: 2px;
  }

  &__switchBadge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 8px;

    &--on {
      background: #52c41a;
      color: white;
    }

    &--off {
      background: #faad14;
      color: white;
    }
  }

  &__switchBtn {
    padding: 8px 20px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;

    &--on {
      background: #ff4d4f;
      color: white;

      &:hover {
        background: #ff7875;
      }
    }

    &--off {
      background: #52c41a;
      color: white;

      &:hover {
        background: #73d13d;
      }
    }

    &:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }
  }

  // 统计卡片网格
  &__statsGrid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;

    @media (max-width: 1200px) {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  &__statCard {
    background: $card-background;
    border-radius: 12px;
    padding: 20px;
    box-shadow: $shadow-base;
    text-align: center;
  }

  &__statValue {
    font-size: 28px;
    font-weight: 700;
    color: $text-primary;
  }

  &__statLabel {
    font-size: 13px;
    color: $text-secondary;
    margin-top: 4px;
  }

  // Tab 切换
  &__tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid $border-color;
  }

  &__tab {
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    color: $text-secondary;
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;

    &:hover {
      color: $text-primary;
    }

    &--active {
      color: #d4af37;
      border-bottom-color: #d4af37;
      font-weight: 600;
    }
  }

  // 数据卡片容器
  &__card {
    background: $card-background;
    border-radius: 12px;
    padding: 24px;
    box-shadow: $shadow-base;
  }

  &__toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
  }

  &__search {
    display: flex;
    gap: 8px;
    align-items: center;

    input {
      width: 280px;
      padding: 8px 12px;
      border: 1px solid $border-color;
      border-radius: 8px;
      font-size: 14px;
      outline: none;

      &:focus {
        border-color: #d4af37;
      }
    }
  }

  // 表格
  &__table {
    width: 100%;
    border-collapse: collapse;

    th,
    td {
      padding: 12px 16px;
      text-align: left;
      border-bottom: 1px solid $border-color;
      font-size: 14px;
    }

    th {
      font-weight: 600;
      color: $text-secondary;
      background: #fafafa;
    }

    td {
      color: $text-primary;
    }

    tr:hover td {
      background: #fafafa;
    }
  }

  // 状态标签
  &__status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;

    &--created {
      background: #fff7e6;
      color: #d48806;
    }

    &--paid {
      background: #f6ffed;
      color: #389e0d;
    }

    &--merged {
      background: #fff9e6;
      color: #d4af37;
    }

    &--pending {
      background: #fff7e6;
      color: #d48806;
    }

    &--signed {
      background: #f6ffed;
      color: #389e0d;
    }

    &--expired {
      background: #f5f5f5;
      color: #8c8c8c;
    }
  }

  // 加载 / 空 / 错误 状态
  &__loading,
  &__empty,
  &__error {
    text-align: center;
    padding: 48px 24px;
    color: $text-secondary;
    font-size: 14px;
  }

  &__error {
    color: #ff4d4f;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  // 分页
  &__pagination {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
  }
}
