.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;

  &.visible {
    opacity: 1;
    visibility: visible;
  }
}

.modal-container {
  background: white;
  border-radius: 12px;
  width: 90vw;
  max-width: 1200px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  transform: scale(0.9);
  transition: transform 0.3s ease;

  .modal-overlay.visible & {
    transform: scale(1);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  border-bottom: 1px solid #f0f0f0;

  h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #262626;
  }

  .close-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    border-radius: 6px;
    color: #8c8c8c;
    transition: all 0.2s ease;

    &:hover {
      background: #f5f5f5;
      color: #262626;
    }
  }
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
}

.team-selection-section {
  margin-bottom: 32px;

  h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: #262626;
  }
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.team-card {
  border: 2px solid #f0f0f0;
  border-radius: 8px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: white;

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

  &.selected {
    border-color: #1890ff;
    background: #f6ffed;
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.15);
  }

  .team-header {
    margin-bottom: 12px;

    h4 {
      margin: 0 0 4px 0;
      font-size: 16px;
      font-weight: 600;
      color: #262626;
    }

    .team-leader {
      font-size: 14px;
      color: #8c8c8c;
    }
  }

  .team-description {
    font-size: 14px;
    color: #595959;
    margin-bottom: 16px;
    line-height: 1.5;
  }

  .team-stats {
    display: flex;
    gap: 16px;

    .stat-item {
      display: flex;
      flex-direction: column;
      align-items: center;

      .stat-label {
        font-size: 12px;
        color: #8c8c8c;
        margin-bottom: 4px;
      }

      .stat-value {
        font-size: 14px;
        font-weight: 600;
        color: #262626;

        &.idle {
          color: #52c41a;
        }
      }
    }
  }
}

.designer-selection-section {
  .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;

    h3 {
      margin: 0;
      font-size: 16px;
      font-weight: 600;
      color: #262626;
    }

    .selection-summary {
      font-size: 14px;
      color: #1890ff;
      font-weight: 500;
    }
  }
}

.recommended-section {
  margin-bottom: 32px;
  padding: 20px;
  background: linear-gradient(135deg, #fff7e6 0%, #fff2e8 100%);
  border-radius: 8px;
  border: 1px solid #ffd591;

  h4 {
    margin: 0 0 16px 0;
    font-size: 15px;
    font-weight: 600;
    color: #d46b08;
    display: flex;
    align-items: center;
    gap: 8px;

    .recommend-icon {
      font-size: 16px;
    }
  }
}

.all-members-section {
  h4 {
    margin: 0 0 16px 0;
    font-size: 15px;
    font-weight: 600;
    color: #262626;
  }
}

.designer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.designer-card {
  border: 2px solid #f0f0f0;
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: white;
  display: flex;
  gap: 12px;

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

  &.selected {
    border-color: #1890ff;
    background: #f6ffed;
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.15);
  }

  &.recommended {
    border-color: #faad14;
    background: #fffbe6;

    &.selected {
      border-color: #1890ff;
      background: #f6ffed;
    }
  }

  &.busy {
    opacity: 0.7;
    
    &:hover {
      opacity: 0.8;
    }
  }

  &.reviewing {
    border-color: #1890ff;
    background: #f0f8ff;
  }

  &.cross-team {
    border-color: #722ed1;
    background: #f9f0ff;

    &.selected {
      border-color: #722ed1;
      background: #efdbff;
    }
  }

  .designer-avatar {
    position: relative;
    flex-shrink: 0;

    img, .avatar-placeholder {
      width: 48px;
      height: 48px;
      border-radius: 50%;
    }

    .avatar-placeholder {
      background: #f0f0f0;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 600;
      color: #8c8c8c;
      font-size: 18px;
    }

    .status-dot {
      position: absolute;
      bottom: 2px;
      right: 2px;
      width: 12px;
      height: 12px;
      border-radius: 50%;
      border: 2px solid white;
    }
  }

  .designer-info {
    flex: 1;
    min-width: 0;

    .designer-name {
      font-size: 15px;
      font-weight: 600;
      color: #262626;
      margin-bottom: 4px;
      display: flex;
      align-items: center;
      gap: 8px;

      .leader-badge {
        background: #1890ff;
        color: white;
        font-size: 11px;
        padding: 2px 6px;
        border-radius: 4px;
        font-weight: 500;
      }

      .team-tag {
        background: #722ed1;
        color: white;
        font-size: 11px;
        padding: 2px 6px;
        border-radius: 4px;
        font-weight: 500;
      }
    }

    .designer-status {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 8px;

      .status-text {
        font-size: 13px;
        font-weight: 500;
      }

      .workload {
        font-size: 12px;
        padding: 2px 6px;
        border-radius: 4px;
        font-weight: 500;

        &.low {
          background: #f6ffed;
          color: #52c41a;
        }

        &.medium {
          background: #fff7e6;
          color: #faad14;
        }

        &.high {
          background: #fff2f0;
          color: #ff4d4f;
        }
      }
    }

    .designer-metrics {
      margin-bottom: 8px;

      .metric-item {
        margin-bottom: 4px;

        .metric-label {
          font-size: 12px;
          color: #8c8c8c;
        }

        &.active .metric-label {
          color: #52c41a;
          font-weight: 500;
        }

        &.recent .metric-label {
          color: #faad14;
          font-weight: 500;
        }

        &.moderate .metric-label {
          color: #1890ff;
          font-weight: 500;
        }

        &.long .metric-label {
          color: #ff4d4f;
          font-weight: 500;
        }

        &.review-dates .metric-label {
          color: #722ed1;
          font-weight: 500;
        }
      }
    }

    .designer-skills {
      display: flex;
      flex-wrap: wrap;
      gap: 4px;

      .skill-tag {
        background: #f0f0f0;
        color: #595959;
        font-size: 11px;
        padding: 2px 6px;
        border-radius: 4px;
      }

      .skill-more {
        background: #d9d9d9;
        color: #8c8c8c;
        font-size: 11px;
        padding: 2px 6px;
        border-radius: 4px;
      }
    }
  }

  .designer-actions {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;

    .calendar-btn {
      background: none;
      border: none;
      padding: 4px;
      cursor: pointer;
      border-radius: 4px;
      font-size: 16px;
      transition: background 0.2s ease;

      &:hover {
        background: #f0f0f0;
      }
    }
  }
}

