.ai-field-config-panel {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e8e8e8;
  box-shadow: 0 4px 16px 0 rgba(13, 13, 13, 0.187);
  z-index: 1000;
  width: 380px;
  // 继承 Popup 容器（floating div）注入的 maxHeight，避免溢出 viewport
  max-height: inherit;

  .ai-field-config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e8e8e8;

    .ai-field-config-header-left {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .ai-field-config-title {
      font-size: 16px;
      font-weight: 500;
      color: #333;
    }
  }

  .ai-field-config-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    // flex 子项默认 min-height: auto 会被内容撑开，破坏 overflow 滚动
    min-height: 0;
  }

  .ai-field-config-section {
    margin-bottom: 20px;

    &:last-child {
      margin-bottom: 0;
    }
  }

  .ai-field-config-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
  }

  // 验证错误提示
  .ai-field-config-validation-error {
    color: #f5222d;
    font-size: 12px;
    margin-top: 8px;
  }

  // 预览区域
  .ai-field-config-preview-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
  }

  .ai-field-config-preview {
    background: #f5f7fa;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 16px;
    min-height: 80px;
    max-height: 200px;
    overflow-y: auto;
    font-size: 13px;
    color: #666;
    line-height: 1.6;

    .ai-field-config-preview-loading {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      color: #999;
      min-height: 48px;
    }

    .ai-field-config-preview-empty {
      color: #999;
      text-align: center;
      padding: 12px 0;
    }

    .ai-field-config-preview-placeholder {
      color: #999;
      text-align: center;
      padding: 12px 0;
    }

    .ai-field-config-preview-error {
      color: #ff4d4f;
      display: flex;
      align-items: center;
      padding: 8px 0;
    }

    .ai-field-config-preview-interrupted {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 12px;
      padding: 12px 0;

      .ai-field-config-preview-interrupted-text {
        color: #666;
        display: flex;
        align-items: center;
        font-size: 13px;
      }
    }

    .ai-field-config-preview-content {
      color: #333;
      white-space: pre-wrap;
      word-wrap: break-word;
    }
  }

  .ai-field-config-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-top: 1px solid #e8e8e8;
    background: #fafafa;
  }
}
