// 导入iOS主题变量
@use '../ios-theme.scss' as *;

.personal-board-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  background-color: $ios-background;
  min-height: 100vh;
}

.personal-board-header {
  margin-bottom: 30px;
  h1 {
    font-size: 32px;
    color: $ios-text-primary;
    font-weight: $ios-font-weight-semibold;
    font-family: $ios-font-family;
  }
}

.personal-board-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  
  .skill-board-section,
  .settlement-section {
    grid-column: 1 / -1;
  }
}

.section-header {
  margin-bottom: 16px;
  h2 {
    font-size: 22px;
    color: $ios-text-primary;
    font-weight: $ios-font-weight-medium;
    margin: 0 0 4px 0;
    font-family: $ios-font-family;
  }
  p {
    font-size: 14px;
    color: $ios-text-secondary;
    margin: 0;
  }
}

/* 能力看板样式 */
.skill-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.skill-tag {
  background: $ios-card-background;
  border-radius: $ios-radius-lg;
  padding: 16px 20px;
  min-width: 200px;
  transition: $ios-animation-normal $ios-animation-easing;
  box-shadow: $ios-shadow-card;
  border: 1px solid $ios-border;
  
  &:hover {
    transform: translateY(-2px);
    box-shadow: $ios-shadow-md;
  }
  
  &.level-high {
    background: $ios-primary-light;
    border: 1px solid $ios-primary;
  }
  
  &.level-medium {
    background: rgba(52, 199, 89, 0.1);
    border: 1px solid $ios-success;
  }
  
  .tag-name {
    font-size: 16px;
    font-weight: $ios-font-weight-medium;
    color: $ios-text-primary;
    display: block;
    margin-bottom: 10px;
    font-family: $ios-font-family;
  }
  
  .tag-level {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
    
    .level-bar {
        flex: 1;
        height: 8px;
        background: $ios-border;
        border-radius: $ios-radius-full;
        overflow: hidden;
        
        .level-fill {
          height: 100%;
          background: $ios-primary;
        transition: width 0.3s ease;
      }
    }
    
    .level-text {
      font-size: 12px;
      color: $ios-text-secondary;
      min-width: 35px;
    }
  }
  
  .tag-count {
    font-size: 12px;
    color: $ios-text-tertiary;
  }
}

.matching-orders-section {
  
  h3 {
    font-size: 20px;
    color: $ios-text-primary;
    margin: 0 0 16px 0;
    font-family: $ios-font-family;
  }
  
  .order-list {
    display: grid;
    gap: 16px;
  }
  
  .order-item {
    background: $ios-card-background;
    border-radius: $ios-radius-lg;
    padding: 20px;
    box-shadow: $ios-shadow-card;
    transition: $ios-animation-normal $ios-animation-easing;
    border: 1px solid $ios-border;
    
    &:hover {
      box-shadow: $ios-shadow-md;
      transform: translateY(-2px);
    }
    
    .order-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 12px;
      
      h4 {
        font-size: 17px;
        color: $ios-text-primary;
        margin: 0;
        font-family: $ios-font-family;
      }
      
      .match-rate {
        font-size: 13px;
        padding: 6px 14px;
        border-radius: $ios-radius-full;
        background-color: $ios-card-background;
        color: $ios-text-secondary;
        
        &.high-match {
          background-color: rgba(52, 199, 89, 0.1);
          color: $ios-success;
          border: 1px solid $ios-success;
        }
        
        &.medium-match {
          background-color: rgba(255, 149, 0, 0.1);
          color: $ios-warning;
          border: 1px solid $ios-warning;
        }
      }
    }
    
    .order-info {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 16px;
      
      .required-skills {
        display: flex;
        gap: 8px;
        
        .skill-badge {
          font-size: 12px;
          padding: 4px 10px;
          background: $ios-card-background;
          color: $ios-text-secondary;
          border-radius: $ios-radius-full;
          border: 1px solid $ios-border;
        }
      }
      
      .customer-level {
        font-size: 14px;
        color: $ios-text-secondary;
        
        &.premium {
          color: $ios-warning;
          font-weight: $ios-font-weight-medium;
        }
      }
    }
    
    .btn-accept-order {
      width: 100%;
      padding: 12px 16px;
      border: 1px solid $ios-primary;
      border-radius: $ios-radius-md;
      background-color: $ios-card-background;
      color: $ios-primary;
      font-size: 15px;
      cursor: pointer;
      transition: all 0.3s ease;
        font-weight: $ios-font-weight-medium;
        font-family: $ios-font-family;
      
      &:hover {
        background-color: $ios-primary;
        color: white;
        transform: translateY(-1px);
        box-shadow: $ios-shadow-md;
      }
      
      &:active {
        transform: translateY(0);
      }
    }
  }
}