.cross-team-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #f0f0f0;

  .cross-team-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;

    .checkbox-label {
      display: flex;
      align-items: center;
      gap: 8px;
      cursor: pointer;
      font-weight: 500;
      color: #262626;

      input[type="checkbox"] {
        width: 16px;
        height: 16px;
      }
    }

    .cross-team-hint {
      font-size: 13px;
      color: #8c8c8c;
    }
  }

  .cross-team-designers {
    h4 {
      margin: 16px 0 12px 0;
      font-size: 14px;
      font-weight: 600;
      color: #722ed1;
    }
  }
}

.modal-footer {
  padding: 24px 32px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;

  .selection-summary {
    flex: 1;

    .summary-item {
      margin-bottom: 8px;
      font-size: 14px;

      .summary-label {
        color: #8c8c8c;
        font-weight: 500;
      }

      .summary-value {
        color: #262626;
        font-weight: 500;
      }
    }
  }

  .modal-actions {
    display: flex;
    gap: 12px;

    .btn-secondary, .btn-primary {
      padding: 8px 16px;
      border-radius: 6px;
      font-size: 14px;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.2s ease;
      border: none;

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

    .btn-secondary {
      background: #f5f5f5;
      color: #595959;

      &:hover:not(:disabled) {
        background: #e6e6e6;
      }
    }

    .btn-primary {
      background: #1890ff;
      color: white;

      &:hover:not(:disabled) {
        background: #40a9ff;
      }
    }
  }
}

// 设计师详细日历弹窗样式
.calendar-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
}

.calendar-modal-container {
  background: white;
  border-radius: 12px;
  width: 80vw;
  max-width: 800px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.calendar-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #f0f0f0;

  h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #262626;
  }

  .close-btn {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    border-radius: 4px;
    color: #8c8c8c;
    transition: all 0.2s ease;

    &:hover {
      background: #f5f5f5;
      color: #262626;
    }
  }
}

.calendar-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

// 响应式设计
@media (max-width: 768px) {
  .modal-container {
    width: 95vw;
    max-height: 95vh;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .team-grid {
    grid-template-columns: 1fr;
  }

  .designer-grid {
    grid-template-columns: 1fr;
  }

  .modal-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;

    .modal-actions {
      justify-content: stretch;

      .btn-secondary,
      .btn-primary {
        flex: 1;
      }
    }
  }
}