# S300 HMI Design System — AI & Agent Specification (llms.md)

> Version: 1.0.0 | Canvas: 1920x1080 | Targets: Sketch, Web (HTML/CSS), C# WPF (XAML)
> Machine-readable tokens: `./tokens.json` | Web CSS: `./tokens.css` | WPF Dictionary: `./ThemeTokens.xaml`

## 1. Hard Constraints (Must Follow on Every Generation)
- **Versioning**: Always save new `.sketch` iterations with an incrementing `V` suffix (e.g., `首页批次_V16.sketch`). Never overwrite the previous version in place.
- **Forbidden Zones (1920x1080)**:
  - Top system bar: `x=0, y=0, w=1920, h=70` — DO NOT MODIFY.
  - Sub-header bar: `x=16, y=86, w=1888, h=44` — Left: title or `← 主画面 / 批次路径`; Middle: KEEP EMPTY; Right: equipment status badge (`Process`, `x=1774, w=120`).
  - Bottom global nav bar: `x=0, y=1010, w=1920, h=70` — DO NOT MODIFY.
  - Editable main area: `x=16, y=138, w=1888, h=864` (4 rows x `216px`; left FOUP column `160px` on route view / `294px` on main view; 6 module columns x `288px`).

## 2. Semantic Color Tokens
- Primary / Active: `#007BC4` (`--hmi-primary` / `HmiPrimaryBrush`)
- Unstarted / Waiting-to-Start: `#F2F3F5` (`--hmi-bg-unstarted` / `HmiBgUnstartedBrush`) with `#4E5969` text and `#C9CDD4` border
- Empty Module Slot & 0.25px Grid Border: `#C9CDD4` (`--hmi-border-empty` / `HmiEmptyBorderBrush`)
- Module States:
  - `Ready`: `#31B47D` (text `#1D2129`)
  - `Process` (own batch): `#4961D2` (text `#FFFFFF`, 3px bottom progress bar)
  - `Operating` / Queued Waiting: `#F5BC45` (text `#1D2129`)
  - `Error`: `#D43838` (text `#FFFFFF`)
  - `Others` (Maintenance / Offline): `#C9CDD4` (text `#4E5969`)
  - `Other-Batch Occupied` (not waiting): `#DEE3EB` (text `#4E5969`, NO progress bar, NO blue dot)
- Wafer States: `Normal` `#007BC4`, `Warning` `#F5BC45`, `Error` `#D43838` (16x16 circle with 1.5px white border)

## 3. Component Dimensions & Rules
- **Module Card**: `288x36px`, `0px` radius, `0.25px` `#C9CDD4` inner border. Shows Module ID, Wafer Dot + ID (`1-1-22`), `G`/`P` badges (blue only when actively transferring), Status Pill, optional 3px bottom progress bar.
- **Empty Module Slot**: `288x36px`, `#C9CDD4` fill, `0.25px` `#C9CDD4` inner border. Fill all unused slots in the 6x6 grid.
- **FOUP Card (Route View)**: `160x216px` (`30px` white header with `1-x Foup` + status pill + red `异常1片`; white lot-ID pill `L-LHPS-01`; `完成 X/25 · 加工中 Y`; amber `等待 <Station> · <Batch>占用` or red `异常 1 · <Station>`; 5x5 slot grid).
- **Horizontal Scroll (>6 steps)**: Keep left FOUP fixed; add right-edge scroll chevron and bottom 4px scrollbar on the right module area. Max 6 parallel chambers per step.

## 4. S300 Hardware Truth Rules
- Shared front-end only (before Lift): `21-12/11/20/19 TRS` (CRA <-> LRA) and `21-14/13 ADH` (COT only).
- Independent 4 back-end decks (never shared):
  - Deck 34 (DEV): `34-34/33 SCPL(进)` -> `34-1/2 DEV` -> `34-21/22/23/11/12/13 CLHP` -> `34-34/33 SCPL(出)`
  - Decks 33/32/31 (COT): `3x-34/33 SCPL(进)` -> `3x-1/2 COT` -> `3x-21/11/12/13 CHCH` -> `3x-34/33 SCPL(出)`
- State consistency: Left summary counts MUST exactly match right-side processing and error cards. Viewing routes NEVER mutates `待启动` into `运行中`.