/* 结算统计样式 */
.settlement-summary {
  background: $ios-card-background;
  border-radius: $ios-radius-lg;
  padding: 24px;
  box-shadow: $ios-shadow-card;
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 32px;
  align-items: center;
  border: 1px solid $ios-border;
  
  .summary-item {
    
    h3 {
      font-size: 16px;
      color: $ios-text-secondary;
      margin: 0 0 6px 0;
      font-weight: normal;
      font-family: $ios-font-family;
    }
    
    .amount {
      font-size: 28px;
      font-weight: 600;
      margin: 0;
      
      &.total {
        color: $ios-text-primary;
        font-family: $ios-font-family;
      }
      
      &.pending {
        color: $ios-primary;
        font-family: $ios-font-family;
      }
    }
  }
  
  .btn-view-details {
    padding: 12px 24px;
    border: 1px solid $ios-primary;
    border-radius: $ios-radius-md;
    background-color: $ios-card-background;
    color: $ios-primary;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-weight: $ios-font-weight-medium;
    font-family: $ios-font-family;
    
    &:hover {
      background-color: $ios-primary;
      color: white;
      transform: translateY(-1px);
      box-shadow: $ios-shadow-md;
    }
    
    &:active {
      transform: translateY(0);
    }
  }
}

.settlement-details {
  
  h3 {
    font-size: 20px;
    color: $ios-text-primary;
    margin: 0 0 16px 0;
    font-family: $ios-font-family;
  }
  
  .settlement-table {
    width: 100%;
    border-collapse: collapse;
    background: $ios-card-background;
    border-radius: $ios-radius-lg;
    overflow: hidden;
    box-shadow: $ios-shadow-card;
    border: 1px solid $ios-border;
    
    thead {
      background: $ios-background-secondary;
      
      th {
        padding: 14px 16px;
        text-align: left;
        font-size: 14px;
        font-weight: $ios-font-weight-medium;
        color: $ios-text-secondary;
        border-bottom: 1px solid $ios-border;
        font-family: $ios-font-family;
      }
    }
    
    tbody {
      
      td {
        padding: 14px 16px;
        font-size: 14px;
        color: $ios-text-primary;
        border-bottom: 1px solid $ios-border;
        transition: background-color 0.2s ease;
        
        &:last-child {
          color: $ios-text-secondary;
        }
        
        &:hover {
          background-color: $ios-background-secondary;
        }
      }
      
      .empty-row {
        text-align: center;
        color: $ios-text-tertiary;
        font-style: italic;
        padding: 48px;
        background-color: $ios-card-background;
      }
      
      .status-badge {
        padding: 4px 12px;
        border-radius: $ios-radius-full;
        font-size: 12px;
        
        &.settled {
          background-color: rgba($ios-success, 0.1);
          color: $ios-success;
          border: 1px solid $ios-success;
        }
        
        &:not(.settled) {
          background-color: rgba($ios-danger, 0.1);
          color: $ios-danger;
          border: 1px solid $ios-danger;
        }
      }
    }
  }
  
  .status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: $ios-radius-full;
    font-size: 12px;
    font-weight: $ios-font-weight-medium;
    
    &.settled {
      background-color: rgba(52, 199, 89, 0.1);
      color: $ios-success;
    }
    
    &.pending {
      background-color: rgba(0, 122, 255, 0.1);
      color: $ios-primary;
    }
  }
}

/* 结算规则样式 */
.settlement-rules {
  margin-top: 24px;
  padding: 20px;
  background: $ios-card-background;
  border-radius: $ios-radius-lg;
  box-shadow: $ios-shadow-card;
  border: 1px solid $ios-border;
  
  h3 {
    font-size: 18px;
    color: $ios-text-primary;
    margin: 0 0 16px 0;
    font-family: $ios-font-family;
  }
  
  .rule-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    gap: 16px;
    
    &:last-child {
      margin-bottom: 0;
    }
    
    .stage-name {
      font-size: 14px;
      color: $ios-text-secondary;
      min-width: 60px;
      font-family: $ios-font-family;
    }
    
    .stage-bar {
      flex: 1;
      height: 24px;
      background: $ios-background-secondary;
      border-radius: $ios-radius-full;
      overflow: hidden;
      position: relative;
      
      .stage-fill {
        height: 100%;
        background: $ios-primary;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        padding-right: 12px;
        color: white;
        font-size: 12px;
        font-weight: $ios-font-weight-medium;
        font-family: $ios-font-family;
      }
    }
  }
}

