// 与employees样式基本相同
@import '../employees/employees.scss';

code {
  font-family: 'Courier New', monospace;
  background: #f5f5f5;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
}

/* 详情面板增强样式 */
.section-title {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  margin: 24px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e5e7eb;

  &:first-child {
    margin-top: 0;
  }
}

.qr-code-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  background: #f9fafb;
  border-radius: 8px;
  margin: 12px 0;

  .qr-code-image {
    max-width: 200px;
    max-height: 200px;
    border: 4px solid white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  .qr-code-tip {
    margin-top: 12px;
    color: #6b7280;
    font-size: 14px;
  }
}

.members-list {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin: 12px 0;

  .member-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s;

    &:last-child {
      border-bottom: none;
    }

    &:hover {
      background-color: #f9fafb;
    }

    .member-info {
      .member-name {
        font-weight: 500;
        color: #1f2937;
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 4px;

        .member-type {
          display: inline-block;
          padding: 2px 8px;
          background: #dbeafe;
          color: #1e40af;
          font-size: 12px;
          border-radius: 4px;
          font-weight: 600;

          &.external {
            background: #fef3c7;
            color: #92400e;
          }
        }
      }

      .member-detail {
        font-size: 12px;
        color: #6b7280;

        code {
          background: #f3f4f6;
          padding: 2px 6px;
          border-radius: 4px;
          font-family: 'Courier New', monospace;
        }
      }
    }
  }
}

.loading-text, .empty-text {
  padding: 20px;
  text-align: center;
  color: #9ca3af;
  font-size: 14px;
}

.empty-text {
  background: #f9fafb;
  border-radius: 8px;
  border: 1px dashed #d1d5db;
}

// 项目链接和创建按钮
.project-link {
  color: var(--primary-color, #3880ff);
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.2s;

  &:hover {
    color: var(--primary-shade, #2f6ce5);
    text-decoration: none;
  }
}

.no-project {
  color: var(--medium-color, #92949c);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary-color, #3880ff);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-size: inherit;
  transition: color 0.2s;

  &:hover {
    color: var(--primary-shade, #2f6ce5);
  }
}

// 模态框覆盖层
.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: 10000;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

// 模态框对话框
.modal-dialog {
  background: white;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color, #e0e0e0);

  h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--dark-color, #222428);
  }

  .btn-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: var(--medium-color, #92949c);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;

    &:hover {
      background: var(--light-color, #f4f5f8);
      color: var(--dark-color, #222428);
    }
  }
}

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

  .modal-info {
    margin-bottom: 20px;
    padding: 12px 16px;
    background: var(--light-color, #f4f5f8);
    border-radius: 6px;
    border-left: 4px solid var(--primary-color, #3880ff);

    p {
      margin: 0;
      font-size: 14px;
      color: var(--dark-color, #222428);

      strong {
        color: var(--primary-color, #3880ff);
        font-weight: 600;
      }
    }
  }

  .form-group {
    margin-bottom: 16px;

    label {
      display: block;
      margin-bottom: 8px;
      font-size: 14px;
      font-weight: 500;
      color: var(--dark-color, #222428);

      .required {
        color: var(--danger-color, #eb445a);
        margin-left: 4px;
      }
    }

    .form-control {
      width: 100%;
      padding: 10px 12px;
      border: 1px solid var(--border-color, #e0e0e0);
      border-radius: 6px;
      font-size: 14px;
      transition: all 0.2s;

      &:focus {
        outline: none;
        border-color: var(--primary-color, #3880ff);
        box-shadow: 0 0 0 3px rgba(56, 128, 255, 0.1);
      }

      &:disabled {
        background: var(--light-color, #f4f5f8);
        color: var(--medium-color, #92949c);
        cursor: not-allowed;
      }
    }
  }

  .form-tip {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
    background: #f0f7ff;
    border-radius: 6px;
    margin-top: 16px;

    .icon-info {
      flex-shrink: 0;
      color: var(--primary-color, #3880ff);
    }

    span {
      font-size: 13px;
      color: var(--dark-color, #222428);
      line-height: 1.5;
    }
  }
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color, #e0e0e0);

  .btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;

    &.btn-default {
      background: white;
      color: var(--dark-color, #222428);
      border: 1px solid var(--border-color, #e0e0e0);

      &:hover:not(:disabled) {
        background: var(--light-color, #f4f5f8);
      }
    }

    &.btn-primary {
      background: var(--primary-color, #3880ff);
      color: white;

      &:hover:not(:disabled) {
        background: var(--primary-shade, #2f6ce5);
      }
    }

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