## ADDED Requirements

### Requirement: Document management SHALL support three attachment categories

The document management console SHALL provide separate upload and editing areas for image attachments, video attachments, and generic file attachments, and the three categories SHALL all persist attachment IDs to the document record.

#### Scenario: User uploads generic files to a document

- **WHEN** a management user adds files in the file attachment area and saves the document
- **THEN** the saved document SHALL persist those attachment IDs in `document_file`

#### Scenario: Existing attachments are editable by category

- **WHEN** a management user opens a document in edit mode
- **THEN** the page SHALL show existing images, videos, and files in their corresponding sections and allow removing them from the document

### Requirement: Document editor visibility and state SHALL follow editing intent

The document management page SHALL load with the document list only, keep the editor hidden until the user enters create or edit mode, and SHALL remain in the current editing context after upload or save operations.

#### Scenario: Page loads without editor

- **WHEN** the user first opens `/pb/manage/document-manage`
- **THEN** the page SHALL show the document list and SHALL NOT show the editor section until create or edit mode is entered

#### Scenario: Save keeps current editing context

- **WHEN** the user successfully creates or updates a document
- **THEN** the page SHALL stay on the current document editing context instead of clearing the form and forcing a return to blank create mode

#### Scenario: Upload does not reset editor mode

- **WHEN** the user uploads attachments while editing a document
- **THEN** the page SHALL keep the current editor state and SHALL NOT implicitly switch modes

### Requirement: Document management SHALL provide immediate user feedback

The document management console SHALL show operation feedback both in the global page status area and near the save actions so that users receive confirmation or error context without scrolling.

#### Scenario: Local save feedback is visible

- **WHEN** a save or upload request succeeds or fails
- **THEN** the page SHALL show the status message below the save controls in addition to the top-level message area

#### Scenario: Long-running requests show blocking feedback

- **WHEN** the page is waiting for a long-running upload, save, delete, or query response
- **THEN** it SHALL show a full-screen loading mask so the user can tell the action is in progress

### Requirement: Document and dictionary images SHALL support full-screen preview

Image previews rendered in the management pages SHALL support opening the original image in a full-screen preview overlay.

#### Scenario: User previews an image

- **WHEN** the user clicks an image preview in document or dictionary management
- **THEN** the page SHALL open a full-screen overlay showing the original image and SHALL allow closing it with explicit controls
