:host {
  display: block;
  width: 100%;
  height: 100%;
}

.position-selector-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: #fff;
}

/* 搜索栏样式 */
.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 200px;
  max-width: 500px;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: #bfbfbf;
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 36px;
  padding: 4px 36px 4px 36px;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(0, 0, 0, 0.85);
  background-color: #fff;
  background-image: none;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  transition: all 0.3s;
  outline: none;
}

.search-input:hover {
  border-color: #40a9ff;
}

.search-input:focus {
  border-color: #40a9ff;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.search-input::placeholder {
  color: #bfbfbf;
}

.clear-button {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bfbfbf;
  transition: color 0.3s;
}

.clear-button:hover {
  color: #8c8c8c;
}

.search-button {
  padding: 4px 15px;
  height: 36px;
  font-size: 14px;
  line-height: 1.5;
  border-radius: 6px;
  color: #fff;
  background-color: #1890ff;
  border: 1px solid #1890ff;
  cursor: pointer;
  transition: all 0.3s;
  outline: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.search-button:hover {
  background-color: #40a9ff;
  border-color: #40a9ff;
}

.search-button:active {
  background-color: #096dd9;
  border-color: #096dd9;
}

/* 加载状态 */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  gap: 16px;
  color: #8c8c8c;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #f0f0f0;
  border-top-color: #1890ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 空状态 */
.empty-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 16px;
}

.empty-icon {
  opacity: 0.5;
}

.empty-text {
  margin: 0;
  color: #8c8c8c;
  font-size: 14px;
}

/* 职位列表 */
.position-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.table-container {
  width: 100%;
  overflow-x: auto;
}

.position-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.position-table thead {
  background-color: #fafafa;
  position: sticky;
  top: 0;
  z-index: 1;
}

.position-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.85);
  border-bottom: 1px solid #f0f0f0;
  white-space: nowrap;
}

.position-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  color: rgba(0, 0, 0, 0.65);
}

.position-table tbody tr {
  transition: background-color 0.3s;
}

.position-table tbody tr:hover {
  background-color: #fafafa;
}

.position-table tbody tr.selected-row {
  background-color: #e6f7ff;
}

/* 列宽设置 */
.checkbox-column {
  width: 50px;
  text-align: center;
}

.title-column {
  min-width: 150px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-column {
  min-width: 120px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.location-column {
  min-width: 100px;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.requirements-column {
  min-width: 200px;
  max-width: 300px;
}

.requirements-text {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
  word-break: break-word;
  line-height: 1.5;
}

.salary-column {
  min-width: 100px;
  white-space: nowrap;
}

.action-column {
  width: 100px;
  text-align: center;
}

/* 复选框样式 */
.position-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #1890ff;
}

/* 选择按钮 */
.select-button {
  padding: 4px 15px;
  height: 28px;
  font-size: 14px;
  line-height: 1.5;
  border-radius: 6px;
  color: #fff;
  background-color: #1890ff;
  border: 1px solid #1890ff;
  cursor: pointer;
  transition: all 0.3s;
  outline: none;
}

.select-button:hover {
  background-color: #40a9ff;
  border-color: #40a9ff;
}

.select-button:active {
  background-color: #096dd9;
  border-color: #096dd9;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
  .search-bar {
    padding: 12px;
    gap: 8px;
  }

  .search-input-wrapper {
    min-width: auto;
    max-width: none;
  }

  .search-input {
    height: 40px;
    font-size: 16px;
  }

  .search-button {
    height: 40px;
    padding: 4px 12px;
  }

  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .position-table {
    font-size: 12px;
  }

  .position-table th,
  .position-table td {
    padding: 8px 12px;
  }

  .title-column,
  .company-column,
  .location-column {
    min-width: 100px;
  }

  .select-button {
    padding: 4px 12px;
    height: 32px;
    font-size: 14px;
  }
}

/* 分页器样式 */
.pagination-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px;
  border-top: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.pagination-button {
  padding: 4px 15px;
  height: 32px;
  font-size: 14px;
  line-height: 1.5;
  border-radius: 6px;
  color: rgba(0, 0, 0, 0.85);
  background-color: #fff;
  border: 1px solid #d9d9d9;
  cursor: pointer;
  transition: all 0.3s;
  outline: none;
}

.pagination-button:hover:not(:disabled) {
  color: #40a9ff;
  border-color: #40a9ff;
}

.pagination-button:active:not(:disabled) {
  color: #096dd9;
  border-color: #096dd9;
}

.pagination-button:disabled {
  color: rgba(0, 0, 0, 0.25);
  background-color: #f5f5f5;
  border-color: #d9d9d9;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 14px;
  color: rgba(0, 0, 0, 0.65);
}

/* 滚动条样式 */
.position-list::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.position-list::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.position-list::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.position-list::-webkit-scrollbar-thumb:hover {
  background: #555;
}