/* 绩效趋势样式 */
.performance-chart {
  background: $ios-card-background;
  border-radius: $ios-radius-lg;
  padding: 24px;
  box-shadow: $ios-shadow-card;
  border: 1px solid $ios-border;
  
  .chart-container {
    display: flex;
    align-items: flex-end;
    height: 300px;
    margin-bottom: 24px;
    
    .chart-labels {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      height: 100%;
      margin-right: 20px;
      
      span {
        font-size: 12px;
        color: $ios-text-tertiary;
        padding: 5px 0;
      }
    }
    
    .chart-bars {
      flex: 1;
      display: flex;
      justify-content: space-around;
      align-items: flex-end;
      height: 100%;
      
      .bar-group {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        
        .bar {
          position: relative;
          width: 44px;
          display: flex;
          flex-direction: column;
          align-items: center;
          transition: all 0.3s ease;
          
          &:hover {
            transform: translateY(-5px);
          }
          
          .bar-fill {
            width: 100%;
            border-radius: $ios-radius-md $ios-radius-md 0 0;
            transition: height 0.3s ease;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
          }
          
          .bar-value {
              position: absolute;
              top: -28px;
              font-size: 12px;
              color: $ios-text-secondary;
              white-space: nowrap;
              font-weight: 500;
            }
          
          &.completion-rate .bar-fill {
            background: $ios-primary;
          }
          
          &.satisfaction-rate .bar-fill {
            background: $ios-success;
          }
          
          &.ontime-rate .bar-fill {
            background: $ios-warning;
          }
        }
      }
    }
  }
  
  .chart-legend {
    display: flex;
    justify-content: center;
    gap: 32px;
    
    .legend-item {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 14px;
      color: $ios-text-secondary;
      
      .legend-color {
        width: 18px;
        height: 4px;
        border-radius: $ios-radius-full;
        
        &.completion-rate {
          background: $ios-primary;
        }
        
        &.satisfaction-rate {
          background: $ios-success;
        }
        
        &.ontime-rate {
          background: $ios-warning;
        }
      }
    }
  }
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: $ios-text-tertiary;
  background-color: $ios-background-secondary;
  border-radius: $ios-radius-lg;
  border: 1px dashed $ios-border;
}

/* iOS风格滚动条 */
.personal-board-container {
  &::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  
  &::-webkit-scrollbar-track {
    background: $ios-background-secondary;
    border-radius: $ios-radius-full;
  }
  
  &::-webkit-scrollbar-thumb {
    background: $ios-scrollbar-thumb;
    border-radius: $ios-radius-full;
    border: 2px solid $ios-background-secondary;
  }
  
  &::-webkit-scrollbar-thumb:hover {
    background: $ios-scrollbar-thumb-hover;
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .personal-board-container {
    padding: 16px;
  }
  
  .personal-board-main {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .skill-tags-container {
    justify-content: center;
    gap: 12px;
  }
  
  .skill-tag {
    min-width: 100%;
    padding: 14px 16px;
  }
  
  .settlement-summary {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px;
    
    .btn-view-details {
      width: 100%;
    }
    
    .summary-item {
      
      h3 {
        font-size: 15px;
      }
      
      .amount {
        font-size: 24px;
      }
    }
  }
  
  .performance-chart {
    padding: 20px 16px;
    
    .chart-container {
      flex-direction: column;
      height: auto;
      
      .chart-labels {
        flex-direction: row;
        width: 100%;
        margin-right: 0;
        margin-bottom: 20px;
        justify-content: space-around;
        
        span {
          font-size: 11px;
        }
      }
      
      .chart-bars {
        flex-direction: column;
        height: 300px;
        
        .bar-group {
          flex-direction: row;
          width: 100%;
          gap: 8px;
          justify-content: center;
          
          .bar {
            height: 20px;
            width: auto;
            
            .bar-fill {
              border-radius: $ios-radius-full;
              height: 100%;
              width: 60px;
            }
            
            .bar-value {
              top: -25px;
              left: 50%;
              transform: translateX(-50%);
              font-size: 11px;
            }
          }
        }
      }
    }
    
    .chart-legend {
      gap: 16px;
      flex-wrap: wrap;
      
      .legend-item {
        font-size: 13px;
        gap: 6px;
        
        .legend-color {
          width: 14px;
        }
      }
    }
  }
  
  .section-header {
    h2 {
      font-size: 20px;
    }
  }
  
  .matching-orders-section,
  .settlement-details {
    h3 {
      font-size: 18px;
    }
  }
}