Peach: Local-first video metadata scraper and media manager.
fix(web): 按 BoardUI 取证收齐输入焦点环与设置弹层滚动条,补源码托盘重启命令
longmeidao3910e5657d7e
diff --git a/docs/FRONTEND.md b/docs/FRONTEND.mdindex f266787f7..fc97b58fe 100644--- a/docs/FRONTEND.md+++ b/docs/FRONTEND.md@@ -33,7 +33,7 @@ island。原因是那一套一上来就打 `/api/items`,而未配置的机器那一块按它自己的 `.configgroup` 拆成「通用 / 媒体 / 网络与访问 / 更新与维护」四条。`/configuration` 这条路由保留,媒体库选单和首次配置引导都指向它。服务端按两道门放行:托盘管理的服务、发起连接的是本机;并在 `/healthz` 里按调用方回-`configurable`,遗留层据此决定这一块是挂 island 还是换成一句「这台设备上改不了」。+`configurable`,遗留层据此决定这一块是挂 island 还是换成一句「该配置需在服务端设备修改」。表单校验的原因由服务端按字段给(400 的 `errors`),island 写回原位,不在前端复制判定。浏览器直接导航撞上 `HTTPException` 时,`api.py` 的处理器按 `Accept` 回一张 HTML 错误页(`routes_pages.error_page`),`/api/` 下和非导航请求仍回 JSON。diff --git a/docs/reference-snapshots/upstream/boardui-input.json b/docs/reference-snapshots/upstream/boardui-input.jsonnew file mode 100644index 000000000..4cbc39e6d--- /dev/null+++ b/docs/reference-snapshots/upstream/boardui-input.json@@ -0,0 +1,52 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "input",+ "type": "registry:ui",+ "title": "Input",+ "description": "Text input with label, hint text, error states, and leading icon support.",+ "dependencies": [+ "@remixicon/react@^4.9.0",+ "react-aria-components@^1.17.0"+ ],+ "registryDependencies": [+ "cx"+ ],+ "files": [+ {+ "path": "components/base/input/hint-text.tsx",+ "content": "\"use client\";\n\nimport type { ReactNode, Ref } from \"react\";\nimport type { TextProps as AriaTextProps } from \"react-aria-components\";\nimport { Text as AriaText } from \"react-aria-components\";\nimport { cx } from \"@/utils/cx\";\n\n/**\n * Caption text rendered below a field. Wraps `react-aria-components`' Text\n * so the parent `TextField` automatically wires `aria-describedby` (when\n * `slot=\"description\"`) or `aria-errormessage` (when `slot=\"errorMessage\"`).\n *\n * Visuals come from Figma:\n * - Inter Medium 12/16, letter-spacing 0.15px\n * - color text/secondary (default) or text/error-primary (invalid)\n * - 1px top padding to align with the field's bottom edge\n */\n\nexport interface HintTextProps extends AriaTextProps {\n children: ReactNode;\n isInvalid?: boolean;\n ref?: Ref<HTMLElement>;\n}\n\nexport function HintText({\n isInvalid = false,\n className,\n ...props\n}: HintTextProps) {\n return (\n <AriaText\n slot={isInvalid ? \"errorMessage\" : \"description\"}\n {...props}\n className={cx(\n \"pt-px text-caption-1-medium text-text-secondary\",\n isInvalid && \"text-text-error-primary\",\n className,\n )}\n />\n );\n}\n",+ "type": "registry:component",+ "target": "components/base/input/hint-text.tsx"+ },+ {+ "path": "components/base/input/input.tsx",+ "content": "\"use client\";\n\nimport {\n createContext,\n useContext,\n type ComponentType,\n type ReactNode,\n type Ref,\n} from \"react\";\nimport {\n Group as AriaGroup,\n Input as AriaInput,\n TextField as AriaTextField,\n} from \"react-aria-components\";\nimport type {\n InputProps as AriaInputProps,\n TextFieldProps as AriaTextFieldProps,\n} from \"react-aria-components\";\nimport { Label } from \"./label\";\nimport { HintText } from \"./hint-text\";\nimport { cx, sortCx } from \"@/utils/cx\";\n\n/**\n * Figma source: Board UI → Input (node 3665:1849).\n *\n * Architecture (mirrors the Untitled UI / React Aria pattern):\n *\n * InputBase — the styled field shell. Renders <AriaGroup> + adornments\n * + <AriaInput>. State (hover / focus / disabled / invalid)\n * arrives as render-prop booleans from Aria.\n * TextField — wraps <AriaTextField> and a TextFieldContext so size /\n * classes can flow from the composer down into InputBase\n * without prop drilling.\n * Input — opinionated composition: TextField → Label → InputBase\n * → HintText. The component most consumers use.\n *\n * Why React Aria:\n * - Label ↔ input ↔ hint association via aria-labelledby / aria-describedby\n * - aria-required, aria-invalid auto-applied\n * - Form library / native validation integration\n * - i18n, RTL, autofill edge cases handled\n * - Render-prop state surfaces `isFocusWithin`, `isHovered`, `isDisabled`,\n * `isInvalid`, `isRequired` — no CSS pseudo gymnastics\n *\n * Visuals stay 1:1 with Figma — see `styles/theme.css` for the tokens.\n */\n\nexport type InputSize = \"medium\" | \"small\";\n\ntype IconComponent = ComponentType<{\n className?: string;\n \"aria-hidden\"?: boolean | \"true\" | \"false\";\n}>;\n\n/* -------------------------------------------------------------------------- */\n/* TextFieldContext */\n/* -------------------------------------------------------------------------- */\n\nexport interface TextFieldContextValue {\n size?: InputSize;\n fieldClassName?: string;\n inputClassName?: string;\n}\n\n/**\n * Shared by every field that wants Input's shell — `Textarea` reads the same\n * size and class overrides out of it, so a composed form stays consistent.\n */\nexport const TextFieldContext = createContext<TextFieldContextValue>({});\n\n/* -------------------------------------------------------------------------- */\n/* TextField */\n/* -------------------------------------------------------------------------- */\n\nexport interface TextFieldProps\n extends Omit<AriaTextFieldProps, \"className\">,\n TextFieldContextValue {\n className?: string;\n children?: ReactNode | ((state: { isRequired: boolean; isInvalid: boolean; isDisabled: boolean; isReadOnly: boolean }) => ReactNode);\n}\n\nexport function TextField({\n size = \"medium\",\n fieldClassName,\n inputClassName,\n className,\n children,\n ...props\n}: TextFieldProps) {\n return (\n <TextFieldContext.Provider value={{ size, fieldClassName, inputClassName }}>\n <AriaTextField\n {...props}\n data-input-size={size}\n className={cx(\n \"group flex h-max w-full flex-col items-start gap-1\",\n className,\n )}\n >\n {children as never /* RAC accepts render-prop children */}\n </AriaTextField>\n </TextFieldContext.Provider>\n );\n}\n\nTextField.displayName = \"TextField\";\n\n/* -------------------------------------------------------------------------- */\n/* InputBase */\n/* -------------------------------------------------------------------------- */\n\nexport interface InputBaseProps extends Omit<AriaInputProps, \"size\" | \"className\"> {\n size?: InputSize;\n className?: string;\n leadingIcon?: IconComponent;\n trailingIcon?: IconComponent;\n /** Custom element rendered in the leading slot (Phone basic uses this). */\n leadingAddon?: ReactNode;\n /** Class for the field shell. */\n fieldClassName?: string;\n /** Ref to the <input> element. */\n ref?: Ref<HTMLInputElement>;\n /** Ref to the field shell wrapper. */\n groupRef?: Ref<HTMLDivElement>;\n}\n\nconst inputStyles = sortCx({\n field: [\n \"relative flex w-full items-center\",\n \"rounded-2lg\",\n \"bg-background-tertiary-default text-foreground-icon-tertiary\",\n \"ring-2 ring-inset ring-transparent\",\n \"transition-[background-color,box-shadow,color] duration-[var(--input-transition-ms)] ease\",\n ].join(\" \"),\n\n fieldSize: {\n medium: \"p-2\", // 8px all sides → h auto = 36\n small: \"h-8 px-1.5 py-2\", // 32 / 6 / 8\n },\n\n // When a leadingAddon is present (Phone basic): tighten left padding.\n fieldWithAddonSize: {\n medium: \"h-9 pl-1 pr-2 py-2\", // 36 / 4 / 8 / 8\n small: \"h-8 pl-1 pr-1.5 py-2\",\n },\n\n content: \"flex w-full items-center gap-2 min-w-0\",\n leftSection: \"flex flex-1 items-center gap-0.5 min-w-0\",\n\n input: [\n \"min-w-0 flex-1 bg-transparent border-0 outline-none p-0 m-0\",\n \"font-sans text-body-regular text-text-primary pl-1\",\n \"placeholder:text-text-tertiary\",\n \"focus:placeholder:text-text-primary\",\n \"disabled:text-input-disabled-text disabled:placeholder:text-input-disabled-text\",\n \"disabled:cursor-not-allowed\",\n \"aria-invalid:placeholder:text-text-error-placeholder\",\n ].join(\" \"),\n\n icon: \"size-5 shrink-0\",\n});\n\nexport function InputBase({\n size: sizeProp,\n leadingIcon: Leading,\n trailingIcon: Trailing,\n leadingAddon,\n fieldClassName,\n className,\n ref,\n groupRef,\n ...inputProps\n}: InputBaseProps) {\n const ctx = useContext(TextFieldContext);\n const size: InputSize = sizeProp ?? ctx.size ?? \"medium\";\n const hasAddon = leadingAddon !== undefined && leadingAddon !== null;\n\n return (\n <AriaGroup\n ref={groupRef}\n className={({ isFocusWithin, isHovered, isDisabled, isInvalid }) =>\n cx(\n inputStyles.field,\n hasAddon\n ? inputStyles.fieldWithAddonSize[size]\n : inputStyles.fieldSize[size],\n // Hover: idle, no focus, no disabled, no invalid\n isHovered &&\n !isFocusWithin &&\n !isDisabled &&\n !isInvalid &&\n \"ring-border-button-hover\",\n // Focus wins over hover\n isFocusWithin &&\n !isDisabled &&\n !isInvalid &&\n \"ring-border-button-active\",\n // Disabled\n isDisabled &&\n \"bg-input-disabled-background text-input-disabled-foreground\",\n // Invalid\n isInvalid && \"bg-background-tertiary-error text-foreground-icon-error\",\n ctx.fieldClassName,\n fieldClassName,\n )\n }\n >\n <div className={inputStyles.content}>\n <div className={inputStyles.leftSection}>\n {hasAddon ? (\n leadingAddon\n ) : Leading ? (\n <Leading className={inputStyles.icon} aria-hidden />\n ) : null}\n <AriaInput\n ref={ref}\n {...inputProps}\n className={cx(inputStyles.input, ctx.inputClassName, className)}\n />\n </div>\n {Trailing ? (\n <Trailing className={inputStyles.icon} aria-hidden />\n ) : null}\n </div>\n </AriaGroup>\n );\n}\n\nInputBase.displayName = \"InputBase\";\n\n/* -------------------------------------------------------------------------- */\n/* Input (composed) */\n/* -------------------------------------------------------------------------- */\n\nexport interface InputProps\n extends Omit<TextFieldProps, \"children\">,\n Pick<\n InputBaseProps,\n | \"leadingIcon\"\n | \"trailingIcon\"\n | \"leadingAddon\"\n | \"fieldClassName\"\n | \"groupRef\"\n | \"ref\"\n > {\n label?: ReactNode;\n hint?: ReactNode;\n /** Show an info icon next to the label. Replace with tooltip when Tooltip lands. */\n tooltip?: boolean | string;\n placeholder?: string;\n}\n\nexport function Input({\n label,\n hint,\n tooltip,\n placeholder,\n leadingIcon,\n trailingIcon,\n leadingAddon,\n fieldClassName,\n ref,\n groupRef,\n className,\n ...textFieldProps\n}: InputProps) {\n return (\n <TextField\n {...textFieldProps}\n className={className}\n // Don't clobber an explicit aria-label; fall back to the placeholder\n // only for unlabelled fields that don't provide one.\n aria-label={\n textFieldProps[\"aria-label\"] ??\n (!label && typeof placeholder === \"string\" ? placeholder : undefined)\n }\n >\n {({ isRequired, isInvalid }) => (\n <>\n {label && (\n <Label\n isRequired={isRequired}\n isInvalid={isInvalid}\n tooltip={tooltip}\n >\n {label}\n </Label>\n )}\n <InputBase\n ref={ref}\n groupRef={groupRef}\n placeholder={placeholder}\n leadingIcon={leadingIcon}\n trailingIcon={trailingIcon}\n leadingAddon={leadingAddon}\n fieldClassName={fieldClassName}\n />\n {hint && <HintText isInvalid={isInvalid}>{hint}</HintText>}\n </>\n )}\n </TextField>\n );\n}\n\nInput.displayName = \"Input\";\n",+ "type": "registry:component",+ "target": "components/base/input/input.tsx"+ },+ {+ "path": "components/base/input/label.tsx",+ "content": "\"use client\";\n\nimport type { ReactNode, Ref } from \"react\";\nimport { RiInformationFill } from \"@remixicon/react\";\nimport type { LabelProps as AriaLabelProps } from \"react-aria-components\";\nimport { Label as AriaLabel } from \"react-aria-components\";\nimport { cx } from \"@/utils/cx\";\n\n/**\n * Field label. Wraps `react-aria-components`' Label so the parent `TextField`\n * automatically wires `htmlFor` / `aria-labelledby`.\n *\n * Visuals come from Figma:\n * - Inter Medium 14/20, color text/primary\n * - 2px gap between label + required asterisk + info icon\n * - asterisk is text/error-primary (red/500)\n * - info icon is 16×16 in foreground/icon/quaternary\n *\n * Pass `isRequired` to show the asterisk. Pass `tooltip` to show the info\n * icon (currently a static glyph — when the Tooltip component lands it'll\n * wire up here).\n */\n\nexport interface LabelProps extends AriaLabelProps {\n children: ReactNode;\n isRequired?: boolean;\n /** Reserved for invalid-aware styling (asterisk color, etc.) once we need it. */\n isInvalid?: boolean;\n /** Show the info icon next to the label. */\n tooltip?: boolean | string;\n ref?: Ref<HTMLLabelElement>;\n}\n\nexport function Label({\n isRequired = false,\n isInvalid: _isInvalid,\n tooltip,\n className,\n children,\n ...props\n}: LabelProps) {\n void _isInvalid;\n return (\n <AriaLabel\n data-label=\"true\"\n {...props}\n className={cx(\n \"flex cursor-default items-center gap-0.5\",\n \"text-body-medium text-text-primary\",\n className,\n )}\n >\n {children}\n {isRequired && (\n <span\n aria-hidden=\"true\"\n className=\"text-body-medium text-text-error-primary\"\n >\n *\n </span>\n )}\n {tooltip && (\n <RiInformationFill\n className=\"size-4 shrink-0 text-foreground-icon-quaternary\"\n aria-hidden\n />\n )}\n </AriaLabel>\n );\n}\n",+ "type": "registry:component",+ "target": "components/base/input/label.tsx"+ }+ ],+ "meta": {+ "docsUrl": "https://www.boardui.com/components/input",+ "example": "import { Input } from \"@/components/base/input/input\";\nimport { RiUserSmileLine, RiQuestionLine } from \"@remixicon/react\";\n\nexport function Example() {\n return (\n <Input\n label=\"Email\"\n isRequired\n tooltip\n placeholder=\"Enter your email\"\n hint=\"This is a hint about this input.\"\n leadingIcon={RiUserSmileLine}\n trailingIcon={RiQuestionLine}\n />\n );\n}",+ "snippets": [+ {+ "label": "size",+ "code": "// medium (default, 36px) and small (32px).\n<Input size=\"medium\" label=\"Email\" placeholder=\"Enter your email\" /* … */ />\n<Input size=\"small\" label=\"Email\" placeholder=\"Enter your email\" /* … */ />"+ },+ {+ "label": "states",+ "code": "// Hover / focus cross-fade the ring automatically. isDisabled and\n// isInvalid override them and repaint the field, hint and label.\n<Input label=\"Email\" placeholder=\"Enter your email\" /* default */ />\n<Input label=\"Email\" value=\"[email protected]\" /* filled */ />\n<Input label=\"Email\" placeholder=\"Enter your email\" isDisabled />\n<Input label=\"Email\" value=\"not-a-real-email\" isInvalid />"+ },+ {+ "label": "phone",+ "code": "import * as Flags from \"country-flag-icons/react/3x2\";\nimport { getCountryDataList } from \"countries-list\";\nimport { Select, SelectItem } from \"@/components/base/select/select\";\n\n// Real ISO countries that ship a flag + a dial code, sorted by name.\nconst COUNTRIES = getCountryDataList()\n .filter((c) => Flags[c.iso2] && c.phone.length > 0)\n .map((c) => ({ iso2: c.iso2, name: c.name, dial: c.phone[0] }))\n .sort((a, b) => a.name.localeCompare(b.name));\n\n// The country-code Select goes in the input's leading addon slot.\n<Input\n label=\"Phone Number\"\n placeholder=\"(123) 000-0000\"\n leadingAddon={<CountryCodeSelect />}\n trailingIcon={RiQuestionLine}\n/>\n\nfunction CountryCodeSelect() {\n const [iso2, setIso2] = useState(\"US\");\n const dial = COUNTRIES.find((c) => c.iso2 === iso2)?.dial;\n return (\n <Select\n aria-label=\"Country code\"\n selectedKey={iso2}\n onSelectionChange={(key) => setIso2(String(key))}\n triggerClassName=\"rounded-lg px-1.5 py-1\"\n popoverClassName=\"w-[220px]\"\n renderValue={() => <><Flag iso2={iso2} /> +{dial}</>}\n >\n {COUNTRIES.map((c) => (\n <SelectItem key={c.iso2} id={c.iso2} textValue={c.name}>\n <Flag iso2={c.iso2} />\n <span className=\"flex-1 truncate\">{c.name}</span>\n <span className=\"text-text-tertiary\">+{c.dial}</span>\n </SelectItem>\n ))}\n </Select>\n );\n}"+ }+ ]+ }+}diff --git a/docs/reference-snapshots/upstream/boardui-theme.json b/docs/reference-snapshots/upstream/boardui-theme.jsonnew file mode 100644index 000000000..2525a65e1--- /dev/null+++ b/docs/reference-snapshots/upstream/boardui-theme.json@@ -0,0 +1,20 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "theme",+ "type": "registry:lib",+ "title": "Theme tokens",+ "description": "Color primitives, semantic tokens (text/background/border/foreground/chart), radii, shadows, and button gradient utilities.",+ "dependencies": [],+ "registryDependencies": [],+ "files": [+ {+ "path": "styles/theme.css",+ "content": "/* ---------------------------------------------------------------------------\n * BoardUI theme tokens\n *\n * Layered as Tailwind v4 expects:\n * @theme { ... } primitives + ramp overrides → Tailwind utilities\n * :root { ... } semantic tokens (light mode) — reference primitives\n * .dark { ... } semantic overrides (dark mode) — landed when designed\n * @theme inline {..} re-export of semantic tokens so they become utilities\n *\n * See docs/FIGMA_WORKFLOW.md for how tokens get added (Figma is source of truth).\n * --------------------------------------------------------------------------- */\n\n@theme {\n /* ----- Color primitives ----------------------------------------------------\n * Almost the entire palette matches Tailwind v4's OKLCH defaults. The four\n * overrides below are the only intentional deviations (see Figma → variables\n * → color/...).\n * --------------------------------------------------------------------------*/\n --color-slate-200: #ebeff5;\n --color-neutral-100: #f7f7f7;\n --color-neutral-200: #ebebeb;\n --color-neutral-925: #121212;\n --color-blue-400: #3392ff;\n\n /* ----- Accent ramp ---------------------------------------------------------\n * The CTA hue. Interactive/selection surfaces (primary button gradient,\n * ghost + link buttons, checkbox, radio, switch, slider, tabs, sidebar\n * selected, focus ring, date-range selection) reference accent-* instead of\n * a raw hue, so the whole system re-tints by overriding these eleven\n * variables at runtime (see components/application/theme/accent.ts) or in\n * a customer project after importing this file. Defaults to the blue\n * primitives above. Content/data blues (charts, status chips, calendar\n * events, info notifications) deliberately keep referencing blue-*.\n * --------------------------------------------------------------------------*/\n --color-accent-50: var(--color-blue-50);\n --color-accent-100: var(--color-blue-100);\n --color-accent-200: var(--color-blue-200);\n --color-accent-300: var(--color-blue-300);\n --color-accent-400: var(--color-blue-400);\n --color-accent-500: var(--color-blue-500);\n --color-accent-600: var(--color-blue-600);\n --color-accent-700: var(--color-blue-700);\n --color-accent-800: var(--color-blue-800);\n --color-accent-900: var(--color-blue-900);\n --color-accent-950: var(--color-blue-950);\n\n /* ----- Typography ----------------------------------------------------------\n * Font sizes, weights, line-heights, and tracking all match Tailwind v4\n * defaults. The only override is the family: Inter, loaded via next/font\n * in app/layout.tsx, which exposes --font-inter to the document.\n * --------------------------------------------------------------------------*/\n --font-sans: var(--font-inter), ui-sans-serif, system-ui, sans-serif,\n \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\",\n \"Noto Color Emoji\";\n\n /* Monospace ramp for code blocks. Loaded via next/font in app/layout.tsx\n * (--font-mono-source → JetBrains Mono). Figma's spec uses IBM Plex Mono;\n * JetBrains Mono is the closest already-bundled face. */\n --font-mono: var(--font-mono-source), ui-monospace, \"SFMono-Regular\", Menlo,\n Consolas, \"Liberation Mono\", monospace;\n\n /* ----- Radii ---------------------------------------------------------------\n * Extra step between lg (8) and xl (12). Used by medium-size buttons.\n * Figma name: radius/2lg.\n * --------------------------------------------------------------------------*/\n --radius-2lg: 10px;\n --radius-notification-card: 10px;\n\n /* ----- Shadows -------------------------------------------------------------\n * 2xs, xs, 2xl and the inner shadows already match Tailwind v4. Sizes sm, md,\n * lg, xl follow the Figma 6%/10% recipe (slightly softer than Tailwind v4's\n * 10%/10% default).\n * --------------------------------------------------------------------------*/\n --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.06), 0 1px 3px 0 rgb(0 0 0 / 0.10);\n --shadow-md: 0 2px 4px -1px rgb(0 0 0 / 0.06), 0 4px 6px -1px rgb(0 0 0 / 0.10);\n --shadow-lg: 0 4px 6px -2px rgb(0 0 0 / 0.05), 0 10px 15px -3px rgb(0 0 0 / 0.10);\n --shadow-xl: 0 10px 10px -5px rgb(0 0 0 / 0.04), 0 20px 25px -5px rgb(0 0 0 / 0.10);\n\n /* Figma effect style \"Background/Sidebar Elevation\" — copied 1:1:\n * DROP_SHADOW #00000005 offset(0,1) radius 0 spread 0 → 0 1px 0px 0 / 0.0196\n * DROP_SHADOW #0000000F offset(0,1) radius 12 spread 0 → 0 1px 12px 0 / 0.0588\n * DROP_SHADOW #00000052 offset(0,0) radius 1 spread 0 → 0 0 1px 0 / 0.3216\n * (alpha = hex byte / 255: 05→0.0196, 0F→0.0588, 52→0.3216). */\n --shadow-sidebar:\n 0 1px 0 0 rgb(0 0 0 / 0.0196),\n 0 1px 12px 0 rgb(0 0 0 / 0.0588),\n 0 0 1px 0 rgb(0 0 0 / 0.3216);\n\n /* Figma effect style \"Sidebar selected\" — copied 1:1:\n * DROP_SHADOW color/blue/500 offset(0,0) radius 0 spread 1 → 0 0 0 1px blue-500\n * INNER_SHADOW #FFFFFF40 offset(0,1) radius 0 spread 0 → inset 0 1px 0 0 / 0.251\n * (#FFFFFF40 alpha = 0x40/255 = 0.251). */\n --shadow-nav-selected:\n 0 0 0 1px var(--color-accent-500),\n inset 0 1px 0 0 rgb(255 255 255 / 0.251);\n\n /* Checkbox checked/indeterminate surface (from the Figma Checkbox component):\n * inner top highlight + 1px inner blue edge over the primary gradient. */\n --shadow-checkbox-selected:\n inset 0 2px 0 0 rgb(255 255 255 / 0.25),\n inset 0 0 0 1px var(--color-accent-500);\n\n /* 1px contact shadow used on white cards/dropdown triggers sitting on the\n * secondary background (Figma drop shadow 0 1 1 5%). */\n --shadow-card: 0 1px 1px 0 rgb(0 0 0 / 0.05);\n\n /* Floating menu/dropdown panel (Figma → sidebar profile menu node 3823:3699):\n * DROP_SHADOW #0000000A offset(0,1) radius 1 → 0 1px 1px 0 / 0.04\n * DROP_SHADOW #00000005 offset(0,4) radius 4 → 0 4px 4px 0 / 0.02 */\n --shadow-dropdown:\n 0 1px 1px 0 rgb(0 0 0 / 0.04),\n 0 4px 4px 0 rgb(0 0 0 / 0.02);\n\n /* Floating template waitlist (Figma node 4117:32737). This extends the\n * sidebar elevation recipe with the two broad ambient layers used by the\n * signup surface. */\n --shadow-waitlist:\n 0 0 6px 0 rgb(0 0 0 / 0.06),\n 0 0 64px 0 rgb(0 0 0 / 0.16),\n 0 0 1px 0 rgb(0 0 0 / 0.32),\n 0 1px 12px 0 rgb(0 0 0 / 0.06),\n 0 1px 0 0 rgb(0 0 0 / 0.02);\n\n /* Inner shadows (Figma names inner-shadow/*; Tailwind utility prefix is\n * inset-shadow-*).\n */\n --inset-shadow-2xs: inset 0 1px 0 0 rgb(0 0 0 / 0.05);\n --inset-shadow-xs: inset 0 1px 1px 0 rgb(0 0 0 / 0.05);\n --inset-shadow-sm: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);\n}\n\n/* ---------------------------------------------------------------------------\n * Semantic tokens — light mode.\n *\n * All values reference primitives via var(--color-{family}-{shade}). Edit the\n * primitives in @theme above and these update automatically.\n *\n * Figma name on the left, var name on the right:\n * foreground/full → --color-foreground-full\n * foreground/icon/primary → --color-foreground-icon-primary\n * foreground/disabled → --color-foreground-disabled\n * foreground/disabled-danger → --color-foreground-disabled-danger\n * text/primary → --color-text-primary\n * text/tertiary → --color-text-tertiary\n * text/disabled-danger → --color-text-disabled-danger\n * background/primary/default → --color-background-primary-default\n * background/primary/hover → --color-background-primary-hover\n * background/primary/active → --color-background-primary-active\n * background/primary/disabled → --color-background-primary-disabled\n * background/secondary/default → --color-background-secondary-default\n * border/button/default → --color-border-button-default\n * border/button/hover → --color-border-button-hover\n * border/button/active → --color-border-button-active\n *\n * Button gradients (linear, 180°, light stop → dark stop) sourced from the\n * blue/red primitives that each Button/{type}/{state} style references in\n * Figma. Direction inferred — confirm visually against Figma.\n * --------------------------------------------------------------------------- */\n:root {\n /* Foreground (icons + on-fill content) */\n --color-foreground-full: var(--color-white);\n --color-foreground-icon-primary: var(--color-neutral-950);\n --color-foreground-icon-hover: var(--color-black);\n --color-foreground-icon-secondary: var(--color-neutral-500);\n --color-foreground-icon-tertiary: var(--color-neutral-400);\n --color-foreground-icon-quaternary: var(--color-neutral-300);\n --color-foreground-icon-error: var(--color-red-600);\n --color-foreground-icon-disabled: var(--color-neutral-300);\n --color-foreground-disabled: var(--color-neutral-400);\n --color-foreground-disabled-danger: var(--color-red-300);\n --color-input-disabled-foreground: var(--color-neutral-300);\n --color-icon-button-disabled-foreground: var(--color-neutral-300);\n --color-button-primary-disabled-foreground: var(--color-neutral-400);\n\n /* Text */\n --color-text-primary: var(--color-neutral-950);\n --color-text-secondary: var(--color-neutral-500);\n --color-text-tertiary: var(--color-neutral-400);\n --color-text-disabled: var(--color-neutral-300);\n --color-text-disabled-danger: var(--color-red-300);\n --color-text-placeholder: var(--color-neutral-400);\n --color-text-error-primary: var(--color-red-500);\n --color-input-disabled-text: var(--color-neutral-300);\n --color-text-white: var(--color-white);\n\n /* Background */\n --color-background-full: var(--color-white);\n --color-background-primary-default: var(--color-white);\n --color-background-inner-default: var(--color-white);\n --color-background-primary-hover: var(--color-neutral-100);\n --color-background-primary-active: var(--color-neutral-200);\n --color-background-primary-disabled: var(--color-neutral-100);\n --color-input-disabled-background: var(--color-neutral-100);\n --color-background-secondary-default: var(--color-neutral-100);\n --color-background-secondary-hover: var(--color-neutral-200);\n --color-background-tertiary-default: var(--color-neutral-200);\n --color-background-tertiary-hover: var(--color-neutral-300);\n --color-background-tertiary-error: var(--color-red-100);\n --color-background-recent-hire-role: var(--color-neutral-100);\n --color-avatar-neutral-background: var(--color-neutral-300);\n /* Figma background/quaternary/default — first used by the Storage\n * dropzone's upload-icon disc (node 4106:26587). */\n --color-background-quaternary-default: var(--color-neutral-300);\n --color-background-quaternary-hover: var(--color-neutral-400);\n --color-background-quaternary-error: var(--color-red-200);\n --color-file-upload-icon-background: var(--color-neutral-300);\n --color-file-upload-icon-foreground: var(--color-neutral-400);\n --color-file-upload-icon-foreground-hover: var(--color-neutral-500);\n\n /* Border */\n --color-border-button-default: var(--color-neutral-200);\n --color-border-button-hover: var(--color-neutral-300);\n --color-border-button-active: var(--color-neutral-400);\n --color-border-button-white: var(--color-white);\n /* The system had no red border. Matches text/error/primary so an invalid\n field's edge and its message are the same red. */\n --color-border-error-default: var(--color-red-500);\n --color-border-checkbox-default: var(--color-neutral-300);\n --color-border-checkbox-hover: var(--color-neutral-400);\n --color-border-checkbox-active: var(--color-neutral-400);\n --color-border-checkbox-white: var(--color-white);\n --color-border-component-detail-container: var(--color-neutral-200);\n --color-border-ai-profile-card: var(--color-neutral-200);\n --color-border-table: var(--color-neutral-200);\n --color-border-button-group: var(--color-neutral-200);\n --color-border-sidebar-profile-hover: var(--color-neutral-300);\n --color-separator-border: var(--color-neutral-200);\n --color-separator-border-strong: var(--color-neutral-200);\n --color-border-focus-ring: var(--color-accent-500);\n\n /* State */\n --color-state-success-text: var(--color-lime-800);\n --color-state-success-base: var(--color-lime-200);\n\n /* Selected control interiors remain light on colored tracks in both themes. */\n --color-control-indicator-background: var(--color-white);\n --color-control-indicator-background-subtle: var(--color-neutral-100);\n --color-switch-off-chip-start: var(--color-white);\n --color-switch-off-chip-end: var(--color-neutral-100);\n /* Selected switch chip: the Figma comps use hexes a touch deeper than the\n * plain 500→600 ramp (#2473fe → #0450e2 for blue). Expressed as oklab mixes\n * of neighbouring accent stops so the recipe survives a re-tint. */\n --color-switch-on-chip-start: color-mix(in oklab, var(--color-accent-500) 63%, var(--color-accent-600));\n --color-switch-on-chip-end: color-mix(in oklab, var(--color-accent-600) 16%, var(--color-accent-700));\n --color-stat-card-icon-background: var(--color-white);\n --color-segmented-control-background: var(--color-neutral-100);\n --color-segmented-control-selected-background: var(--color-white);\n --color-theme-toggle-sidebar-background: var(--color-neutral-200);\n --color-theme-toggle-sidebar-selected-background: var(--color-white);\n /* Stepped against the composer: the pill is white and the add button is the\n * subtle grey sitting on it, so the control separates from the surface it\n * shares an edge with. Dark mode keeps its own pair, where the pill is the\n * lighter of the two and the button steps the other way. */\n --color-ai-chat-composer-add-background: var(--color-neutral-100);\n --color-ai-chat-composer-add-hover-background: var(--color-neutral-200);\n /* Composer Panel (Figma node 4430:12203): the status tab hanging off the\n * card's top edge and the card's plus button are both neutral-200 in light\n * mode. Dark mode steps them up instead, so they still separate from the\n * neutral-800 card they touch. */\n --color-composer-panel-tab-background: var(--color-neutral-200);\n --color-composer-panel-add-background: var(--color-neutral-200);\n --color-composer-panel-add-hover-background: var(--color-neutral-300);\n /* Attachment tile edge: the Figma neutral-200 in light mode; dark mode\n * uses a translucent white so the ring reads on the neutral-800 card\n * (border/button/default is one neutral step away there and vanishes). */\n --color-composer-panel-tile-border: var(--color-neutral-200);\n /* Model picker provider rail: background/secondary in light mode, at\n * half opacity in dark so it recedes on the neutral-800 panel. */\n --color-composer-panel-rail-background: var(--color-neutral-100);\n /* Questionnaire (Figma nodes 4435:14749 / 4435:15042): the answer rows share\n * the card's background/primary surface in both modes, separated by their\n * border alone, and the \"Other\" row uses the stock Input untouched. The\n * single-select number key is background/secondary in light mode and one\n * tone lighter than the row in dark mode (never darker), stepping again\n * while its row is hovered so it stays legible on the lifted fill. */\n --color-questionnaire-key-background: var(--color-neutral-100);\n --color-questionnaire-key-hover-background: var(--color-neutral-200);\n --color-agent-progress-ring: var(--color-neutral-700);\n --color-button-ghost-background: var(--color-accent-100);\n --color-button-ghost-hover: var(--color-accent-200);\n --color-button-ghost-active: var(--color-accent-300);\n --color-button-ghost-disabled: var(--color-accent-50);\n --color-button-ghost-foreground: var(--color-accent-700);\n --color-button-ghost-disabled-foreground: var(--color-accent-300);\n --color-dropdown-item-hover-background: var(--color-neutral-100);\n --color-kbd-background: var(--color-neutral-300);\n --color-kbd-foreground: var(--color-neutral-500);\n --color-docs-file-chip-background: var(--color-purple-50);\n --color-docs-file-chip-border: var(--color-purple-100);\n --color-docs-file-chip-foreground: var(--color-purple-500);\n --color-docs-command-accent: var(--color-purple-400);\n --color-docs-code-background: var(--color-background-primary-default);\n --color-docs-install-rail: var(--color-border-button-default);\n\n /* Recently shipped component badge. Kept semantic so its compact blue\n * surface can retain the same hierarchy in both themes. */\n --color-badge-neutral-background: var(--color-neutral-200);\n --color-team-menu-count-background: var(--color-neutral-200);\n --color-team-menu-count-foreground: var(--color-neutral-500);\n --color-badge-new-background: var(--color-accent-100);\n --color-badge-new-text: var(--color-accent-600);\n --color-tab-count-selected-background: var(--color-accent-100);\n --color-pill-tab-blue-selected-background: var(--color-accent-50);\n --color-pill-tab-blue-hover-background: var(--color-neutral-100);\n\n /* Notification status-icon surfaces. */\n --color-notification-information-background: var(--color-blue-100);\n --color-notification-information-foreground: var(--color-blue-600);\n --color-notification-success-background: var(--color-lime-100);\n --color-notification-success-foreground: var(--color-lime-600);\n --color-notification-error-background: var(--color-rose-100);\n --color-notification-error-foreground: var(--color-rose-600);\n --color-notification-center-background: var(--color-white);\n\n /* Table status chips. Dark mappings come from the medical dashboard table\n * in Figma (4139:7202, 4139:7240, 4139:7278, 4139:7315). */\n --color-status-lime-background: var(--color-lime-200);\n --color-status-lime-text: var(--color-lime-800);\n --color-status-yellow-background: var(--color-yellow-200);\n --color-status-yellow-text: var(--color-yellow-800);\n --color-status-rose-background: var(--color-rose-200);\n --color-status-rose-text: var(--color-rose-800);\n --color-status-cyan-background: var(--color-cyan-200);\n --color-status-cyan-text: var(--color-cyan-800);\n --color-status-blue-background: var(--color-blue-200);\n --color-status-blue-text: var(--color-blue-800);\n --color-status-purple-background: var(--color-purple-100);\n --color-status-purple-text: var(--color-purple-600);\n --color-status-dot-green-halo: var(--color-green-100);\n --color-status-dot-yellow-halo: var(--color-yellow-200);\n --color-status-dot-indigo-halo: var(--color-indigo-100);\n\n /* Date range selection: the connecting band and its start/end caps. */\n --color-date-range-background: var(--color-accent-100);\n --color-date-range-edge-background: var(--color-accent-300);\n\n /* Calendar event chips. Title/time stay separate so the original light\n * hierarchy remains intact while dark mode can normalize both to /300. */\n --color-calendar-event-blue-background: var(--color-blue-100);\n --color-calendar-event-blue-title: var(--color-blue-700);\n --color-calendar-event-blue-time: var(--color-blue-700);\n --color-calendar-event-pink-background: var(--color-pink-100);\n --color-calendar-event-pink-title: var(--color-pink-700);\n --color-calendar-event-pink-time: var(--color-pink-700);\n --color-calendar-event-purple-background: var(--color-purple-100);\n --color-calendar-event-purple-title: var(--color-purple-700);\n --color-calendar-event-purple-time: var(--color-purple-700);\n --color-calendar-event-lime-background: var(--color-lime-100);\n --color-calendar-event-lime-title: var(--color-lime-800);\n --color-calendar-event-lime-time: var(--color-lime-700);\n --color-calendar-event-emerald-background: var(--color-emerald-100);\n --color-calendar-event-emerald-title: var(--color-emerald-800);\n --color-calendar-event-emerald-time: var(--color-emerald-700);\n\n /* Placeholder colors that don't map cleanly to existing text tokens */\n --color-text-error-placeholder: var(--color-red-400);\n\n /* Charts (graphs) — shared neutrals + a categorical accent ramp.\n * `track` is the background bar/ring behind a series; `cursor` the hover\n * outline / dashed reference line; `neutral` a data color for \"other\"-style\n * slices. Each numbered accent pairs a base fill with a one-tone-darker\n * `-active` used for hover emphasis (the 400 → 500 recipe every chart\n * follows). Numbered (not hue-named) so the palette can be retuned without\n * renaming, mirroring the chart-1…n convention common to chart systems. */\n --color-chart-track: var(--color-neutral-200);\n --color-chart-cursor: var(--color-neutral-300);\n --color-chart-neutral: var(--color-neutral-300);\n --color-chart-1: var(--color-teal-400);\n --color-chart-1-active: var(--color-teal-500);\n --color-chart-2: var(--color-lime-400);\n --color-chart-2-active: var(--color-lime-500);\n --color-chart-3: var(--color-pink-400);\n --color-chart-3-active: var(--color-pink-500);\n --color-chart-4: var(--color-sky-400);\n --color-chart-4-active: var(--color-sky-500);\n --color-chart-5: var(--color-purple-400);\n --color-chart-5-active: var(--color-purple-500);\n --color-chart-6: var(--color-blue-400);\n --color-chart-6-active: var(--color-blue-500);\n --color-chart-7: var(--color-emerald-400);\n --color-chart-7-active: var(--color-emerald-500);\n --color-chart-8: var(--color-yellow-400);\n --color-chart-8-active: var(--color-yellow-500);\n --color-chart-9: var(--color-indigo-400);\n --color-chart-9-active: var(--color-indigo-500);\n --color-chart-agents-bar: var(--color-purple-300);\n --color-chart-agents-bar-active: var(--color-purple-400);\n\n /* Button gradients */\n --gradient-button-primary-default: linear-gradient(180deg, var(--color-accent-500) 0%, var(--color-accent-600) 100%);\n --gradient-button-primary-hover: linear-gradient(180deg, var(--color-accent-400) 0%, var(--color-accent-500) 100%);\n --gradient-button-primary-active: linear-gradient(180deg, var(--color-accent-600) 0%, var(--color-accent-700) 100%);\n --gradient-button-primary-disabled: linear-gradient(180deg, var(--color-neutral-200) 0%, var(--color-neutral-300) 100%);\n\n --gradient-button-danger-default: linear-gradient(180deg, var(--color-red-500) 0%, var(--color-red-600) 100%);\n --gradient-button-danger-hover: linear-gradient(180deg, var(--color-red-400) 0%, var(--color-red-500) 100%);\n --gradient-button-danger-active: linear-gradient(180deg, var(--color-red-600) 0%, var(--color-red-700) 100%);\n --gradient-button-danger-disabled: linear-gradient(180deg, var(--color-red-100) 0%, var(--color-red-200) 100%);\n}\n\n.dark {\n /* Foreground */\n --color-foreground-full: var(--color-neutral-700);\n --color-foreground-icon-primary: var(--color-neutral-50);\n --color-foreground-icon-hover: var(--color-white);\n --color-foreground-icon-error: var(--color-red-400);\n --color-foreground-icon-tertiary: var(--color-neutral-600);\n --color-foreground-icon-quaternary: var(--color-neutral-700);\n --color-foreground-icon-disabled: var(--color-neutral-800);\n --color-foreground-disabled: var(--color-neutral-700);\n --color-foreground-disabled-danger: var(--color-red-400);\n --color-input-disabled-foreground: var(--color-neutral-600);\n --color-icon-button-disabled-foreground: var(--color-neutral-500);\n --color-button-primary-disabled-foreground: var(--color-neutral-500);\n\n /* Text */\n --color-text-primary: var(--color-neutral-50);\n --color-text-tertiary: var(--color-neutral-600);\n --color-text-disabled: var(--color-neutral-800);\n --color-text-error-primary: var(--color-red-400);\n --color-input-disabled-text: color-mix(in srgb, var(--color-neutral-500) 40%, transparent);\n\n /* Background */\n --color-background-full: var(--color-neutral-925);\n --color-background-primary-default: var(--color-neutral-800);\n --color-background-inner-default: color-mix(in srgb, var(--color-neutral-800) 60%, transparent);\n --color-background-primary-hover: color-mix(in srgb, var(--color-neutral-700) 60%, transparent);\n --color-background-primary-active: var(--color-neutral-800);\n --color-background-primary-disabled: var(--color-neutral-800);\n --color-input-disabled-background: color-mix(in srgb, var(--color-neutral-800) 30%, transparent);\n --color-switch-off-chip-start: var(--color-background-tertiary-default);\n --color-switch-off-chip-end: var(--color-background-tertiary-default);\n --color-background-secondary-default: var(--color-neutral-900);\n --color-background-secondary-hover: var(--color-neutral-800);\n --color-background-tertiary-default: var(--color-neutral-800);\n --color-background-tertiary-hover: var(--color-neutral-700);\n --color-background-tertiary-error: color-mix(in srgb, var(--color-red-950) 60%, transparent);\n --color-background-quaternary-default: var(--color-neutral-700);\n --color-background-quaternary-hover: var(--color-neutral-600);\n --color-background-recent-hire-role: color-mix(in srgb, var(--color-neutral-900) 60%, transparent);\n --color-avatar-neutral-background: var(--color-background-primary-default);\n --color-file-upload-icon-background: var(--color-neutral-600);\n --color-file-upload-icon-foreground: var(--color-neutral-400);\n --color-file-upload-icon-foreground-hover: var(--color-neutral-300);\n --color-stat-card-icon-background: var(--color-neutral-800);\n --color-segmented-control-background: var(--color-neutral-925);\n --color-segmented-control-selected-background: var(--color-neutral-800);\n --color-theme-toggle-sidebar-background: var(--color-neutral-800);\n --color-theme-toggle-sidebar-selected-background: var(--color-neutral-700);\n --color-ai-chat-composer-add-background: var(--color-neutral-700);\n --color-ai-chat-composer-add-hover-background: var(--color-neutral-600);\n --color-composer-panel-tab-background: color-mix(in srgb, var(--color-neutral-700) 50%, transparent);\n --color-composer-panel-add-background: var(--color-neutral-700);\n --color-composer-panel-add-hover-background: var(--color-neutral-600);\n --color-composer-panel-tile-border: color-mix(in srgb, var(--color-white) 14%, transparent);\n --color-composer-panel-rail-background: color-mix(in srgb, var(--color-neutral-900) 50%, transparent);\n --color-questionnaire-key-background: var(--color-neutral-700);\n --color-questionnaire-key-hover-background: var(--color-neutral-600);\n --color-agent-progress-ring: color-mix(in srgb, var(--color-white) 50%, transparent);\n --color-button-ghost-background: var(--color-accent-900);\n --color-button-ghost-hover: var(--color-accent-800);\n --color-button-ghost-active: var(--color-accent-700);\n --color-button-ghost-disabled: var(--color-neutral-800);\n --color-button-ghost-foreground: var(--color-accent-300);\n --color-button-ghost-disabled-foreground: var(--color-neutral-600);\n --color-dropdown-item-hover-background: color-mix(in srgb, var(--color-neutral-700) 60%, transparent);\n --color-kbd-background: var(--color-neutral-700);\n --color-kbd-foreground: var(--color-neutral-400);\n --color-docs-file-chip-background: color-mix(in srgb, var(--color-purple-950) 50%, transparent);\n --color-docs-file-chip-border: var(--color-purple-800);\n --color-docs-file-chip-foreground: var(--color-purple-400);\n --color-docs-code-background: var(--color-background-full);\n --color-docs-install-rail: color-mix(in srgb, var(--color-neutral-800) 60%, transparent);\n\n /* Dark surfaces absorb low-alpha shadows more readily than white ones.\n * Preserve the light-mode geometry and raise only the black alpha: tighter\n * contact shadows stay crisp, while higher elevations receive a restrained\n * ambient layer without introducing a grey glow. */\n --shadow-2xs: 0 1px rgb(0 0 0 / 0.16);\n --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.18);\n --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.12), 0 1px 3px 0 rgb(0 0 0 / 0.16);\n --shadow-md: 0 2px 4px -1px rgb(0 0 0 / 0.12), 0 4px 6px -1px rgb(0 0 0 / 0.18);\n --shadow-lg: 0 4px 6px -2px rgb(0 0 0 / 0.10), 0 10px 15px -3px rgb(0 0 0 / 0.18);\n --shadow-xl: 0 10px 10px -5px rgb(0 0 0 / 0.08), 0 20px 25px -5px rgb(0 0 0 / 0.20);\n --shadow-card: 0 1px 1px 0 rgb(0 0 0 / 0.14);\n --shadow-dropdown:\n 0 1px 1px 0 rgb(0 0 0 / 0.14),\n 0 4px 4px 0 rgb(0 0 0 / 0.10);\n --shadow-sidebar:\n 0 1px 0 0 rgb(0 0 0 / 0.10),\n 0 1px 12px 0 rgb(0 0 0 / 0.16),\n 0 0 1px 0 rgb(0 0 0 / 0.42);\n --shadow-waitlist:\n 0 0 6px 0 rgb(0 0 0 / 0.12),\n 0 0 64px 0 rgb(0 0 0 / 0.22),\n 0 0 1px 0 rgb(0 0 0 / 0.42),\n 0 1px 12px 0 rgb(0 0 0 / 0.14),\n 0 1px 0 0 rgb(0 0 0 / 0.08);\n\n /* Badges */\n --color-badge-neutral-background: var(--color-neutral-800);\n --color-team-menu-count-background: var(--color-neutral-700);\n --color-team-menu-count-foreground: var(--color-neutral-400);\n --color-badge-new-background: var(--color-accent-950);\n --color-badge-new-text: var(--color-accent-400);\n --color-tab-count-selected-background: color-mix(in srgb, var(--color-accent-800) 60%, transparent);\n\n /* Dark status discs use /800 surfaces with /300 foregrounds so the icon\n * remains crisp without reverting to a bright pastel circle. */\n --color-notification-information-background: color-mix(in srgb, var(--color-blue-800) 50%, transparent);\n --color-notification-information-foreground: var(--color-blue-300);\n --color-notification-success-background: color-mix(in srgb, var(--color-lime-800) 50%, transparent);\n --color-notification-success-foreground: var(--color-lime-300);\n --color-notification-error-background: color-mix(in srgb, var(--color-rose-800) 50%, transparent);\n --color-notification-error-foreground: var(--color-rose-300);\n --color-notification-center-background: var(--color-neutral-900);\n\n /* Borders and separators */\n --color-border-button-default: var(--color-neutral-700);\n --color-border-button-hover: var(--color-neutral-500);\n --color-border-button-active: var(--color-neutral-600);\n --color-border-button-white: var(--color-zinc-800);\n --color-border-error-default: var(--color-red-400);\n --color-border-checkbox-default: var(--color-neutral-700);\n --color-border-checkbox-hover: var(--color-neutral-500);\n --color-border-checkbox-active: var(--color-neutral-500);\n --color-border-component-detail-container: var(--color-neutral-800);\n --color-border-ai-profile-card: var(--color-neutral-800);\n --color-border-table: var(--color-neutral-800);\n --color-border-button-group: color-mix(in srgb, var(--color-neutral-600) 60%, transparent);\n --color-border-sidebar-profile-hover: var(--color-neutral-600);\n --color-separator-border: var(--color-neutral-800);\n --color-separator-border-strong: color-mix(in srgb, var(--color-neutral-700) 60%, transparent);\n\n /* Figma's dark table status pairs. */\n --color-status-lime-background: color-mix(in srgb, var(--color-lime-950) 60%, transparent);\n --color-status-lime-text: var(--color-lime-500);\n --color-status-yellow-background: color-mix(in srgb, var(--color-yellow-950) 60%, transparent);\n --color-status-yellow-text: var(--color-yellow-500);\n --color-status-rose-background: color-mix(in srgb, var(--color-rose-950) 60%, transparent);\n --color-status-rose-text: var(--color-rose-500);\n --color-status-cyan-background: color-mix(in srgb, var(--color-cyan-950) 60%, transparent);\n --color-status-cyan-text: var(--color-cyan-400);\n --color-status-blue-background: color-mix(in srgb, var(--color-blue-950) 60%, transparent);\n --color-status-blue-text: var(--color-blue-300);\n --color-status-purple-background: color-mix(in srgb, var(--color-purple-900) 50%, transparent);\n --color-status-purple-text: var(--color-purple-300);\n --color-status-dot-green-halo: color-mix(in srgb, var(--color-green-800) 40%, transparent);\n --color-status-dot-yellow-halo: color-mix(in srgb, var(--color-yellow-800) 40%, transparent);\n --color-status-dot-indigo-halo: color-mix(in srgb, var(--color-indigo-800) 40%, transparent);\n\n --color-date-range-background: var(--color-accent-950);\n --color-date-range-edge-background: var(--color-accent-800);\n\n --color-pill-tab-blue-selected-background: color-mix(in srgb, var(--color-accent-950) 60%, transparent);\n --color-pill-tab-blue-hover-background: var(--color-neutral-800);\n\n /* Calendar event families share the same dark-mode depth/contrast recipe. */\n --color-calendar-event-blue-background: var(--color-blue-950);\n --color-calendar-event-blue-title: var(--color-blue-300);\n --color-calendar-event-blue-time: var(--color-blue-300);\n --color-calendar-event-pink-background: var(--color-pink-950);\n --color-calendar-event-pink-title: var(--color-pink-300);\n --color-calendar-event-pink-time: var(--color-pink-300);\n --color-calendar-event-purple-background: var(--color-purple-950);\n --color-calendar-event-purple-title: var(--color-purple-300);\n --color-calendar-event-purple-time: var(--color-purple-300);\n --color-calendar-event-lime-background: var(--color-lime-950);\n --color-calendar-event-lime-title: var(--color-lime-300);\n --color-calendar-event-lime-time: var(--color-lime-300);\n --color-calendar-event-emerald-background: var(--color-emerald-950);\n --color-calendar-event-emerald-title: var(--color-emerald-300);\n --color-calendar-event-emerald-time: var(--color-emerald-300);\n\n /* Disabled primary CTA: dark, low-emphasis fill with readable muted text. */\n --gradient-button-primary-disabled: linear-gradient(\n 180deg,\n var(--color-neutral-700) 0%,\n var(--color-neutral-800) 100%\n );\n --gradient-button-danger-disabled: linear-gradient(\n 180deg,\n var(--color-red-900) 0%,\n var(--color-red-950) 100%\n );\n\n /* Neutral graph structure; categorical and status colors stay unchanged. */\n --color-chart-track: var(--color-neutral-800);\n --color-chart-cursor: var(--color-neutral-700);\n --color-chart-neutral: var(--color-neutral-800);\n --color-chart-agents-bar: var(--color-purple-500);\n --color-chart-agents-bar-active: var(--color-purple-600);\n}\n\n/* Non-default accents (data-accent set by the accent engine) can land on a\n * /950 that glows too loudly against the dark sidebar; halve the NEW badge\n * fill there. Light mode keeps the solid /100 surface. */\n.dark[data-accent] {\n --color-badge-new-background: color-mix(in srgb, var(--color-accent-950) 50%, transparent);\n}\n\n/* Re-export semantic tokens as Tailwind utilities. The `inline` form means\n * Tailwind reads the *current* computed value of the variable, so light↔dark\n * flips work without rebuild. */\n@theme inline {\n --color-foreground-full: var(--color-foreground-full);\n --color-foreground-icon-primary: var(--color-foreground-icon-primary);\n --color-foreground-icon-hover: var(--color-foreground-icon-hover);\n --color-foreground-icon-secondary: var(--color-foreground-icon-secondary);\n --color-foreground-icon-tertiary: var(--color-foreground-icon-tertiary);\n --color-foreground-icon-quaternary: var(--color-foreground-icon-quaternary);\n --color-foreground-icon-error: var(--color-foreground-icon-error);\n --color-foreground-icon-disabled: var(--color-foreground-icon-disabled);\n --color-foreground-disabled: var(--color-foreground-disabled);\n --color-foreground-disabled-danger: var(--color-foreground-disabled-danger);\n --color-input-disabled-foreground: var(--color-input-disabled-foreground);\n --color-icon-button-disabled-foreground: var(--color-icon-button-disabled-foreground);\n --color-button-primary-disabled-foreground: var(--color-button-primary-disabled-foreground);\n\n --color-text-primary: var(--color-text-primary);\n --color-text-secondary: var(--color-text-secondary);\n --color-text-tertiary: var(--color-text-tertiary);\n --color-text-disabled: var(--color-text-disabled);\n --color-text-disabled-danger: var(--color-text-disabled-danger);\n --color-text-placeholder: var(--color-text-placeholder);\n --color-text-error-primary: var(--color-text-error-primary);\n --color-input-disabled-text: var(--color-input-disabled-text);\n --color-text-white: var(--color-text-white);\n\n --color-background-full: var(--color-background-full);\n --color-background-primary-default: var(--color-background-primary-default);\n --color-background-inner-default: var(--color-background-inner-default);\n --color-background-primary-hover: var(--color-background-primary-hover);\n --color-background-primary-active: var(--color-background-primary-active);\n --color-background-primary-disabled: var(--color-background-primary-disabled);\n --color-input-disabled-background: var(--color-input-disabled-background);\n --color-background-secondary-default: var(--color-background-secondary-default);\n --color-background-secondary-hover: var(--color-background-secondary-hover);\n --color-background-tertiary-default: var(--color-background-tertiary-default);\n --color-background-tertiary-hover: var(--color-background-tertiary-hover);\n --color-background-tertiary-error: var(--color-background-tertiary-error);\n --color-background-recent-hire-role: var(--color-background-recent-hire-role);\n --color-avatar-neutral-background: var(--color-avatar-neutral-background);\n --color-background-quaternary-default: var(--color-background-quaternary-default);\n --color-background-quaternary-hover: var(--color-background-quaternary-hover);\n --color-background-quaternary-error: var(--color-background-quaternary-error);\n --color-file-upload-icon-background: var(--color-file-upload-icon-background);\n --color-file-upload-icon-foreground: var(--color-file-upload-icon-foreground);\n --color-file-upload-icon-foreground-hover: var(--color-file-upload-icon-foreground-hover);\n\n --color-border-button-default: var(--color-border-button-default);\n --color-border-button-hover: var(--color-border-button-hover);\n --color-border-button-active: var(--color-border-button-active);\n --color-border-button-white: var(--color-border-button-white);\n --color-border-error-default: var(--color-border-error-default);\n --color-border-checkbox-default: var(--color-border-checkbox-default);\n --color-border-checkbox-hover: var(--color-border-checkbox-hover);\n --color-border-checkbox-active: var(--color-border-checkbox-active);\n --color-border-checkbox-white: var(--color-border-checkbox-white);\n --color-border-component-detail-container: var(--color-border-component-detail-container);\n --color-border-ai-profile-card: var(--color-border-ai-profile-card);\n --color-border-table: var(--color-border-table);\n --color-border-button-group: var(--color-border-button-group);\n --color-border-sidebar-profile-hover: var(--color-border-sidebar-profile-hover);\n --color-separator-border: var(--color-separator-border);\n --color-separator-border-strong: var(--color-separator-border-strong);\n --color-border-focus-ring: var(--color-border-focus-ring);\n\n --color-state-success-text: var(--color-state-success-text);\n --color-state-success-base: var(--color-state-success-base);\n --color-control-indicator-background: var(--color-control-indicator-background);\n --color-control-indicator-background-subtle: var(--color-control-indicator-background-subtle);\n --color-switch-off-chip-start: var(--color-switch-off-chip-start);\n --color-switch-off-chip-end: var(--color-switch-off-chip-end);\n --color-switch-on-chip-start: var(--color-switch-on-chip-start);\n --color-switch-on-chip-end: var(--color-switch-on-chip-end);\n --color-stat-card-icon-background: var(--color-stat-card-icon-background);\n --color-segmented-control-background: var(--color-segmented-control-background);\n --color-segmented-control-selected-background: var(--color-segmented-control-selected-background);\n --color-theme-toggle-sidebar-background: var(--color-theme-toggle-sidebar-background);\n --color-theme-toggle-sidebar-selected-background: var(--color-theme-toggle-sidebar-selected-background);\n --color-ai-chat-composer-add-background: var(--color-ai-chat-composer-add-background);\n --color-ai-chat-composer-add-hover-background: var(--color-ai-chat-composer-add-hover-background);\n --color-composer-panel-tab-background: var(--color-composer-panel-tab-background);\n --color-composer-panel-add-background: var(--color-composer-panel-add-background);\n --color-composer-panel-add-hover-background: var(--color-composer-panel-add-hover-background);\n --color-composer-panel-tile-border: var(--color-composer-panel-tile-border);\n --color-composer-panel-rail-background: var(--color-composer-panel-rail-background);\n --color-questionnaire-key-background: var(--color-questionnaire-key-background);\n --color-questionnaire-key-hover-background: var(--color-questionnaire-key-hover-background);\n --color-agent-progress-ring: var(--color-agent-progress-ring);\n --color-button-ghost-background: var(--color-button-ghost-background);\n --color-button-ghost-hover: var(--color-button-ghost-hover);\n --color-button-ghost-active: var(--color-button-ghost-active);\n --color-button-ghost-disabled: var(--color-button-ghost-disabled);\n --color-button-ghost-foreground: var(--color-button-ghost-foreground);\n --color-button-ghost-disabled-foreground: var(--color-button-ghost-disabled-foreground);\n --color-dropdown-item-hover-background: var(--color-dropdown-item-hover-background);\n --color-kbd-background: var(--color-kbd-background);\n --color-kbd-foreground: var(--color-kbd-foreground);\n --color-docs-file-chip-background: var(--color-docs-file-chip-background);\n --color-docs-file-chip-border: var(--color-docs-file-chip-border);\n --color-docs-file-chip-foreground: var(--color-docs-file-chip-foreground);\n --color-docs-command-accent: var(--color-docs-command-accent);\n --color-docs-code-background: var(--color-docs-code-background);\n --color-docs-install-rail: var(--color-docs-install-rail);\n --color-badge-neutral-background: var(--color-badge-neutral-background);\n --color-team-menu-count-background: var(--color-team-menu-count-background);\n --color-team-menu-count-foreground: var(--color-team-menu-count-foreground);\n --color-badge-new-background: var(--color-badge-new-background);\n --color-badge-new-text: var(--color-badge-new-text);\n --color-tab-count-selected-background: var(--color-tab-count-selected-background);\n --color-pill-tab-blue-selected-background: var(--color-pill-tab-blue-selected-background);\n --color-pill-tab-blue-hover-background: var(--color-pill-tab-blue-hover-background);\n --color-notification-information-background: var(--color-notification-information-background);\n --color-notification-information-foreground: var(--color-notification-information-foreground);\n --color-notification-success-background: var(--color-notification-success-background);\n --color-notification-success-foreground: var(--color-notification-success-foreground);\n --color-notification-error-background: var(--color-notification-error-background);\n --color-notification-error-foreground: var(--color-notification-error-foreground);\n --color-notification-center-background: var(--color-notification-center-background);\n --color-status-lime-background: var(--color-status-lime-background);\n --color-status-lime-text: var(--color-status-lime-text);\n --color-status-yellow-background: var(--color-status-yellow-background);\n --color-status-yellow-text: var(--color-status-yellow-text);\n --color-status-rose-background: var(--color-status-rose-background);\n --color-status-rose-text: var(--color-status-rose-text);\n --color-status-cyan-background: var(--color-status-cyan-background);\n --color-status-cyan-text: var(--color-status-cyan-text);\n --color-status-blue-background: var(--color-status-blue-background);\n --color-status-blue-text: var(--color-status-blue-text);\n --color-status-purple-background: var(--color-status-purple-background);\n --color-status-purple-text: var(--color-status-purple-text);\n --color-status-dot-green-halo: var(--color-status-dot-green-halo);\n --color-status-dot-yellow-halo: var(--color-status-dot-yellow-halo);\n --color-status-dot-indigo-halo: var(--color-status-dot-indigo-halo);\n --color-date-range-background: var(--color-date-range-background);\n --color-date-range-edge-background: var(--color-date-range-edge-background);\n --color-calendar-event-blue-background: var(--color-calendar-event-blue-background);\n --color-calendar-event-blue-title: var(--color-calendar-event-blue-title);\n --color-calendar-event-blue-time: var(--color-calendar-event-blue-time);\n --color-calendar-event-pink-background: var(--color-calendar-event-pink-background);\n --color-calendar-event-pink-title: var(--color-calendar-event-pink-title);\n --color-calendar-event-pink-time: var(--color-calendar-event-pink-time);\n --color-calendar-event-purple-background: var(--color-calendar-event-purple-background);\n --color-calendar-event-purple-title: var(--color-calendar-event-purple-title);\n --color-calendar-event-purple-time: var(--color-calendar-event-purple-time);\n --color-calendar-event-lime-background: var(--color-calendar-event-lime-background);\n --color-calendar-event-lime-title: var(--color-calendar-event-lime-title);\n --color-calendar-event-lime-time: var(--color-calendar-event-lime-time);\n --color-calendar-event-emerald-background: var(--color-calendar-event-emerald-background);\n --color-calendar-event-emerald-title: var(--color-calendar-event-emerald-title);\n --color-calendar-event-emerald-time: var(--color-calendar-event-emerald-time);\n\n --color-text-error-placeholder: var(--color-text-error-placeholder);\n\n --color-chart-track: var(--color-chart-track);\n --color-chart-cursor: var(--color-chart-cursor);\n --color-chart-neutral: var(--color-chart-neutral);\n --color-chart-1: var(--color-chart-1);\n --color-chart-1-active: var(--color-chart-1-active);\n --color-chart-2: var(--color-chart-2);\n --color-chart-2-active: var(--color-chart-2-active);\n --color-chart-3: var(--color-chart-3);\n --color-chart-3-active: var(--color-chart-3-active);\n --color-chart-4: var(--color-chart-4);\n --color-chart-4-active: var(--color-chart-4-active);\n --color-chart-5: var(--color-chart-5);\n --color-chart-5-active: var(--color-chart-5-active);\n --color-chart-6: var(--color-chart-6);\n --color-chart-6-active: var(--color-chart-6-active);\n --color-chart-7: var(--color-chart-7);\n --color-chart-7-active: var(--color-chart-7-active);\n --color-chart-8: var(--color-chart-8);\n --color-chart-8-active: var(--color-chart-8-active);\n --color-chart-9: var(--color-chart-9);\n --color-chart-9-active: var(--color-chart-9-active);\n --color-chart-agents-bar: var(--color-chart-agents-bar);\n --color-chart-agents-bar-active: var(--color-chart-agents-bar-active);\n}\n\n/* ---------------------------------------------------------------------------\n * Component utilities — Buttons\n *\n * Each variant collapses the four interactive states (default / hover / active\n * / disabled) into a single class. Use them on the component:\n *\n * <button class=\"bg-button-primary\">…</button>\n * <button class=\"bg-button-danger\">…</button>\n *\n * Smooth default→hover transition trick:\n * CSS can't interpolate `background-image`, so swapping gradients on :hover\n * would snap. Instead we keep the *default* gradient on the element and\n * layer the *hover* gradient on a `::before` pseudo-element whose opacity\n * fades 0→1 over `--button-transition-ms`. Active/disabled gradients still\n * swap instantly (we hide the pseudo to reveal them).\n *\n * Stacking: `isolation: isolate` keeps the pseudo behind the button's text\n * and icons (z-index -1) while staying above the element's own background.\n * `border-radius: inherit` + `overflow: hidden` keeps it within the rounded\n * corners.\n * --------------------------------------------------------------------------- */\n@theme {\n --button-transition-ms: 150ms;\n --input-transition-ms: 150ms;\n}\n\n/* Keep color feedback quick while the physical press motion remains soft.\n * The transform uses a shorter duration on press and the slower duration only\n * when returning to rest, so hover styles never inherit the 700ms timing. */\n@utility button-press-motion {\n transition:\n background-color var(--button-transition-ms) ease,\n border-color var(--button-transition-ms) ease,\n box-shadow var(--button-transition-ms) ease,\n color var(--button-transition-ms) ease,\n transform 420ms cubic-bezier(0.4, 0, 0.2, 1);\n\n &:active:not(:disabled):not([aria-disabled=\"true\"]) {\n transform: scale(0.98);\n transition-duration: 150ms, 150ms, 150ms, 150ms, 220ms;\n }\n\n &:disabled,\n &[aria-disabled=\"true\"] {\n transform: none;\n }\n\n @media (prefers-reduced-motion: reduce) {\n transition: none;\n transform: none;\n }\n}\n\n@utility bg-button-primary {\n position: relative;\n isolation: isolate;\n background-image: var(--gradient-button-primary-default);\n\n &::before {\n content: \"\";\n position: absolute;\n inset: 0;\n z-index: -1;\n pointer-events: none;\n border-radius: inherit;\n background-image: var(--gradient-button-primary-hover);\n opacity: 0;\n transition: opacity var(--button-transition-ms) ease;\n }\n &:hover:not(:disabled):not([aria-disabled=\"true\"])::before {\n opacity: 1;\n }\n &:active:not(:disabled):not([aria-disabled=\"true\"]) {\n background-image: var(--gradient-button-primary-active);\n }\n &:active:not(:disabled):not([aria-disabled=\"true\"])::before {\n opacity: 0;\n }\n &:disabled,\n &[aria-disabled=\"true\"] {\n background-image: var(--gradient-button-primary-disabled);\n }\n &:disabled::before,\n &[aria-disabled=\"true\"]::before {\n display: none;\n }\n}\n\n@utility bg-button-danger {\n position: relative;\n isolation: isolate;\n background-image: var(--gradient-button-danger-default);\n\n &::before {\n content: \"\";\n position: absolute;\n inset: 0;\n z-index: -1;\n pointer-events: none;\n border-radius: inherit;\n background-image: var(--gradient-button-danger-hover);\n opacity: 0;\n transition: opacity var(--button-transition-ms) ease;\n }\n &:hover:not(:disabled):not([aria-disabled=\"true\"])::before {\n opacity: 1;\n }\n &:active:not(:disabled):not([aria-disabled=\"true\"]) {\n background-image: var(--gradient-button-danger-active);\n }\n &:active:not(:disabled):not([aria-disabled=\"true\"])::before {\n opacity: 0;\n }\n &:disabled,\n &[aria-disabled=\"true\"] {\n background-image: var(--gradient-button-danger-disabled);\n }\n &:disabled::before,\n &[aria-disabled=\"true\"]::before {\n display: none;\n }\n}\n",+ "type": "registry:style",+ "target": "styles/theme.css"+ }+ ],+ "meta": {+ "docsUrl": "https://www.boardui.com/components/color"+ }+}diff --git a/docs/reference-sources.json b/docs/reference-sources.jsonindex ad24aabe4..967fc620c 100644--- a/docs/reference-sources.json+++ b/docs/reference-sources.json@@ -312,6 +312,33 @@"README.md","README.en.md"]+ },+ {+ "id": "boardui-input",+ "name": "BoardUI Input 组件源",+ "url": "https://www.boardui.com/r/input.json",+ "snapshot": "docs/reference-snapshots/upstream/boardui-input.json",+ "checked_on": "2026-09-09",+ "sha256": "ac1e66c9ed15f9db2750dd528bc894c856ac84e79f72ff4acb96f14b1ab9c249",+ "role": "输入框焦点口径:2px inset ring,悬停 border-button-hover、聚焦 border-button-active,无外发光;Peach 输入面板按用户的决定保留白底。",+ "consumers": [+ "web/css/22-followmanage.css",+ "web/board.css",+ "tests/test_web_ui.py"+ ]+ },+ {+ "id": "boardui-theme",+ "name": "BoardUI 主题 token 源",+ "url": "https://www.boardui.com/r/theme.json",+ "snapshot": "docs/reference-snapshots/upstream/boardui-theme.json",+ "checked_on": "2026-09-09",+ "sha256": "ee1cb0e973b108b90fd4999796a595fff6a1e5e453e115a6966c43b6e53ed428",+ "role": "border-button-active 的取值出处(浅色 neutral-400、深色 neutral-600);Peach 只取该档,不搬全量变量表。",+ "consumers": [+ "web/board.css",+ "web/css/22-followmanage.css"+ ]}]}diff --git a/scripts/restart_windows_tray.py b/scripts/restart_windows_tray.pyindex 1ea95cd84..b63a6f273 100644--- a/scripts/restart_windows_tray.py+++ b/scripts/restart_windows_tray.py@@ -17,19 +17,27 @@ SRC_DIR = PROJECT_ROOT / "src"if str(SRC_DIR) not in sys.path:sys.path.insert(0, str(SRC_DIR))-from peach.windows_restart import restart_tray+from peach.windows_restart import (+ find_tray_windows, restart_source_tray, restart_tray,+)def main(argv: list[str] | None = None) -> int:- parser = argparse.ArgumentParser(description="静默、正常地重启 Windows Peach 托盘及其子服务")+ parser = argparse.ArgumentParser(description="静默无窗口地重启 Windows Peach 托盘及子服务")parser.add_argument("--target", type=Path,default=PROJECT_ROOT / "dist" / "Peach" / "Peach.exe")parser.add_argument("--timeout", type=float, default=25.0)+ parser.add_argument("--source", action="store_true",+ help="重启源码部署的托盘(pythonw -m peach.tray),不做换包")parser.add_argument("--swap-from", type=Path, default=None,- help="旧托盘退出后把这个暂存包换上生产入口,失败自动回滚")+ help="旧托盘退出后把这个暂存包换上生产入口,失败自动回退")args = parser.parse_args(argv)- result = restart_tray(args.target, timeout=max(1.0, args.timeout),- swap_from=args.swap_from)++ if not args.source and find_tray_windows(args.target):+ result = restart_tray(args.target, timeout=max(1.0, args.timeout),+ swap_from=args.swap_from)+ else:+ result = restart_source_tray(timeout=max(1.0, args.timeout))print(json.dumps(asdict(result), ensure_ascii=False))return 0 if result.ok else 1diff --git a/src/peach/windows_restart.py b/src/peach/windows_restart.pyindex fdb9d86b0..ac4bc82ac 100644--- a/src/peach/windows_restart.py+++ b/src/peach/windows_restart.py@@ -49,6 +49,126 @@ def process_alive(process_id: int) -> bool:return PidFileLock._running(process_id)+def parse_windows_command_line(script: str | None) -> list[str]:+ """按 CommandLineToArgvW 的规则拆开一条命令行。++ 托盘的自定义 bootstrap 里既有引号又有字面引号内的单引号,`shlex` 的+ posix 反斜杠规则在 Windows 上不成立,所以要照 Win32 的两条规则自己劈:+ 2n 个反斜杠后跟引号 → n 个反斜杠加一个定界引号;2n+1 个 → n 个反斜杠加字面引号。+ 分隔空白不带引号才算分隔,别把路径里的盘符斜杠拆成碎块。+ """+ if not script:+ return []+ argv: list[str] = []+ current: list[str] = []+ slashes = 0+ in_quotes = False+ index = 0+ while index < len(script):+ char = script[index]+ if char == "\\":+ count = 0+ while index < len(script) and script[index] == "\\":+ count += 1+ index += 1+ followed_quote = index < len(script) and script[index] == '"'+ if followed_quote:+ current.append("\\" * (count // 2))+ if count % 2:+ current.append('"')+ index += 1+ else:+ pass+ else:+ current.append("\\" * count)+ continue+ if char == '"':+ if in_quotes:+ in_quotes = False+ else:+ in_quotes = True+ index += 1+ continue+ if not in_quotes and char.isspace():+ if current:+ argv.append("".join(current))+ current = []+ index += 1+ continue+ current.append(char)+ index += 1+ if current:+ argv.append("".join(current))+ return argv+++def _command_lines() -> dict[int, str]:+ """按 pid 读全部 Win32 进程的命令行,读不到就返回空。++ 找源码托盘要认的就是这条命令行里的 `peach.tray`;失败不抛——这条+ 路径宁可安静地确认「没有源码托盘」,也不误伤别的窗口。+ """+ result = subprocess.run(+ ["powershell.exe", "-NoProfile", "-NonInteractive", "-Command",+ "Get-CimInstance Win32_Process | ForEach-Object {"+ " \"$($_.ProcessId)|$($_.CommandLine)\" }"],+ capture_output=True, check=False,+ creationflags=getattr(subprocess, "CREATE_NO_WINDOW", 0),+ encoding="utf-8", errors="replace")+ lines: dict[int, str] = {}+ for raw in (result.stdout or "").splitlines():+ pid_text, _, command = raw.partition("|")+ try:+ lines[int(pid_text)] = command+ except ValueError:+ continue+ return lines+++def find_source_tray_windows() -> tuple[TrayWindow, ...]:+ """源码形态的托盘:`pythonw -c …peach.tray…` 拉起的托盘窗口。++ `find_tray_windows` 只认打包入口(窗口类名加 dist 可执行路径);源码部署+ 的托盘是 venv 的 pythonw 启动的,桌面启动器和 `--show` 参数都在命令行里,+ 所以按同一窗口类名加「命令行含 peach.tray 找」。返回的仍是一道窗口,跟+ restart_tray 用的是同一套唯一性检验。+ """+ if os.name != "nt":+ return ()+ user32 = ctypes.WinDLL("user32", use_last_error=True)+ paths, _parents = _process_paths_and_parents()+ command_lines = _command_lines()+ found: list[TrayWindow] = []+ callback_type = ctypes.WINFUNCTYPE(wintypes.BOOL, wintypes.HWND, wintypes.LPARAM)+ user32.EnumWindows.argtypes = [callback_type, wintypes.LPARAM]+ user32.EnumWindows.restype = wintypes.BOOL+ user32.GetWindowThreadProcessId.argtypes = [wintypes.HWND, ctypes.POINTER(wintypes.DWORD)]+ user32.GetClassNameW.argtypes = [wintypes.HWND, ctypes.LPWSTR, ctypes.c_int]++ @callback_type+ def visit(window, _extra):+ process_id = wintypes.DWORD()+ user32.GetWindowThreadProcessId(window, ctypes.byref(process_id))+ process_id = int(process_id.value)+ image = paths.get(process_id, "")+ command = command_lines.get(process_id, "")+ buffer = ctypes.create_unicode_buffer(512)+ user32.GetClassNameW(window, buffer, len(buffer))+ class_name = buffer.value+ if (class_name.startswith("Peach") and class_name.endswith("SystemTrayIcon")+ and image.lower().endswith("pythonw.exe")+ and "peach.tray" in command):+ found.append(TrayWindow(process_id, int(window)))+ return True++ ctypes.set_last_error(0)+ if not user32.EnumWindows(visit, 0):+ error = ctypes.get_last_error()+ if error:+ raise ctypes.WinError(error)+ return tuple(found)++def _process_paths_and_parents() -> tuple[dict[int, str], dict[int, int]]:if os.name != "nt":raise OSError("Windows tray control is only available on Windows")@@ -286,3 +406,77 @@ def restart_tray(message="新托盘或两个子服务未在期限内就绪",old_tray_pid=old_process_id, swapped_from=swapped_from)return RestartResult(False, "新托盘或两个子服务未在期限内就绪", old_tray_pid=old_process_id)+++def restart_source_tray(+ *,+ timeout: float = 25.0,+ find_windows: Callable[[], tuple[TrayWindow, ...]] = find_source_tray_windows,+ stop_window: Callable[[int], bool] = post_stop,+ alive: Callable[[int], bool] = process_alive,+ command_lines: Callable[[], dict[int, str]] = _command_lines,+ start: Callable[[list[str]], subprocess.Popen] = None,+ services: Callable[[int, Path], tuple[int, ...]] = owned_service_pids,+ sleep: Callable[[float], None] = time.sleep,+) -> RestartResult:+ """源码部署托盘的正常重启:按同一命令行自起新托盘。++ 依据现有托盘自己的命令行重建 argv:`--show`/`--silent` 和数据根都在+ 那一串里,照抄它们就不会把静默启动重启成开浏览器,或者反过来。入口+ 是项目 `.venv` 的 `pythonw.exe`,服务入口由它旁推出+ `.venv\\Scripts\\peach.exe`。没有换二进制这一步,也不涉及备份回滚。+ """+ def start_argv(argv: list[str]) -> subprocess.Popen:+ if start is None:+ working_directory = Path(argv[0]).parents[2]+ return subprocess.Popen(+ argv, cwd=str(working_directory), stdin=subprocess.DEVNULL,+ stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL,+ shell=False, creationflags=subprocess.DETACHED_PROCESS+ | subprocess.CREATE_NO_WINDOW,+ )+ return start(argv)++ windows = find_windows()+ process_ids = {window.process_id for window in windows}+ if len(process_ids) != 1 or not windows:+ return RestartResult(False, "拒绝重启:没有找到唯一且命令行匹配的源码托盘窗口")+ old_process_id = next(iter(process_ids))+ argv = parse_windows_command_line(command_lines().get(old_process_id))+ if len(argv) < 2 or "peach.tray" not in " ".join(argv):+ return RestartResult(False, "拒绝重启:托盘窗口的命令行没有 peach.tray"+ "可信起步,无法照原样重启",+ old_tray_pid=old_process_id)+ service_executable = Path(argv[0]).parent / "peach.exe"+ if service_executable.name.lower() != "peach.exe" or not service_executable.is_file():+ return RestartResult(False, f"拒绝重启:源码托盘旁没有服务入口 {service_executable}",+ old_tray_pid=old_process_id)+ if not all(stop_window(window.handle) for window in windows):+ return RestartResult(False, "托盘停止消息发送失败", old_tray_pid=old_process_id)++ deadline = time.monotonic() + timeout+ while alive(old_process_id) and time.monotonic() < deadline:+ sleep(0.1)+ if alive(old_process_id):+ return RestartResult(False, "托盘未在期限内正常退出;未强杀、未另启",+ old_tray_pid=old_process_id)++ deadline = time.monotonic() + timeout+ launched = start_argv(argv)+ while time.monotonic() < deadline:+ if launched.poll() is not None:+ return RestartResult(False, f"新托盘退出,代码 {launched.returncode}",+ old_tray_pid=old_process_id)+ new_windows = find_windows()+ new_process_ids = {window.process_id for window in new_windows}+ if len(new_process_ids) == 1:+ new_process_id = next(iter(new_process_ids))+ service_pids = services(new_process_id, service_executable)+ if len(service_pids) >= 2:+ return RestartResult(True, "源码托盘已正常重启并重新拥有 HTTP/HTTPS 子服务",+ old_tray_pid=old_process_id,+ new_tray_pid=new_process_id,+ service_pids=service_pids)+ sleep(0.2)+ return RestartResult(False, "新托盘或两个子服务未在期限内就绪",+ old_tray_pid=old_process_id)diff --git a/tests/test_reference_updates.py b/tests/test_reference_updates.pyindex 68998a923..15c02e828 100644--- a/tests/test_reference_updates.py+++ b/tests/test_reference_updates.py@@ -41,6 +41,8 @@ class ReferenceUpdateTests(unittest.TestCase):"openaver-related-ranking","vercel-geist-tabs-secondary","vercel-geist-switch-segmented",+ "boardui-input",+ "boardui-theme","youtube-stats-buffer-20260829"},)self.assertNotEqual(diff --git a/tests/test_restart_windows_tray.py b/tests/test_restart_windows_tray.pyindex be0cf192d..04d8d1bbe 100644--- a/tests/test_restart_windows_tray.py+++ b/tests/test_restart_windows_tray.py@@ -4,6 +4,7 @@ import contextlibimport importlib.utilimport ioimport json+import subprocessimport sysimport tempfileimport unittest@@ -60,6 +61,53 @@ class RestartWindowsTrayTests(unittest.TestCase):self.assertIn("唯一", result.message)start.assert_not_called()+ BOOTSTRAP = ("import os,runpy;os.environ['PEACH_DATA_ROOT']=r'X'"+ ";runpy.run_module('peach.tray',run_name='__main__')")++ def test_windows_command_line_splits_the_source_bootstrap_intact(self):+ line = f'"{self.service.parent / "pythonw.exe"}" -c "{self.BOOTSTRAP}" --show'+ argv = windows_restart.parse_windows_command_line(line)+ self.assertEqual(argv, [f"{self.service.parent / 'pythonw.exe'}",+ "-c", self.BOOTSTRAP, "--show"])++ def test_source_restart_reruns_the_recorded_command_line(self):+ pythonw = self.service.parent / "pythonw.exe"+ pythonw.write_bytes(b"shim")+ argv = [str(pythonw), "-c", self.BOOTSTRAP, "--show"]+ windows = iter((+ (windows_restart.TrayWindow(10, 20),),+ (windows_restart.TrayWindow(30, 40),),+ ))+ launched = mock.Mock()+ launched.poll.return_value = None+ started_with = []+ result = windows_restart.restart_source_tray(+ find_windows=lambda: next(windows),+ stop_window=lambda _handle: True,+ alive=lambda _pid: False,+ command_lines=lambda: {10: subprocess.list2cmdline(argv)},+ start=lambda argv: started_with.append(list(argv)) or launched,+ services=lambda tray_pid, executable: (51, 52)+ if tray_pid == 30 and executable == self.service else (),+ sleep=lambda _seconds: None,+ )+ self.assertTrue(result.ok, result.message)+ self.assertEqual(started_with, [argv])+ self.assertEqual(result.new_tray_pid, 30)+ self.assertEqual(result.service_pids, (51, 52))++ def test_source_restart_refuses_when_the_window_command_has_no_tray_marker(self):+ windows = iter(((windows_restart.TrayWindow(10, 20),),))+ start = mock.Mock()+ result = windows_restart.restart_source_tray(+ find_windows=lambda: next(windows),+ command_lines=lambda: {10: "notepad.exe"},+ start=start,+ )+ self.assertFalse(result.ok)+ self.assertIn("peach.tray", result.message)+ start.assert_not_called()+def test_timeout_never_force_kills_or_starts_a_second_tray(self):start = mock.Mock()result = windows_restart.restart_tray(@@ -152,12 +200,38 @@ class RestartEntryTests(unittest.TestCase):finished = windows_restart.RestartResult(True, "重启完成", backup="C:/dist/backup.exe")with (mock.patch.object(entry, "restart_tray", return_value=finished) as restart,+ mock.patch.object(entry, "find_tray_windows",+ return_value=(windows_restart.TrayWindow(10, 20),)) as search,contextlib.redirect_stdout(io.StringIO()) as printed,):self.assertEqual(entry.main(["--swap-from", "staged.exe"]), 0)self.assertEqual(restart.call_args.kwargs["swap_from"], Path("staged.exe"))self.assertEqual(json.loads(printed.getvalue())["backup"], "C:/dist/backup.exe")+ def test_without_a_packaged_tray_the_entry_falls_back_to_the_source_tray(self):+ entry = load_entry()+ source = windows_restart.RestartResult(True, "源码托盘已重启")+ with (+ mock.patch.object(entry, "find_tray_windows", return_value=()) as search,+ mock.patch.object(entry, "restart_source_tray", return_value=source) as srcs,+ contextlib.redirect_stdout(io.StringIO()) as printed,+ ):+ self.assertEqual(entry.main(["--swap-from", "staged.exe"]), 0)+ srcs.assert_called_once()+ self.assertEqual(json.loads(printed.getvalue())["message"], "源码托盘已重启")++ def test_source_requests_bypass_the_packaged_tray(self):+ entry = load_entry()+ source = windows_restart.RestartResult(True, "源码托盘已重启")+ with (+ mock.patch.object(entry, "find_tray_windows", return_value=()) as search,+ mock.patch.object(entry, "restart_source_tray", return_value=source),+ mock.patch.object(entry, "restart_tray") as ghost,+ contextlib.redirect_stdout(io.StringIO()),+ ):+ self.assertEqual(entry.main(["--source"]), 0)+ ghost.assert_not_called()+if __name__ == "__main__":unittest.main()diff --git a/tests/test_web_ui.py b/tests/test_web_ui.pyindex bd191a21d..8953e68d1 100644--- a/tests/test_web_ui.py+++ b/tests/test_web_ui.py@@ -4093,7 +4093,7 @@ class WebUiSourceTests(unittest.TestCase):self.assertPageContains("if(runtime)runtimeConfigurable=!!runtime.configurable;")self.assertPageContains("await mountIsland('configuration',host,{receipt:message=>actionReceipt(message)},{isCurrent:open});")- self.assertPageContains("{label:'这台设备上改不了'}")+ self.assertPageContains("{label:'该配置需在服务端设备修改'}")# 弹层里那一份配置页已经由外面那圈分区页签管着,别再给它自己叠一排。self.assertPageContains("const config=document.querySelector('#stats .configpage');")# `runtimeConfigurable` 还有第二个用处:馆藏空态按它决定给不给「去配置媒体文件夹」。diff --git a/web/app.js b/web/app.jsindex bce23f43a..d222c96de 100644--- a/web/app.js+++ b/web/app.js@@ -742,8 +742,8 @@ async function syncMachineSettings(){if(!open())return;if(runtime)runtimeConfigurable=!!runtime.configurable;if(!runtime||!runtimeConfigurable){- host.innerHTML=noteHtml('媒体文件夹、端口、代理和更新讲的是跑着 Peach 的那台电脑,在它自己的浏览器里打开设置就能改。',- {label:'这台设备上改不了'});+ host.innerHTML=noteHtml('媒体文件夹、端口、代理与更新属于运行 Peach 服务的设备;在该设备的浏览器打开设置进行修改。',+ {label:'该配置需在服务端设备修改'});return;}machineSettingsMounted=true;diff --git a/web/board.css b/web/board.cssindex f5ae9f9f4..54a27c01d 100644--- a/web/board.css+++ b/web/board.css@@ -572,9 +572,9 @@ button,input,select,textarea{font-family:inherit}@media(max-width:760px){body #manageTitle{width:100%}.board-watch-entry,.board-source-list,.tasteleads .insightpanelbody,.tasteranks,.tasteranks-tags,.tasteranks-visual,.tastesources .insightpanelbody>div{grid-template-columns:minmax(0,1fr)}.board-watch-entry{gap:8px}.tasteleads>header{padding:20px 16px 12px}.tasteleads .insightpanelbody{padding:8px 16px 20px}.followmanage .fmain>.fsec:has(.fcred)>.frows{grid-template-columns:minmax(0,1fr)}.followmanage .fauthor{padding:16px}.followmanage .fsechead{gap:8px}.followmanage .fmanagesort{margin-left:0}}/* Board 的语义色与复合字阶;图表和业务状态独立于交互强调色。 */-:root,:root[data-theme="light"]{--color-text-primary:#0a0a0a;--color-text-secondary:#737373;--color-text-tertiary:#a3a3a3;--color-background-full:#fff;--color-background-primary-default:#fff;--color-background-primary-hover:#f5f5f5;--color-background-secondary-default:#f5f5f5;--color-background-tertiary-default:#e5e5e5;--color-border-button-default:#e5e5e5;--color-border-button-hover:#d4d4d4;--color-separator-border:#e5e5e5;--color-border-focus-ring:#3b82f6;--color-text-white:#fff;--color-text-disabled:#d4d4d4;--board-blue:linear-gradient(180deg,#3b82f6,#155dfc);--board-blue-hover:linear-gradient(180deg,#60a5fa,#2563eb)}-:root[data-theme="dark"]{--color-text-primary:#fafafa;--color-text-secondary:#737373;--color-text-tertiary:#525252;--color-background-full:#121212;--color-background-primary-default:#262626;--color-background-primary-hover:#40404099;--color-background-secondary-default:#171717;--color-background-tertiary-default:#262626;--color-border-button-default:#404040;--color-border-button-hover:#737373;--color-separator-border:#262626;--color-text-disabled:#262626}-@media(prefers-color-scheme:dark){:root:not([data-theme]){--color-text-primary:#fafafa;--color-text-secondary:#a3a3a3;--color-text-tertiary:#737373;--color-background-full:#121212;--color-background-primary-default:#262626;--color-background-primary-hover:#40404099;--color-background-secondary-default:#171717;--color-background-tertiary-default:#262626;--color-border-button-default:#404040;--color-border-button-hover:#737373;--color-separator-border:#262626;--color-text-disabled:#525252}}+:root,:root[data-theme="light"]{--color-text-primary:#0a0a0a;--color-text-secondary:#737373;--color-text-tertiary:#a3a3a3;--color-background-full:#fff;--color-background-primary-default:#fff;--color-background-primary-hover:#f5f5f5;--color-background-secondary-default:#f5f5f5;--color-background-tertiary-default:#e5e5e5;--color-border-button-default:#e5e5e5;--color-border-button-hover:#d4d4d4;--color-border-button-active:#a3a3a3;--color-separator-border:#e5e5e5;--color-border-focus-ring:#3b82f6;--color-text-white:#fff;--color-text-disabled:#d4d4d4;--board-blue:linear-gradient(180deg,#3b82f6,#155dfc);--board-blue-hover:linear-gradient(180deg,#60a5fa,#2563eb)}+:root[data-theme="dark"]{--color-text-primary:#fafafa;--color-text-secondary:#737373;--color-text-tertiary:#525252;--color-background-full:#121212;--color-background-primary-default:#262626;--color-background-primary-hover:#40404099;--color-background-secondary-default:#171717;--color-background-tertiary-default:#262626;--color-border-button-default:#404040;--color-border-button-hover:#737373;--color-border-button-active:#525252;--color-separator-border:#262626;--color-text-disabled:#262626}+@media(prefers-color-scheme:dark){:root:not([data-theme]){--color-text-primary:#fafafa;--color-text-secondary:#a3a3a3;--color-text-tertiary:#737373;--color-background-full:#121212;--color-background-primary-default:#262626;--color-background-primary-hover:#40404099;--color-background-secondary-default:#171717;--color-background-tertiary-default:#262626;--color-border-button-default:#404040;--color-border-button-hover:#737373;--color-border-button-active:#525252;--color-separator-border:#262626;--color-text-disabled:#525252}}:root{--page:var(--color-background-full);--ground:var(--color-background-secondary-default);--surface:var(--color-background-primary-default);--sunk:var(--color-background-secondary-default);--ink:var(--color-text-primary);--ink-2:var(--color-text-secondary);--muted:var(--color-text-secondary);--line:var(--color-border-button-default);--line-soft:var(--color-separator-border);--picked:var(--color-background-tertiary-default);--inset:var(--color-background-tertiary-default);--hover:var(--color-background-primary-hover);--tungsten:var(--color-border-focus-ring);--chart-0:#2dd4bf;--chart-1:#a3e635;--chart-2:#f472b6;--chart-3:#38bdf8;--board-font:'Inter Variable','Inter','Segoe UI','Microsoft YaHei UI','PingFang SC',sans-serif;--board-body:400 14px/20px var(--board-font);--board-body-medium:500 14px/20px var(--board-font);--board-compact:400 13px/18px var(--board-font);--board-caption:400 12px/16px var(--board-font);--board-heading:500 20px/26px var(--board-font);--board-title:500 32px/44px var(--board-font);--board-figure:500 24px/34px var(--board-font)}:root[data-theme]{--page:var(--color-background-full);--ground:var(--color-background-secondary-default);--surface:var(--color-background-primary-default);--sunk:var(--color-background-secondary-default);--ink:var(--color-text-primary);--ink-2:var(--color-text-secondary);--muted:var(--color-text-secondary);--line:var(--color-border-button-default);--line-soft:var(--color-separator-border);--picked:var(--color-background-tertiary-default);--inset:var(--color-background-tertiary-default);--hover:var(--color-background-primary-hover);--tungsten:var(--color-border-focus-ring)}body,.disp{font-family:var(--board-font);letter-spacing:0}body{font:var(--board-body)}button,input,textarea,select{font-family:var(--board-font)}diff --git a/web/css/16-settings.css b/web/css/16-settings.cssindex 891402805..14eaa530e 100644--- a/web/css/16-settings.css+++ b/web/css/16-settings.css@@ -1,5 +1,8 @@/* 内边距吃掉刘海和底部横条:iOS 上 `inset:0` 会一直铺到状态栏和 Home 指示条底下。 */body.settings-open{overflow:hidden}+/* 页面滚动条属于 html 而不只是 body:锁住 body 后文档根仍可滚,打开弹层时+ 背后的页滚动条还在,弹层自身加上它就是两条。 */+@supports selector(:has(*)){html:has(body.settings-open){overflow:hidden}}.iconswitch.javimageswitch label{width:auto;min-width:52px;padding-inline:10px}.javimageswitch label>span[aria-hidden]{display:inline-flex;align-items:center;gap:6px}.settingspanel{position:fixed;z-index:var(--layer-dialog);inset:0;isolation:isolate;display:grid;place-items:center;background:rgba(242,242,242,.8);padding:18px;padding-top:max(18px,env(safe-area-inset-top));padding-bottom:max(18px,env(safe-area-inset-bottom));overscroll-behavior:contain}diff --git a/web/css/22-followmanage.css b/web/css/22-followmanage.cssindex 518331dd8..5d006e076 100644--- a/web/css/22-followmanage.css+++ b/web/css/22-followmanage.css@@ -155,9 +155,16 @@「全部来源」在白面上只剩一行字,升降序那枚只剩一个箭头浮在页面上。 */.fbtn[data-srcfilter-toggle],.fbtn.fmanagedir{border:1px solid var(--field-ring);background:var(--ground);color:var(--ink-2)}.fbtn[data-srcfilter-toggle]:hover:not(:disabled),.fbtn.fmanagedir:hover:not(:disabled){border-color:var(--field-ring-hover);background:var(--ground)}-/* 焦点样式跟 boardui 口径走:2px 的蓝环加位移,不再画 vercel 的中性辉光。- 范围只限本页覆盖部分;共享输入的全局 vercel 档是别人的,没动。 */-.followmanage .geist-search input[type="search"]:focus{outline:2px solid var(--color-border-focus-ring);outline-offset:2px;box-shadow:none;border-color:var(--color-border-button-default)}+/* 输入焦点按 BoardUI Input 口径(2026-09-09 取证登记 boardui-input):壳不描边、+ 悬停与聚焦是同一枚 2px inset ring 在两档灰之间换档——悬停 border-button-hover、+ 聚焦 border-button-active,无辉光无蓝环。fill 由用户定成白底,环跟着走;+ 外框清零才不会有 1px 亮边夹在环和壳之间。按钮类的 focus-visible 仍按 Button 源的蓝 ring。 */+.followmanage .geist-search input[type="search"],+.followmanage .fcredfield input{border:0}+.followmanage .geist-search input[type="search"]:hover,+.followmanage .fcredfield input:hover{box-shadow:inset 0 0 0 2px var(--color-border-button-hover)}+.followmanage .geist-search input[type="search"]:focus,+.followmanage .fcredfield input:focus-visible{outline:0;box-shadow:inset 0 0 0 2px var(--color-border-button-active)}.fbtn[data-srcfilter-toggle][aria-expanded="true"]{border-color:var(--color-border-focus-ring);box-shadow:none;outline:2px solid var(--color-border-focus-ring);outline-offset:2px}.fbtn.small{height:26px;padding:0 10px;font-size:var(--fs-sm)}.fbtn svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:2}