@alexpeng/dsh-custom-plugin 0.11.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Host surface discovery for the glass materials.
3
+ *
4
+ * The shell paints its surfaces from CSS Modules, so every class name is a
5
+ * build hash (`mP3x-q_frame`, `_surface_1w4el_1`, …) and no stylesheet can
6
+ * target them. What *is* stable is the colour: while glass is on, the plugin
7
+ * lowers the host fill tokens to known translucent alphas, so an element whose
8
+ * computed background is one of those colours is a surface we just made
9
+ * translucent — whatever its class is. Floating surfaces are found by role
10
+ * instead, because they appear and disappear at runtime.
11
+ *
12
+ * Discovery is therefore version-agnostic and needs no host source change.
13
+ * @module @alexpeng/dsh-custom-plugin/client/glass/host-surfaces
14
+ */
15
+ import type { Rgba } from './glass-tokens.ts';
16
+ /** What a tagged surface is, which decides its blur budget and optics. */
17
+ export type HostGlassKind = 'surface' | 'sidebar' | 'panel' | 'dialog' | 'menu' | 'tooltip' | 'toast' | 'card' | 'input';
18
+ export interface HostGlassTarget {
19
+ readonly el: HTMLElement;
20
+ readonly kind: HostGlassKind;
21
+ /** Floating layers (dialog / menu / tooltip) may sit on top of another
22
+ * glass surface; everything else must not stack glass on glass. */
23
+ readonly floating: boolean;
24
+ }
25
+ export interface HostViewport {
26
+ readonly width: number;
27
+ readonly height: number;
28
+ }
29
+ /** Role / attribute selectors the shell's floating layers carry. */
30
+ export declare const HOST_FLOATING_SELECTORS: Array<{
31
+ selector: string;
32
+ kind: HostGlassKind;
33
+ }>;
34
+ /** Viewport sampling grid. Big surfaces are hit by many points; small cards by
35
+ * at least one, and the cost stays at ~130 hit tests instead of a full-tree
36
+ * computed-style walk. */
37
+ export declare const HOST_SCAN_COLUMNS = 14;
38
+ export declare const HOST_SCAN_ROWS = 9;
39
+ /**
40
+ * Parse a computed `background-color`. Chromium returns `rgb()` / `rgba()` for
41
+ * legacy colours and `color(srgb …)` for `color-mix()` results; anything else
42
+ * (oklch, a gradient keyword, an empty value) is reported as unknown so the
43
+ * caller never matches a surface it cannot reason about.
44
+ */
45
+ export declare function parseCssColor(value: string): Rgba | null;
46
+ /** Whether a surface colour is one of the fills the token set installed. */
47
+ export declare function matchesFill(color: Rgba, fills: readonly Rgba[]): boolean;
48
+ /**
49
+ * Whether a discovered surface keeps the material. Frost leaves a surface that
50
+ * already carries its own backdrop filter alone (the shell's menu material),
51
+ * but that check must not run on a surface we tagged in an earlier pass: our
52
+ * own `[data-vx-glass]` rule supplies the blur, so reading the computed filter
53
+ * would classify it as "host-provided" and untag it again. That exact
54
+ * re-scan flipped the sidebar and centre panel off 250 ms after they came on.
55
+ */
56
+ export declare function keepsHostSurface(alreadyTagged: boolean, liquid: boolean, selfBackdropFilter: string): boolean;
57
+ /**
58
+ * Whether a surface of this kind suppresses the glass of the surfaces nested
59
+ * inside it. This is the "no glass on glass" rule for one pane inside another:
60
+ * a card inside a glass panel does not need its own backdrop pass. The
61
+ * full-window frame is the exception — it deliberately carries no filter
62
+ * (kind `surface`), so it must never silence the sidebar and the centre panel
63
+ * inside it. That exact case removed every real surface on Desktop 0.2.2-rc.5.
64
+ */
65
+ export declare function suppressesDescendants(kind: HostGlassKind): boolean;
66
+ /**
67
+ * Remove surfaces that sit inside another glass surface. The map is keyed by
68
+ * element, so the parent walk is the only DOM part; the decision itself is
69
+ * `suppressesDescendants`.
70
+ */
71
+ export declare function dropNestedSurfaces<T extends {
72
+ kind: HostGlassKind;
73
+ floating: boolean;
74
+ }>(accepted: Map<Element, T>, parentOf: (el: Element) => Element | null): void;
75
+ export declare function classifyContainer(rect: {
76
+ width: number;
77
+ height: number;
78
+ }, viewport: HostViewport, hasTextbox: boolean): HostGlassKind | null;
79
+ /**
80
+ * Whether an ancestor truncates the backdrop the surface could sample. This is
81
+ * the most common reason a `backdrop-filter` "does nothing": the element is
82
+ * inside a `filter` / `opacity` / `mask` / `clip-path` / `mix-blend-mode`
83
+ * ancestor, so the sampled region stops there. An ancestor's own
84
+ * `backdrop-filter` also establishes a root, but that is the glass-on-glass
85
+ * case we deliberately keep (the child still refracts the parent pane).
86
+ */
87
+ export declare function backdropRootBlocked(el: HTMLElement, view: Window): boolean;
88
+ export interface HostScanOptions {
89
+ readonly doc: Document;
90
+ readonly viewport: HostViewport;
91
+ readonly fills: readonly Rgba[];
92
+ /** Elements the scanner must ignore (plugin-owned subtrees and layers). */
93
+ readonly ignore?: (el: Element) => boolean;
94
+ }
95
+ /** Every glass surface currently in the document, floating ones included. */
96
+ export declare function scanHostSurfaces(options: HostScanOptions): HostGlassTarget[];
@@ -0,0 +1,90 @@
1
+ /**
2
+ * Per-surface liquid-glass displacement filter.
3
+ *
4
+ * Apple's Liquid Glass reads as glass because the *edge* of the surface bends
5
+ * the content behind it (lensing) while the middle stays clean, with a faint
6
+ * specular rim and a thicker material on larger surfaces. This
7
+ * module builds exactly that as one SVG filter per surface geometry:
8
+ *
9
+ * - the displacement map is generated from the rounded-rect signed distance
10
+ * field — neutral grey in the flat middle, the outward normal in the bevel
11
+ * band, alpha 255 because Chromium premultiplies transparent PNGs to zeros
12
+ * (the approach of shuding/liquid-glass, MIT);
13
+ * - a single `feDisplacementMap` pass bends the backdrop. The filter stays
14
+ * **achromatic** on purpose: an earlier version displaced R/G/B at slightly
15
+ * different scales (the rdev/liquid-glass-react dispersion), which read as a
16
+ * coloured fringe on card and window edges — the reported "边缘异常泛色" —
17
+ * instead of glass;
18
+ * - `filterUnits="userSpaceOnUse"` in CSS pixels, so the bevel is a constant
19
+ * thickness in px instead of a percentage of the box. A shared
20
+ * `objectBoundingBox` filter cannot do that: a 6% bevel is 23px on a 380px
21
+ * card and 59px on a 980px sheet, and it stretches anisotropically on a
22
+ * sidebar.
23
+ *
24
+ * The filter is referenced from `backdrop-filter`, which only Chromium supports
25
+ * for `url()`; every caller keeps a plain blur fallback for the rest.
26
+ * @module @alexpeng/dsh-custom-plugin/client/glass/liquid-filter
27
+ */
28
+ /** Resolved geometry of one liquid surface, in CSS px. */
29
+ export interface LiquidGeometry {
30
+ readonly width: number;
31
+ readonly height: number;
32
+ readonly radius: number;
33
+ /** Edge band that carries the lens, px. */
34
+ readonly bevel: number;
35
+ /** `feDisplacementMap` scale; the map's amplitude is 0.25 of the range. */
36
+ readonly scale: number;
37
+ /** Softening blur applied to the displaced result, px. */
38
+ readonly blur: number;
39
+ }
40
+ /** Map pixel budget. The map is smooth, so a large surface may be sampled at a
41
+ * lower resolution without changing the lens; the budget keeps a 1000x800
42
+ * sheet from spending 800k SDF evaluations on every resize. */
43
+ export declare const LIQUID_MAP_MAX_PIXELS = 240000;
44
+ /** Hard floor/ceiling for the edge band, px. */
45
+ export declare const LIQUID_BEVEL_MIN = 8;
46
+ export declare const LIQUID_BEVEL_MAX = 26;
47
+ /**
48
+ * Size-adaptive geometry: a larger surface is a thicker material with a
49
+ * stronger lens, which is what Apple's material does ("larger elements get
50
+ * thicker material, deeper shadows, stronger refraction"). The steps are
51
+ * deliberately gentle so a 380px card and a 900px sheet still read as the same
52
+ * glass.
53
+ */
54
+ export declare function liquidGeometry(width: number, height: number, radius: number): LiquidGeometry;
55
+ /** Deterministic filter id: equal geometry reuses the same `<filter>`. */
56
+ export declare function liquidFilterId(g: LiquidGeometry): string;
57
+ /** The 2D-canvas surface this module needs; injected so tests need no DOM. */
58
+ export interface LiquidCanvasLike {
59
+ width: number;
60
+ height: number;
61
+ getContext(id: '2d'): LiquidContextLike | null;
62
+ toDataURL(type: string): string;
63
+ }
64
+ export interface LiquidContextLike {
65
+ createImageData(width: number, height: number): {
66
+ data: Uint8ClampedArray;
67
+ };
68
+ putImageData(image: {
69
+ data: Uint8ClampedArray;
70
+ }, x: number, y: number): void;
71
+ }
72
+ /** Resolution of the map for a geometry: 1 unless the pixel budget bites. */
73
+ export declare function liquidMapSize(g: LiquidGeometry): {
74
+ width: number;
75
+ height: number;
76
+ scale: number;
77
+ };
78
+ /**
79
+ * Build the displacement map as a PNG data URL. R carries the x normal, G the y
80
+ * normal, both offset around 128 so the flat middle displaces by exactly zero;
81
+ * alpha stays 255 for the premultiplication reason above.
82
+ */
83
+ export declare function buildLiquidMap(g: LiquidGeometry, canvas: LiquidCanvasLike): string | null;
84
+ /**
85
+ * Filter markup for one geometry: one displacement pass bends the backdrop,
86
+ * a sub-pixel blur softens the sampling, and only that result is output —
87
+ * never the map itself. The pass is achromatic: the three-pass RGB split it
88
+ * replaced showed a coloured fringe on card and window edges.
89
+ */
90
+ export declare function buildLiquidFilterMarkup(id: string, g: LiquidGeometry, mapHref: string): string;
@@ -13,6 +13,8 @@
13
13
  * 天青灰 leads the list: it is the install default and renders first among
14
14
  * the palette swatches, right after 无颜色. */
15
15
  export declare const PALETTE: Array<[string, string, string]>;
16
+ /** A surface counts as dark below this weighted brightness (0..255). */
17
+ export declare function isDarkSurface(hex: string): boolean;
16
18
  /** Parse a #rrggbb (or bare rrggbb) hex color; malformed input yields the
17
19
  * palette's neutral gray rather than throwing. */
18
20
  export declare function hexToRgb(hex: string): [number, number, number];
@@ -116,19 +118,23 @@ export declare const BACKDROP_ALPHA_LAYER1 = 0.27;
116
118
  /** `--dsw-specific-sidebar-fill` — the sidebar column (tab colour, a notch
117
119
  * denser than the base). */
118
120
  export declare const BACKDROP_ALPHA_SIDEBAR = 0.27;
121
+ /**
122
+ * Material the surfaces use while glass is on. `'off'` is the plain opaque
123
+ * shell. Declared here (not in the glass module) so the token-key helper can
124
+ * name it without an import cycle.
125
+ */
126
+ export type GlassMode = 'off' | 'frost' | 'liquid';
119
127
  /**
120
128
  * Identity of the theme-token override an appearance repaint would install.
121
129
  *
122
130
  * Re-registering the very same variables through the theme service is a costly
123
131
  * no-op: it re-applies tokens for the whole shell even when the palette and the
124
- * glass toggle did not move (which is what every slider tick does). The painter
125
- * compares this key and skips the registration when it has not changed.
132
+ * glass material did not move (which is what every slider tick does). The
133
+ * painter compares this key and skips the registration when it has not changed.
126
134
  *
127
- * `'none'` means the painter leaves the shell's own tokens alone; `'neutral'`
128
- * is the glass-only override; `'backdrop'` is the low-alpha override a mounted
129
- * renderer needs (no palette); `palette:<name>|glass:<0|1>|backdrop:<0|1>` is a
130
- * family override (glass changes the alpha form of the same values, and a
131
- * mounted renderer replaces them with the backdrop alphas, so all three
132
- * dimensions are part of the key).
135
+ * All three dimensions are part of the key: the palette family decides the RGB,
136
+ * the material decides the alpha form (and which tokens are overridden at all),
137
+ * and a mounted renderer replaces the three content tokens with the calibrated
138
+ * backdrop alphas.
133
139
  */
134
- export declare function appearanceTokenKey(bg: string | undefined, glass: boolean, backdrop?: boolean): string;
140
+ export declare function appearanceTokenKey(bg: string | undefined, mode: GlassMode, backdrop?: boolean): string;
@@ -9,4 +9,4 @@
9
9
  * be CSS-Module scoped.
10
10
  * @module @alexpeng/dsh-custom-plugin/client/styles
11
11
  */
12
- export declare const STATIC_CSS = "/* dsh-custom-plugin static styles: host-token design system. */\n/* Motion tokens live on the document root, not on .vx-root: the settings page\n and the dialogs/toasts it owns render outside our overlay layer, and an\n undefined custom property invalidates the whole animation shorthand there. */\n:root {\n --vx-ease: var(--ds-ease-in-out, cubic-bezier(.4, 0, .2, 1));\n --vx-ease-out: cubic-bezier(.16, 1, .3, 1);\n --vx-ease-in: cubic-bezier(.4, 0, 1, 1);\n --vx-dur-open: var(--ds-transition-duration, .2s);\n --vx-dur-pop: .18s;\n --vx-dur-close: .15s;\n --vx-dur-dialog: .22s;\n}\n.vx-root {\n position: fixed;\n inset: 0;\n pointer-events: none;\n z-index: 2147483000;\n font-family: var(--dsw-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif);\n font-size: var(--dsw-font-xs-13-font-size, 13px);\n line-height: var(--dsw-font-xs-13-line-height, 20px);\n color: var(--dsw-alias-label-primary, #1b1b1c);\n -webkit-font-smoothing: antialiased;\n}\n\n@keyframes vx-pop-in {\n from { opacity: 0; transform: translateY(var(--vx-pop-shift, 6px)) scale(.97); }\n to { opacity: 1; transform: none; }\n}\n@keyframes vx-pop-out {\n from { opacity: 1; transform: none; }\n to { opacity: 0; transform: translateY(calc(var(--vx-pop-shift, 6px) * .45)) scale(.985); }\n}\n@keyframes vx-pop-in-liquid {\n from { opacity: 0; transform: translateY(var(--vx-pop-shift, 6px)); }\n to { opacity: 1; transform: none; }\n}\n@keyframes vx-pop-out-liquid {\n from { opacity: 1; transform: none; }\n to { opacity: 0; transform: translateY(calc(var(--vx-pop-shift, 6px) * .45)); }\n}\n@keyframes vx-fade-in { from { opacity: 0; } to { opacity: 1; } }\n@keyframes vx-fade-out { from { opacity: 1; } to { opacity: 0; } }\n@keyframes vx-dialog-in {\n from { opacity: 0; transform: translateY(10px) scale(.975); }\n to { opacity: 1; transform: none; }\n}\n@keyframes vx-dialog-out {\n from { opacity: 1; transform: none; }\n to { opacity: 0; transform: translateY(4px) scale(.985); }\n}\n@keyframes vx-toast-in {\n from { opacity: 0; transform: translateY(10px) scale(.97); }\n to { opacity: 1; transform: none; }\n}\n@keyframes vx-toast-out {\n from { opacity: 1; transform: none; }\n to { opacity: 0; transform: translateY(6px) scale(.98); }\n}\n@keyframes vx-section-in {\n from { opacity: 0; transform: translateY(6px); }\n to { opacity: 1; transform: none; }\n}\n@keyframes vx-rotate { to { transform: rotate(360deg); } }\n\n/* Page background layer. Appended to <body>, never inside .vx-root: the\n overlay slot is nested in the shell's z-index:20 layer, where a negative\n z-index would still sit above the content it must stay behind. */\n.vx-bg {\n position: fixed;\n inset: 0;\n pointer-events: none;\n background: transparent;\n z-index: -1;\n}\n.vx-bg > canvas {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n display: block;\n}\n.vx-fx {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n}\n.vx-anchor {\n display: inline-block;\n width: 0;\n height: 1px;\n vertical-align: bottom;\n}\n.vx-turn-actions {\n display: inline-flex;\n gap: 4px;\n margin-left: 10px;\n vertical-align: middle;\n align-items: center;\n}\n\n/* ---------- material system ---------- */\n/* Frost: an evenly diffused milk pane. It is deliberately opaque \u2014 no clear\n body and no edge lensing \u2014 so it can never be mistaken for liquid glass. */\n.vx-glass,\n.vx-popover {\n background: linear-gradient(180deg, rgba(250, 251, 253, .9), rgba(244, 246, 250, .84));\n -webkit-backdrop-filter: blur(30px) saturate(1.3);\n backdrop-filter: blur(30px) saturate(1.3);\n box-shadow:\n inset 0 1px 0 rgba(255, 255, 255, .7),\n 0 0 0 .5px rgba(0, 0, 0, .1),\n 0 16px 40px rgba(15, 23, 42, .1);\n border-radius: var(--dsw-radius-lg, 16px);\n color: var(--dsw-alias-label-primary, #1b1b1c);\n}\n:root.vx-dark .vx-glass,\n:root.vx-dark .vx-popover {\n background: linear-gradient(180deg, rgba(31, 33, 39, .92), rgba(24, 26, 31, .86));\n box-shadow:\n inset 0 1px 0 rgba(255, 255, 255, .14),\n 0 0 0 .5px rgba(255, 255, 255, .1),\n 0 16px 40px rgba(0, 0, 0, .36);\n}\n:root.vx-glass-off .vx-glass,\n:root.vx-glass-off .vx-popover {\n background: var(--dsw-alias-bg-layer-3, #fff);\n -webkit-backdrop-filter: none;\n backdrop-filter: none;\n}\n/* Liquid: Apple-style clear glass. The body is colourless and clearly lighter\n than frost (82% -> 74% light, 70% -> 62% dark), so the app behind the floating\n window still reads through it. That window is its own compositor surface, so a\n real backdrop refraction is unavailable; the lens is carried by edge optics\n instead: a bright 1px specular rim, a soft top bevel, a darker bottom inner\n shade and a faint cyan/magenta dispersion in the rim. */\n.vx-liquid .vx-glass,\n.vx-liquid .vx-popover {\n background:\n radial-gradient(130% 90% at 12% -14%, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 58%),\n linear-gradient(180deg, rgba(249, 251, 254, .86) 0%, rgba(242, 246, 250, .78) 100%);\n -webkit-backdrop-filter: url(#vx-lg) blur(2px) saturate(1.5) brightness(1.04);\n backdrop-filter: url(#vx-lg) blur(2px) saturate(1.5) brightness(1.04);\n box-shadow:\n inset 0 1px 0 rgba(255, 255, 255, .95),\n inset 0 8px 14px -12px rgba(255, 255, 255, .9),\n inset 0 -10px 18px -14px rgba(22, 32, 52, .24),\n inset 0 0 0 1px rgba(255, 255, 255, .4),\n 0 0 0 .5px rgba(18, 28, 45, .18),\n 0 24px 56px rgba(15, 25, 45, .18);\n}\n:root.vx-dark .vx-liquid .vx-glass,\n:root.vx-dark .vx-liquid .vx-popover {\n background:\n radial-gradient(130% 90% at 12% -14%, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 58%),\n linear-gradient(180deg, rgba(28, 30, 36, .7) 0%, rgba(20, 22, 27, .62) 100%);\n box-shadow:\n inset 0 1px 0 rgba(255, 255, 255, .28),\n inset 0 8px 14px -12px rgba(255, 255, 255, .16),\n inset 0 -10px 18px -14px rgba(0, 0, 0, .55),\n inset 0 0 0 1px rgba(255, 255, 255, .12),\n 0 0 0 .5px rgba(0, 0, 0, .4),\n 0 24px 56px rgba(0, 0, 0, .45);\n}\n/* The 1px rim carries most of the glass read in the floating window: a bright\n specular arc plus a barely-there dispersion fringe. */\n.vx-liquid .vx-popover::after {\n content: '';\n position: absolute;\n inset: 0;\n padding: 1px;\n border-radius: inherit;\n pointer-events: none;\n background: linear-gradient(140deg,\n rgba(180, 240, 255, .7) 0%,\n rgba(255, 255, 255, .92) 14%,\n rgba(255, 255, 255, .16) 34%,\n rgba(255, 255, 255, .55) 50%,\n rgba(255, 255, 255, .1) 68%,\n rgba(210, 255, 245, .3) 84%,\n rgba(255, 190, 235, .55) 100%);\n -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);\n -webkit-mask-composite: xor;\n mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);\n}\n:root.vx-dark .vx-liquid .vx-popover::after {\n background: linear-gradient(140deg,\n rgba(150, 220, 255, .3) 0%,\n rgba(255, 255, 255, .34) 16%,\n rgba(255, 255, 255, .06) 36%,\n rgba(255, 255, 255, .22) 52%,\n rgba(255, 255, 255, .04) 70%,\n rgba(255, 190, 235, .22) 100%);\n}\n/* A live background needs no special material: the clear body already transmits\n it. Only a two-point fill reduction keeps the texture from competing with the\n copy, and the edge optics stay untouched in every background mode. */\n:root.vx-bg-live:not(.vx-glass-off) .vx-glass,\n:root.vx-bg-live:not(.vx-glass-off) .vx-popover {\n background: linear-gradient(180deg, rgba(250, 251, 253, .88), rgba(244, 246, 250, .82));\n -webkit-backdrop-filter: blur(24px) saturate(1.3);\n backdrop-filter: blur(24px) saturate(1.3);\n}\n:root.vx-bg-live.vx-liquid:not(.vx-glass-off) .vx-glass,\n:root.vx-bg-live.vx-liquid:not(.vx-glass-off) .vx-popover {\n background:\n radial-gradient(130% 90% at 12% -14%, rgba(255, 255, 255, .46), rgba(255, 255, 255, 0) 58%),\n linear-gradient(180deg, rgba(249, 251, 254, .84) 0%, rgba(242, 246, 250, .76) 100%);\n}\n@supports not (backdrop-filter: url(#vx-lg)) {\n .vx-liquid .vx-glass,\n .vx-liquid .vx-popover {\n background: rgba(251, 252, 255, .62);\n -webkit-backdrop-filter: blur(30px) saturate(1.3);\n backdrop-filter: blur(30px) saturate(1.3);\n box-shadow:\n inset 0 1px 0 rgba(255, 255, 255, .9),\n 0 0 0 .5px rgba(0, 0, 0, .12),\n 0 18px 44px rgba(15, 25, 45, .16);\n }\n}\n@media (prefers-reduced-transparency: reduce) {\n .vx-liquid .vx-glass,\n .vx-liquid .vx-popover {\n background: var(--dsw-alias-bg-layer-3, #fff);\n -webkit-backdrop-filter: none;\n backdrop-filter: none;\n }\n}\n\n/* ---------- chips, header and rail buttons ---------- */\n.vx-chip {\n pointer-events: auto;\n border: 1px solid var(--dsw-alias-border-l2, rgba(0, 0, 0, .1));\n background: var(--dsw-alias-interactive-bg-hover, rgba(38, 49, 72, .06));\n color: var(--dsw-alias-label-secondary, #61666b);\n border-radius: var(--dsw-radius-sm, 8px);\n padding: 2px 8px;\n font-size: var(--dsw-font-xxxs-11-font-size, 11px);\n line-height: var(--dsw-font-xxxs-11-line-height, 14px);\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n gap: 3px;\n transition: background-color var(--ds-transition-duration-fast, .1s) var(--vx-ease);\n}\n.vx-chip:hover {\n background: var(--dsw-alias-interactive-bg-active, rgba(38, 49, 72, .1));\n color: var(--dsw-alias-label-primary, #1b1b1c);\n}\n.vx-link { text-decoration: none; }\n.vx-header-btn,\n.vx-foot-btn,\n.vx-balance-text {\n display: inline-flex;\n align-items: center;\n gap: 5px;\n padding: 3px 10px;\n min-height: 28px;\n border-radius: var(--dsw-radius-sm, 8px);\n font-size: var(--dsw-font-xs-13-font-size, 13px);\n color: var(--dsw-alias-label-secondary, #61666b);\n background: transparent;\n border: 1px solid transparent;\n cursor: pointer;\n white-space: nowrap;\n transition: background-color var(--ds-transition-duration-fast, .1s) var(--vx-ease), color var(--ds-transition-duration-fast, .1s) var(--vx-ease);\n}\n.vx-header-btn:hover,\n.vx-foot-btn:hover,\n.vx-balance-text:hover {\n background: var(--dsw-alias-interactive-bg-hover, rgba(38, 49, 72, .06));\n color: var(--dsw-alias-label-primary, #1b1b1c);\n}\n/* The session header row places the native agent-preset chip and our injected\n * buttons in one 10px-gap flex row. The chip right-insets its label by 2px\n * (padding: 0 2px 0 0), so the 10px padding above left a wider gap between\n * our two buttons than between the chip and the first of them. Match the\n * native inset so both gaps read as one rhythm. */\n.vx-header-btn { padding: 3px 2px; }\n.vx-header-btn[aria-expanded='true'],\n.vx-balance-text.vx-balance-open {\n background: var(--dsw-alias-interactive-bg-active, rgba(38, 49, 72, .1));\n color: var(--dsw-alias-label-primary, #1b1b1c);\n}\n.vx-balance-wrap { display: inline-flex; align-items: center; position: relative; }\n.vx-balance-today {\n color: var(--dsw-alias-label-tertiary, #979da6);\n font-size: var(--dsw-font-xxs-12-font-size, 12px);\n}\n.vx-balance-lines { font-size: var(--dsw-font-xs-13-font-size, 13px); margin: 6px 0; }\n\n/* ---------- buttons ---------- */\n.vx-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n min-height: 30px;\n padding: 0 12px;\n border-radius: var(--dsw-radius-sm, 8px);\n border: 1px solid transparent;\n font-family: inherit;\n font-size: var(--dsw-font-xs-13-font-size, 13px);\n line-height: 18px;\n cursor: pointer;\n white-space: nowrap;\n transition: background-color var(--ds-transition-duration-fast, .1s) var(--vx-ease), color var(--ds-transition-duration-fast, .1s) var(--vx-ease), border-color var(--ds-transition-duration-fast, .1s) var(--vx-ease);\n}\n.vx-button:disabled { opacity: .5; cursor: default; }\n.vx-button-sm { min-height: 26px; padding: 0 9px; font-size: var(--dsw-font-xxs-12-font-size, 12px); }\n.vx-button-block { width: 100%; }\n.vx-button-primary {\n background: var(--dsw-alias-button-primary-fill, #1b1b1c);\n color: var(--dsw-alias-label-primary-foreground, #fff);\n}\n.vx-button-primary:hover:not(:disabled) { background: var(--dsw-alias-button-primary-hover, #2c2c2e); }\n.vx-button-secondary {\n background: var(--dsw-alias-interactive-bg-hover, rgba(38, 49, 72, .06));\n border-color: var(--dsw-alias-border-l2, rgba(0, 0, 0, .1));\n color: var(--dsw-alias-label-primary, #1b1b1c);\n}\n.vx-button-secondary:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-active, rgba(38, 49, 72, .1));\n}\n.vx-button-ghost {\n background: transparent;\n color: var(--dsw-alias-label-secondary, #61666b);\n}\n.vx-button-ghost:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover, rgba(38, 49, 72, .06));\n color: var(--dsw-alias-label-primary, #1b1b1c);\n}\n.vx-button-danger {\n background: color-mix(in srgb, var(--dsw-alias-state-error-primary, #ec1313) 12%, transparent);\n border-color: color-mix(in srgb, var(--dsw-alias-state-error-primary, #ec1313) 45%, transparent);\n color: var(--dsw-alias-state-error-primary, #ec1313);\n}\n.vx-button-danger:hover:not(:disabled) {\n background: color-mix(in srgb, var(--dsw-alias-state-error-primary, #ec1313) 20%, transparent);\n}\n.vx-icon-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n padding: 0;\n border: none;\n border-radius: var(--dsw-radius-sm, 8px);\n background: transparent;\n color: var(--dsw-alias-label-secondary, #61666b);\n cursor: pointer;\n font-size: 16px;\n line-height: 1;\n transition: background-color var(--ds-transition-duration-fast, .1s) var(--vx-ease);\n}\n.vx-icon-button:hover { background: var(--dsw-alias-interactive-bg-hover, rgba(38, 49, 72, .06)); color: var(--dsw-alias-label-primary, #1b1b1c); }\n.vx-icon-button-sm { width: 24px; height: 24px; font-size: 14px; }\n\n/* Legacy text buttons kept for surfaces not yet migrated. */\n.vx-btn {\n pointer-events: auto;\n border: 1px solid var(--dsw-alias-border-l2, rgba(0, 0, 0, .1));\n background: var(--dsw-alias-interactive-bg-hover, rgba(38, 49, 72, .06));\n color: var(--dsw-alias-label-primary, #1b1b1c);\n border-radius: var(--dsw-radius-sm, 8px);\n padding: 5px 11px;\n font-family: inherit;\n font-size: var(--dsw-font-xxs-12-font-size, 12px);\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n gap: 5px;\n transition: background-color var(--ds-transition-duration-fast, .1s) var(--vx-ease);\n}\n.vx-btn:hover { background: var(--dsw-alias-interactive-bg-active, rgba(38, 49, 72, .1)); }\n.vx-btn.on,\n.vx-btn[aria-pressed='true'] {\n background: var(--dsw-alias-interactive-bg-active, rgba(38, 49, 72, .1));\n border-color: var(--dsw-alias-border-l3, rgba(0, 0, 0, .12));\n color: var(--dsw-alias-label-primary, #1b1b1c);\n}\n.vx-btn:disabled { opacity: .5; cursor: default; }\n.vx-btn-sm { padding: 2px 8px; font-size: var(--dsw-font-xxxs-11-font-size, 11px); }\n.vx-btn-danger {\n background: color-mix(in srgb, var(--dsw-alias-state-error-primary, #ec1313) 12%, transparent);\n border-color: color-mix(in srgb, var(--dsw-alias-state-error-primary, #ec1313) 45%, transparent);\n color: var(--dsw-alias-state-error-primary, #ec1313);\n}\n.vx-btn.big { padding: 9px 15px; font-size: var(--dsw-font-xs-13-font-size, 13px); }\n\n/* ---------- inputs, fields, switches, segmented controls ---------- */\n.vx-input {\n flex: 1;\n min-width: 0;\n min-height: 30px;\n border: 1px solid var(--dsw-alias-border-l2, rgba(0, 0, 0, .1));\n background: var(--dsw-specific-input-major, var(--dsw-alias-bg-layer-3, #fff));\n color: var(--dsw-alias-label-primary, #1b1b1c);\n border-radius: var(--dsw-radius-sm, 8px);\n padding: 5px 10px;\n font-family: inherit;\n font-size: var(--dsw-font-xs-13-font-size, 13px);\n}\n.vx-input::placeholder { color: var(--dsw-alias-label-caption, #adb2b8); }\n.vx-input:focus-visible { outline-color: var(--dsw-alias-state-business-primary, #4176e6); outline-width: var(--dsw-focus-ring-width, 2px); }\n.vx-field { display: flex; flex-direction: column; gap: 6px; }\n.vx-field-label { font-size: var(--dsw-font-xxs-strong-12-font-size, 12px); font-weight: 500; color: var(--dsw-alias-label-secondary, #61666b); }\n.vx-field-hint { font-size: var(--dsw-font-xxs-12-font-size, 12px); color: var(--dsw-alias-label-tertiary, #979da6); line-height: 18px; }\n.vx-field-error { font-size: var(--dsw-font-xxs-12-font-size, 12px); color: var(--dsw-alias-state-error-primary, #ec1313); }\n.vx-switch-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; }\n.vx-switch-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }\n.vx-switch-label { font-size: var(--dsw-font-xs-13-font-size, 13px); color: var(--dsw-alias-label-primary, #1b1b1c); cursor: pointer; }\n.vx-switch-hint { font-size: var(--dsw-font-xxs-12-font-size, 12px); color: var(--dsw-alias-label-tertiary, #979da6); line-height: 18px; }\n.vx-switch {\n position: relative;\n width: 36px;\n height: 20px;\n flex: 0 0 auto;\n border: none;\n border-radius: 999px;\n background: var(--dsw-alias-state-idle-primary, #d4d4d4);\n cursor: pointer;\n padding: 0;\n transition: background-color var(--ds-transition-duration, .2s) var(--vx-ease);\n}\n.vx-switch.on { background: var(--dsw-alias-state-business-primary, #4176e6); }\n.vx-switch-thumb {\n position: absolute;\n top: 2px;\n left: 2px;\n width: 16px;\n height: 16px;\n border-radius: 999px;\n background: var(--dsw-alias-switch-thumb, #fff);\n transition: transform var(--ds-transition-duration, .2s) var(--vx-ease);\n}\n.vx-switch.on .vx-switch-thumb { transform: translateX(16px); }\n.vx-switch-row.is-disabled { opacity: .5; }\n.vx-segmented { display: flex; flex-direction: column; gap: 6px; }\n.vx-segmented-track {\n display: inline-flex;\n align-self: flex-start;\n gap: 2px;\n padding: 2px;\n border-radius: var(--dsw-radius-sm, 8px);\n background: var(--dsw-alias-interactive-bg-hover, rgba(38, 49, 72, .06));\n}\n.vx-segmented-item {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n min-height: 26px;\n padding: 0 10px;\n border: none;\n border-radius: calc(var(--dsw-radius-sm, 8px) - 2px);\n background: transparent;\n color: var(--dsw-alias-label-secondary, #61666b);\n font-family: inherit;\n font-size: var(--dsw-font-xxs-12-font-size, 12px);\n cursor: pointer;\n transition: background-color var(--ds-transition-duration-fast, .1s) var(--vx-ease);\n}\n.vx-segmented-item.on {\n background: var(--dsw-alias-bg-layer-3, #fff);\n color: var(--dsw-alias-label-primary, #1b1b1c);\n box-shadow: var(--dsw-shadow-lv1, 0 2px 4px rgba(0, 0, 0, .05));\n}\n.vx-toggle-row {\n display: flex;\n gap: 8px;\n align-items: center;\n font-size: var(--dsw-font-xs-13-font-size, 13px);\n}\n\n/* ---------- layout ---------- */\n.vx-col { display: flex; flex-direction: column; gap: 10px; }\n.vx-row { display: flex; gap: 8px; align-items: center; }\n.vx-row.wrap { flex-wrap: wrap; }\n.vx-flex1 { flex: 1; }\n.vx-ellipsis {\n max-width: 60%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.vx-section-title {\n font-size: var(--dsw-font-s-strong-14-font-size, 14px);\n font-weight: 500;\n line-height: var(--dsw-font-s-strong-14-line-height, 22px);\n margin-top: 4px;\n color: var(--dsw-alias-label-primary, #1b1b1c);\n}\n.vx-muted {\n color: var(--dsw-alias-label-tertiary, #979da6);\n font-size: var(--dsw-font-xxs-12-font-size, 12px);\n line-height: 18px;\n}\n.vx-note {\n border-left: 2px solid var(--dsw-alias-border-l3, rgba(0, 0, 0, .12));\n padding: 4px 0 4px 9px;\n font-size: var(--dsw-font-xxs-12-font-size, 12px);\n line-height: 18px;\n color: var(--dsw-alias-label-tertiary, #979da6);\n}\n.vx-error { color: var(--dsw-alias-state-error-primary, #ec1313); font-size: var(--dsw-font-xxs-12-font-size, 12px); }\n.vx-pad { padding: 12px; }\n.vx-pad-sm { padding: 6px 2px; }\n.vx-badge {\n display: inline-flex;\n align-items: center;\n border-radius: 999px;\n padding: 0 7px;\n min-height: 18px;\n font-size: var(--dsw-font-xxxs-11-font-size, 11px);\n background: var(--dsw-alias-interactive-bg-hover, rgba(38, 49, 72, .06));\n color: var(--dsw-alias-label-tertiary, #979da6);\n}\n.vx-badge-accent { background: color-mix(in srgb, var(--dsw-alias-state-business-primary, #4176e6) 14%, transparent); color: var(--dsw-alias-state-business-primary, #4176e6); }\n.vx-badge-danger { background: color-mix(in srgb, var(--dsw-alias-state-error-primary, #ec1313) 12%, transparent); color: var(--dsw-alias-state-error-primary, #ec1313); }\n.vx-badge-success { background: color-mix(in srgb, var(--dsw-alias-state-success-primary, #22c55e) 14%, transparent); color: var(--dsw-alias-state-success-primary, #22c55e); }\n.vx-kbd {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 18px;\n height: 18px;\n padding: 0 4px;\n border-radius: var(--dsw-radius-xs, 4px);\n background: var(--dsw-alias-interactive-bg-hover, rgba(38, 49, 72, .06));\n color: var(--dsw-alias-label-tertiary, #979da6);\n font-family: var(--ds-font-family-code, monospace);\n font-size: 10px;\n}\n\n/* ---------- cards ---------- */\n.vx-card {\n background: var(--dsw-alias-bg-layer-3, var(--dsw-alias-settings-card-fill, #fff));\n border-radius: var(--dsw-radius-lg, 16px);\n box-shadow: 0 0 0 .5px var(--dsw-alias-settings-card-stroke, var(--dsw-alias-border-l3, rgba(0, 0, 0, .12)));\n padding: 16px;\n}\n/* Settings sheet: one self-contained material plane, painted from neutral\n colours instead of the host's per-mode tokens, so switching \u80CC\u666F\u52A8\u6548 between\n \u5173\u95ED/\u5B57\u7B26/\u5149\u5F71 cannot turn it into flat white. Frost is a milky 94% sheet;\n liquid is the same clear Apple-style pane as the popovers (88% -> 80%) with\n the identical edge optics. Cards inside are transparent groups, not a second\n material layer. */\n.vx-settings-page.vx-glass-on {\n position: relative;\n width: 100%;\n max-width: 980px;\n box-sizing: border-box;\n padding: 16px;\n border-radius: 22px;\n background: linear-gradient(180deg, rgba(250, 251, 253, .94), rgba(244, 246, 250, .88));\n -webkit-backdrop-filter: blur(28px) saturate(1.3);\n backdrop-filter: blur(28px) saturate(1.3);\n box-shadow:\n inset 0 1px 0 rgba(255, 255, 255, .7),\n 0 0 0 .5px rgba(0, 0, 0, .1),\n 0 18px 44px rgba(15, 23, 42, .08);\n}\n:root.vx-dark .vx-settings-page.vx-glass-on {\n background: linear-gradient(180deg, rgba(31, 33, 39, .94), rgba(24, 26, 31, .88));\n box-shadow:\n inset 0 1px 0 rgba(255, 255, 255, .14),\n 0 0 0 .5px rgba(255, 255, 255, .1),\n 0 18px 44px rgba(0, 0, 0, .34);\n}\n.vx-settings-page.vx-glass-on.vx-liquid {\n background:\n radial-gradient(120% 70% at 10% -14%, rgba(255, 255, 255, .66), rgba(255, 255, 255, 0) 56%),\n linear-gradient(180deg, rgba(249, 251, 254, .9) 0%, rgba(242, 246, 250, .82) 100%);\n -webkit-backdrop-filter: url(#vx-lg) blur(3px) saturate(1.5) brightness(1.04);\n backdrop-filter: url(#vx-lg) blur(3px) saturate(1.5) brightness(1.04);\n box-shadow:\n inset 0 1px 0 rgba(255, 255, 255, .97),\n inset 0 10px 18px -14px rgba(255, 255, 255, .85),\n inset 0 -14px 24px -18px rgba(22, 32, 52, .25),\n inset 0 0 0 1px rgba(255, 255, 255, .42),\n 0 0 0 .5px rgba(18, 28, 45, .18),\n 0 26px 60px rgba(15, 25, 45, .2);\n}\n:root.vx-dark .vx-settings-page.vx-glass-on.vx-liquid {\n background:\n radial-gradient(120% 70% at 10% -14%, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 56%),\n linear-gradient(180deg, rgba(28, 30, 36, .76) 0%, rgba(20, 22, 27, .68) 100%);\n box-shadow:\n inset 0 1px 0 rgba(255, 255, 255, .3),\n inset 0 10px 18px -14px rgba(255, 255, 255, .16),\n inset 0 -14px 24px -18px rgba(0, 0, 0, .55),\n inset 0 0 0 1px rgba(255, 255, 255, .14),\n 0 0 0 .5px rgba(0, 0, 0, .42),\n 0 26px 60px rgba(0, 0, 0, .46);\n}\n/* Same specular rim as the popovers and dialogs. */\n.vx-settings-page.vx-glass-on.vx-liquid::after {\n content: '';\n position: absolute;\n inset: 0;\n padding: 1px;\n border-radius: inherit;\n pointer-events: none;\n background: linear-gradient(140deg,\n rgba(180, 240, 255, .6) 0%,\n rgba(255, 255, 255, .92) 16%,\n rgba(255, 255, 255, .14) 36%,\n rgba(255, 255, 255, .5) 52%,\n rgba(255, 255, 255, .08) 70%,\n rgba(255, 190, 235, .45) 100%);\n -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);\n -webkit-mask-composite: xor;\n mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);\n}\n:root.vx-dark .vx-settings-page.vx-glass-on.vx-liquid::after {\n background: linear-gradient(140deg,\n rgba(150, 220, 255, .24) 0%,\n rgba(255, 255, 255, .34) 16%,\n rgba(255, 255, 255, .06) 36%,\n rgba(255, 255, 255, .22) 52%,\n rgba(255, 255, 255, .04) 70%,\n rgba(255, 190, 235, .2) 100%);\n}\n/* A live background may only nudge the transmission; the optics never move, so\n the sheet reads as the same material in all three background modes. */\n.vx-settings-page.vx-glass-on.vx-bg-live {\n background: linear-gradient(180deg, rgba(250, 251, 253, .92), rgba(244, 246, 250, .86));\n}\n.vx-settings-page.vx-glass-on.vx-liquid.vx-bg-live {\n background:\n radial-gradient(120% 70% at 10% -14%, rgba(255, 255, 255, .62), rgba(255, 255, 255, 0) 56%),\n linear-gradient(180deg, rgba(249, 251, 254, .88) 0%, rgba(242, 246, 250, .8) 100%);\n}\n:root.vx-dark .vx-settings-page.vx-glass-on.vx-bg-live {\n background: linear-gradient(180deg, rgba(31, 33, 39, .92), rgba(24, 26, 31, .86));\n}\n:root.vx-dark .vx-settings-page.vx-glass-on.vx-liquid.vx-bg-live {\n background:\n radial-gradient(120% 70% at 10% -14%, rgba(255, 255, 255, .2), rgba(255, 255, 255, 0) 56%),\n linear-gradient(180deg, rgba(28, 30, 36, .74) 0%, rgba(20, 22, 27, .66) 100%);\n}\n.vx-settings-page.vx-glass-off {\n background: var(--dsw-alias-bg-layer-3, var(--dsw-alias-settings-card-fill, #fff));\n box-shadow: 0 0 0 .5px var(--dsw-alias-settings-card-stroke, var(--dsw-alias-border-l3, rgba(0, 0, 0, .12)));\n}\n/* Grouped content inside the sheet: transparent, separated by a hairline. */\n.vx-settings-page.vx-glass-on .vx-card {\n background: rgba(255, 255, 255, .24);\n -webkit-backdrop-filter: none;\n backdrop-filter: none;\n box-shadow:\n inset 0 1px 0 rgba(255, 255, 255, .55),\n inset 0 0 0 .5px rgba(255, 255, 255, .35);\n}\n.vx-settings-page.vx-glass-on.vx-liquid .vx-card {\n background: rgba(255, 255, 255, .18);\n box-shadow:\n inset 0 1px 0 rgba(255, 255, 255, .6),\n inset 0 0 0 .5px rgba(255, 255, 255, .3);\n}\n:root.vx-dark .vx-settings-page.vx-glass-on .vx-card {\n background: rgba(255, 255, 255, .06);\n box-shadow:\n inset 0 1px 0 rgba(255, 255, 255, .12),\n inset 0 0 0 .5px rgba(255, 255, 255, .1);\n}\n:root.vx-dark .vx-settings-page.vx-glass-on.vx-liquid .vx-card {\n background: rgba(255, 255, 255, .05);\n box-shadow:\n inset 0 1px 0 rgba(255, 255, 255, .14),\n inset 0 0 0 .5px rgba(255, 255, 255, .1);\n}\n.vx-settings-page.vx-glass-off .vx-card {\n background: transparent;\n -webkit-backdrop-filter: none;\n backdrop-filter: none;\n box-shadow: inset 0 0 0 .5px var(--dsw-alias-settings-card-stroke, var(--dsw-alias-border-l3, rgba(0, 0, 0, .12)));\n}\n.vx-card-head {\n display: flex;\n align-items: flex-start;\n gap: 12px;\n margin-bottom: 12px;\n}\n.vx-card-titles { flex: 1; min-width: 0; }\n.vx-card-title {\n margin: 0;\n font-size: var(--dsw-font-s-strong-14-font-size, 14px);\n font-weight: 500;\n line-height: var(--dsw-font-s-strong-14-line-height, 22px);\n color: var(--dsw-alias-label-primary, #1b1b1c);\n}\n.vx-card-desc {\n margin: 2px 0 0;\n font-size: var(--dsw-font-xxs-12-font-size, 12px);\n line-height: 18px;\n color: var(--dsw-alias-label-tertiary, #979da6);\n}\n.vx-card-actions { display: flex; align-items: center; gap: 6px; }\n.vx-card-body { display: flex; flex-direction: column; gap: 10px; }\n\n/* ---------- empty / loading ---------- */\n.vx-empty {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 6px;\n padding: 28px 16px;\n text-align: center;\n color: var(--dsw-alias-label-tertiary, #979da6);\n}\n.vx-empty-icon { opacity: .6; }\n.vx-empty-title { font-size: var(--dsw-font-xs-13-font-size, 13px); color: var(--dsw-alias-label-secondary, #61666b); }\n.vx-empty-hint { font-size: var(--dsw-font-xxs-12-font-size, 12px); line-height: 18px; }\n.vx-empty-action { margin-top: 4px; }\n.vx-spinner { display: inline-flex; align-items: center; gap: 3px; }\n.vx-spinner-dot {\n width: 4px;\n height: 4px;\n border-radius: 50%;\n background: var(--dsw-alias-label-tertiary, #979da6);\n animation: vx-spin 1s infinite ease-in-out;\n}\n.vx-spinner-dot:nth-child(2) { animation-delay: .15s; }\n.vx-spinner-dot:nth-child(3) { animation-delay: .3s; }\n@keyframes vx-spin {\n 0%, 80%, 100% { opacity: .3; transform: scale(.8); }\n 40% { opacity: 1; transform: scale(1); }\n}\n\n/* ---------- anchors / swatches / parameters ---------- */\n.vx-swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }\n.vx-swatch {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 4px;\n border: none;\n background: transparent;\n color: inherit;\n cursor: pointer;\n padding: 2px;\n border-radius: var(--dsw-radius-sm, 8px);\n}\n.vx-swatch:hover { background: var(--dsw-alias-interactive-bg-hover, rgba(38, 49, 72, .06)); }\n.vx-swatch-box {\n width: 100%;\n height: 26px;\n border-radius: var(--dsw-radius-sm, 8px);\n box-shadow: 0 0 0 1px var(--dsw-alias-border-l2, rgba(0, 0, 0, .1));\n box-sizing: border-box;\n transition: box-shadow var(--ds-transition-duration-fast, .1s) var(--vx-ease);\n}\n.vx-swatch.on .vx-swatch-box {\n box-shadow: 0 0 0 2px var(--dsw-alias-state-business-primary, #4176e6);\n}\n.vx-swatch-label {\n font-size: var(--dsw-font-xxxs-11-font-size, 11px);\n color: var(--dsw-alias-label-tertiary, #979da6);\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.vx-param-list { display: flex; flex-direction: column; gap: 6px; margin-top: 2px; }\n.vx-param-row { display: grid; grid-template-columns: 52px 1fr 54px; gap: 8px; align-items: center; }\n.vx-param-label { font-size: var(--dsw-font-xxs-12-font-size, 12px); color: var(--dsw-alias-label-secondary, #61666b); }\n.vx-param-val {\n font-size: var(--dsw-font-xxxs-11-font-size, 11px);\n text-align: right;\n font-variant-numeric: tabular-nums;\n color: var(--dsw-alias-label-tertiary, #979da6);\n}\n.vx-range { width: 100%; height: 18px; margin: 0; accent-color: var(--dsw-alias-state-business-primary, #4176e6); }\n\n/* ---------- export ---------- */\n.vx-format-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }\n.vx-format-card {\n display: flex;\n flex-direction: column;\n gap: 2px;\n text-align: left;\n padding: 10px 12px;\n border-radius: var(--dsw-radius-md, 12px);\n border: 1px solid var(--dsw-alias-border-l2, rgba(0, 0, 0, .1));\n background: transparent;\n color: inherit;\n font-family: inherit;\n cursor: pointer;\n transition: background-color var(--ds-transition-duration-fast, .1s) var(--vx-ease), border-color var(--ds-transition-duration-fast, .1s) var(--vx-ease);\n}\n.vx-format-card:hover { background: var(--dsw-alias-interactive-bg-hover, rgba(38, 49, 72, .06)); }\n.vx-format-card.on { border-color: var(--dsw-alias-state-business-primary, #4176e6); background: color-mix(in srgb, var(--dsw-alias-state-business-primary, #4176e6) 8%, transparent); }\n.vx-format-title { font-size: var(--dsw-font-xs-13-font-size, 13px); font-weight: 500; }\n.vx-format-hint { font-size: var(--dsw-font-xxxs-11-font-size, 11px); color: var(--dsw-alias-label-tertiary, #979da6); }\n.vx-export-progress { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border-radius: var(--dsw-radius-sm, 8px); background: var(--dsw-alias-interactive-bg-hover, rgba(38, 49, 72, .06)); }\n.vx-export-result {\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 10px 12px;\n border-radius: var(--dsw-radius-md, 12px);\n background: color-mix(in srgb, var(--dsw-alias-state-success-primary, #22c55e) 10%, transparent);\n color: var(--dsw-alias-label-primary, #1b1b1c);\n}\n.vx-export-result-copy { min-width: 0; }\n.vx-budget-track {\n height: 6px;\n border-radius: 999px;\n background: var(--dsw-alias-interactive-bg-hover, rgba(38, 49, 72, .06));\n overflow: hidden;\n}\n.vx-budget-fill {\n height: 100%;\n border-radius: 999px;\n background: var(--dsw-alias-state-business-primary, #4176e6);\n transition: width var(--ds-transition-duration, .2s) var(--vx-ease);\n}\n.vx-budget-fill.over { background: var(--dsw-alias-state-warn-primary, #f59e0b); }\n/* Daily usage bars: one track per row, so the percentage is measured inside\n the space left by the date column instead of overflowing the card. */\n.vx-bar-track {\n flex: 1 1 auto;\n min-width: 0;\n height: 6px;\n border-radius: 999px;\n overflow: hidden;\n background: transparent;\n}\n.vx-bar-fill {\n display: block;\n height: 100%;\n min-width: 2px;\n border-radius: 999px;\n background: var(--dsw-alias-state-business-primary, #4176e6);\n transition: width var(--ds-transition-duration, .2s) var(--vx-ease);\n}\n.vx-count-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }\n.vx-count-cell {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 2px;\n padding: 10px 6px;\n border-radius: var(--dsw-radius-md, 12px);\n background: var(--dsw-alias-interactive-bg-hover, rgba(38, 49, 72, .06));\n}\n.vx-count-value { font-size: var(--dsw-font-l-20-font-size, 20px); font-weight: 500; line-height: 1.2; }\n.vx-count-label { font-size: var(--dsw-font-xxxs-11-font-size, 11px); color: var(--dsw-alias-label-tertiary, #979da6); }\n.vx-command-dialog { max-width: 620px; }\n.vx-command-input { margin-bottom: 4px; }\n.vx-command-list { max-height: min(420px, 56vh); }\n.vx-command-item { display: flex; align-items: center; gap: 10px; }\n.vx-command-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.vx-command-foot {\n display: flex;\n align-items: center;\n gap: 14px;\n width: 100%;\n font-size: var(--dsw-font-xxxs-11-font-size, 11px);\n color: var(--dsw-alias-label-tertiary, #979da6);\n}\n.vx-command-foot .vx-kbd { margin: 0 2px; }\n\n/* ---------- lists ---------- */\n.vx-list {\n display: flex;\n flex-direction: column;\n gap: 2px;\n max-height: 300px;\n overflow: auto;\n scrollbar-width: thin;\n scrollbar-color: var(--dsh-scrollbar-thumb, rgba(0, 0, 0, .2)) transparent;\n}\n.vx-list-item {\n text-align: left;\n border: none;\n background: transparent;\n color: var(--dsw-alias-label-primary, #1b1b1c);\n border-radius: var(--dsw-radius-sm, 8px);\n padding: 6px 8px;\n font-family: inherit;\n font-size: var(--dsw-font-xs-13-font-size, 13px);\n cursor: pointer;\n transition: background-color var(--ds-transition-duration-fast, .1s) var(--vx-ease);\n}\n.vx-list-item:hover { background: var(--dsw-alias-interactive-bg-hover, rgba(38, 49, 72, .06)); }\n.vx-list-item.on,\n.vx-list-item[aria-selected='true'] {\n background: var(--dsw-alias-interactive-bg-active, rgba(38, 49, 72, .1));\n}\n.vx-list-item:disabled { opacity: .5; cursor: default; }\n.vx-check-row { display: flex; gap: 8px; align-items: center; font-size: var(--dsw-font-xs-13-font-size, 13px); padding: 5px 4px; }\n.vx-check-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n\n/* ---------- tables ---------- */\n.vx-table { width: 100%; border-collapse: collapse; font-size: var(--dsw-font-xxs-12-font-size, 12px); }\n.vx-table th,\n.vx-table td {\n border-bottom: 1px solid var(--dsw-alias-border-l2, rgba(0, 0, 0, .1));\n padding: 5px 6px;\n text-align: right;\n color: var(--dsw-alias-label-secondary, #61666b);\n}\n.vx-table th {\n font-weight: 500;\n color: var(--dsw-alias-label-tertiary, #979da6);\n}\n.vx-table th:first-child,\n.vx-table td:first-child { text-align: left; }\n\n/* ---------- folders ---------- */\n.vx-folder-list { display: flex; flex-direction: column; gap: 2px; }\n.vx-rename-input { flex: 1; min-width: 0; min-height: 24px; padding: 2px 6px; font-size: var(--dsw-font-xxs-12-font-size, 12px); }\n.vx-folder { display: flex; flex-direction: column; }\n.vx-folder-head {\n display: flex;\n gap: 5px;\n align-items: center;\n padding: 4px 4px;\n border-radius: var(--dsw-radius-sm, 8px);\n cursor: grab;\n transition: background-color var(--ds-transition-duration-fast, .1s) var(--vx-ease);\n}\n.vx-folder-head:hover { background: var(--dsw-alias-interactive-bg-hover, rgba(38, 49, 72, .06)); }\n.vx-folder-head.drop-inside {\n background: var(--dsw-alias-interactive-bg-active, rgba(38, 49, 72, .1));\n outline: 1px dashed var(--dsw-alias-state-business-primary, #4176e6);\n}\n.vx-folder-head.drop-before { box-shadow: 0 -2px 0 0 var(--dsw-alias-state-business-primary, #4176e6); }\n.vx-folder-head.drop-after { box-shadow: 0 2px 0 0 var(--dsw-alias-state-business-primary, #4176e6); }\n.vx-folder-name {\n font-size: var(--dsw-font-xs-13-font-size, 13px);\n font-weight: 500;\n flex: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--dsw-alias-label-primary, #1b1b1c);\n}\n.vx-folder-body {\n border-left: 1px solid var(--dsw-alias-border-l2, rgba(0, 0, 0, .1));\n margin-left: 14px;\n padding-left: 6px;\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n.vx-item-row {\n display: flex;\n gap: 5px;\n align-items: center;\n padding: 3px 4px;\n border-radius: var(--dsw-radius-sm, 8px);\n}\n.vx-item-row:hover { background: var(--dsw-alias-interactive-bg-hover, rgba(38, 49, 72, .06)); }\n.vx-item-name {\n flex: 1;\n text-align: left;\n border: none;\n background: transparent;\n color: var(--dsw-alias-label-secondary, #61666b);\n font-family: inherit;\n font-size: var(--dsw-font-xs-13-font-size, 13px);\n cursor: pointer;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n padding: 0;\n}\n.vx-item-name:hover { color: var(--dsw-alias-label-primary, #1b1b1c); }\n.vx-mini {\n border: none;\n background: transparent;\n color: var(--dsw-alias-label-tertiary, #979da6);\n cursor: pointer;\n padding: 3px;\n border-radius: var(--dsw-radius-xs, 4px);\n display: inline-flex;\n align-items: center;\n transition: background-color var(--ds-transition-duration-fast, .1s) var(--vx-ease), color var(--ds-transition-duration-fast, .1s) var(--vx-ease);\n}\n.vx-mini:hover { color: var(--dsw-alias-label-primary, #1b1b1c); background: var(--dsw-alias-interactive-bg-hover, rgba(38, 49, 72, .06)); }\n.vx-form {\n display: flex;\n flex-direction: column;\n gap: 6px;\n border: 1px solid var(--dsw-alias-border-l2, rgba(0, 0, 0, .1));\n border-radius: var(--dsw-radius-md, 12px);\n padding: 8px;\n}\n\n/* ---------- prompts ---------- */\n.vx-toolbar {\n display: flex;\n align-items: center;\n gap: 6px;\n flex-wrap: wrap;\n}\n.vx-toolbar .vx-input { flex: 1 1 160px; }\n.vx-select { flex: 0 0 auto !important; width: auto; min-width: 96px; }\n.vx-textarea { resize: vertical; min-height: 140px; line-height: 20px; padding: 8px 10px; }\n.vx-prompt-grid {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n.vx-prompt-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }\n.vx-prompt-card {\n border: 1px solid var(--dsw-alias-border-l2, rgba(0, 0, 0, .1));\n background: var(--dsw-alias-bg-layer-3, transparent);\n border-radius: var(--dsw-radius-md, 12px);\n padding: 8px 10px;\n}\n.vx-prompt-title {\n font-weight: 500;\n font-size: var(--dsw-font-xs-13-font-size, 13px);\n color: var(--dsw-alias-label-primary, #1b1b1c);\n}\n.vx-prompt-body {\n margin-top: 4px;\n font-size: var(--dsw-font-xxs-12-font-size, 12px);\n line-height: 18px;\n color: var(--dsw-alias-label-secondary, #61666b);\n white-space: pre-wrap;\n word-break: break-word;\n max-height: 54px;\n overflow: hidden;\n}\n\n/* ---------- dialogs ---------- */\n.vx-dialog-mask {\n position: fixed;\n inset: 0;\n z-index: 60;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 24px;\n pointer-events: auto;\n background: var(--dsw-alias-bg-mask-1, rgba(8, 10, 16, .25));\n animation: vx-fade-in .18s var(--vx-ease-out);\n}\n.vx-dialog-mask[data-state='closed'] { animation: vx-fade-out .16s var(--vx-ease-in) forwards; }\n.vx-dialog {\n position: relative;\n display: flex;\n flex-direction: column;\n max-height: 82vh;\n width: min(520px, 100%);\n pointer-events: auto;\n border: none;\n border-radius: var(--dsw-radius-xl, 20px);\n background: var(--dsw-alias-bg-layer-3, #fff);\n color: var(--dsw-alias-label-primary, #1b1b1c);\n box-shadow: var(--dsw-elevation-prominent, 0 0 0 .5px rgba(0, 0, 0, .12), 0 12px 32px rgba(0, 0, 0, .12));\n animation: vx-dialog-in var(--vx-dur-dialog) var(--vx-ease-out);\n}\n/* Dialogs follow the same two materials. They render inside the main document,\n so the backdrop chain really does frost / refract the page behind. */\n:root:not(.vx-glass-off) .vx-dialog {\n background: linear-gradient(180deg, rgba(250, 251, 253, .94), rgba(244, 246, 250, .88));\n -webkit-backdrop-filter: blur(30px) saturate(1.3);\n backdrop-filter: blur(30px) saturate(1.3);\n box-shadow:\n inset 0 1px 0 rgba(255, 255, 255, .7),\n 0 0 0 .5px rgba(0, 0, 0, .1),\n 0 18px 44px rgba(15, 23, 42, .12);\n}\n:root.vx-dark:not(.vx-glass-off) .vx-dialog {\n background: linear-gradient(180deg, rgba(31, 33, 39, .94), rgba(24, 26, 31, .88));\n box-shadow:\n inset 0 1px 0 rgba(255, 255, 255, .14),\n 0 0 0 .5px rgba(255, 255, 255, .1),\n 0 18px 44px rgba(0, 0, 0, .4);\n}\n:root:not(.vx-glass-off).vx-liquid .vx-dialog {\n background:\n radial-gradient(130% 80% at 10% -14%, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 58%),\n linear-gradient(180deg, rgba(252, 253, 255, .62) 0%, rgba(248, 250, 253, .54) 100%);\n -webkit-backdrop-filter: url(#vx-lg) blur(3px) saturate(1.5) brightness(1.04);\n backdrop-filter: url(#vx-lg) blur(3px) saturate(1.5) brightness(1.04);\n box-shadow:\n inset 0 1px 0 rgba(255, 255, 255, .95),\n inset 0 10px 18px -14px rgba(255, 255, 255, .85),\n inset 0 -14px 24px -18px rgba(22, 32, 52, .25),\n inset 0 0 0 1px rgba(255, 255, 255, .42),\n 0 0 0 .5px rgba(18, 28, 45, .18),\n 0 26px 64px rgba(15, 25, 45, .22);\n}\n:root.vx-dark:not(.vx-glass-off).vx-liquid .vx-dialog {\n background:\n radial-gradient(130% 80% at 10% -14%, rgba(255, 255, 255, .2), rgba(255, 255, 255, 0) 58%),\n linear-gradient(180deg, rgba(28, 30, 36, .66) 0%, rgba(20, 22, 27, .58) 100%);\n box-shadow:\n inset 0 1px 0 rgba(255, 255, 255, .3),\n inset 0 10px 18px -14px rgba(255, 255, 255, .16),\n inset 0 -14px 24px -18px rgba(0, 0, 0, .55),\n inset 0 0 0 1px rgba(255, 255, 255, .14),\n 0 0 0 .5px rgba(0, 0, 0, .42),\n 0 26px 64px rgba(0, 0, 0, .5);\n}\n:root:not(.vx-glass-off).vx-liquid .vx-dialog::after {\n content: '';\n position: absolute;\n inset: 0;\n padding: 1px;\n border-radius: inherit;\n pointer-events: none;\n background: linear-gradient(140deg,\n rgba(180, 240, 255, .6) 0%,\n rgba(255, 255, 255, .9) 16%,\n rgba(255, 255, 255, .14) 36%,\n rgba(255, 255, 255, .5) 52%,\n rgba(255, 255, 255, .08) 70%,\n rgba(255, 190, 235, .45) 100%);\n -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);\n -webkit-mask-composite: xor;\n mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);\n}\n:root.vx-dark.vx-liquid:not(.vx-glass-off) .vx-dialog::after {\n background: linear-gradient(140deg,\n rgba(150, 220, 255, .24) 0%,\n rgba(255, 255, 255, .34) 16%,\n rgba(255, 255, 255, .06) 36%,\n rgba(255, 255, 255, .22) 52%,\n rgba(255, 255, 255, .04) 70%,\n rgba(255, 190, 235, .2) 100%);\n}\n.vx-dialog[data-state='closed'] { animation: vx-dialog-out .16s var(--vx-ease-in) forwards; }\n.vx-dialog-sm { max-width: 360px; }\n.vx-dialog-md { max-width: 520px; }\n.vx-dialog-lg { max-width: 720px; }\n.vx-dialog-head {\n display: flex;\n align-items: flex-start;\n gap: 12px;\n padding: 16px 18px 8px;\n}\n.vx-dialog-titles { flex: 1; min-width: 0; }\n.vx-dialog-title {\n margin: 0;\n font-size: var(--dsw-font-m-18-font-size, 16px);\n font-weight: 500;\n line-height: var(--dsw-font-m-18-line-height, 28px);\n color: var(--dsw-alias-label-primary, #1b1b1c);\n}\n.vx-dialog-desc {\n margin: 2px 0 0;\n font-size: var(--dsw-font-xxs-12-font-size, 12px);\n line-height: 18px;\n color: var(--dsw-alias-label-tertiary, #979da6);\n}\n.vx-dialog-body {\n padding: 4px 18px 8px;\n overflow: auto;\n display: flex;\n flex-direction: column;\n gap: 12px;\n scrollbar-width: thin;\n scrollbar-color: var(--dsh-scrollbar-thumb, rgba(0, 0, 0, .2)) transparent;\n}\n.vx-dialog-footer {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n padding: 10px 18px 16px;\n}\n.vx-discard-bar {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 10px;\n border-radius: var(--dsw-radius-sm, 8px);\n background: color-mix(in srgb, var(--dsw-alias-state-warn-primary, #f59e0b) 14%, transparent);\n color: var(--dsw-alias-label-primary, #1b1b1c);\n font-size: var(--dsw-font-xxs-12-font-size, 12px);\n}\n.vx-dialog-text { font-size: var(--dsw-font-xs-13-font-size, 13px); line-height: 20px; }\n/* One shell for every anchored card: a fixed head, exactly one scrolling body\n and a fixed foot. The cards used to set their own paddings, which is how the\n balance card ended up looking like a different surface from the prompt card. */\n.vx-pop-head {\n display: flex;\n flex: 0 0 auto;\n gap: 8px;\n align-items: center;\n padding: 12px 14px 6px;\n font-weight: 500;\n font-size: var(--dsw-font-xs-13-font-size, 13px);\n line-height: var(--dsw-font-xs-13-line-height, 20px);\n}\n.vx-pop-body {\n flex: 1 1 auto;\n min-height: 0;\n overflow: auto;\n padding: 4px 14px 10px;\n scrollbar-width: thin;\n scrollbar-color: var(--dsh-scrollbar-thumb, rgba(0, 0, 0, .2)) transparent;\n}\n.vx-svgbox {\n overflow: auto;\n background: var(--dsw-alias-markdown-code-block, var(--dsw-alias-bg-layer-2, rgba(0, 0, 0, .04)));\n border-radius: var(--dsw-radius-md, 12px);\n padding: 14px;\n}\n.vx-svgbox svg { max-width: 100%; height: auto; }\n\n/* ---------- popovers / panels ---------- */\n.vx-popover {\n position: fixed;\n box-sizing: border-box;\n pointer-events: auto;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n padding: 0;\n scrollbar-width: thin;\n scrollbar-color: var(--dsh-scrollbar-thumb, rgba(0, 0, 0, .2)) transparent;\n}\n.vx-popover[data-state='open'] { animation: vx-pop-in var(--vx-dur-pop) var(--vx-ease-out); }\n.vx-popover[data-state='closed'] { animation: vx-pop-out var(--vx-dur-close) var(--vx-ease-in) forwards; }\n/* A scale animation distorts an SVG backdrop filter's coordinate space. Liquid\n cards slide/fade instead of scaling so the refraction stays aligned while\n the card enters. */\n.vx-liquid .vx-popover[data-state='open'] { animation-name: vx-pop-in-liquid; }\n.vx-liquid .vx-popover[data-state='closed'] { animation-name: vx-pop-out-liquid; }\n/* Card widths stay content-driven; head/body/foot come from the shared shell. */\n.vx-prompt-list { max-height: none; overflow: visible; }\n.vx-pop-search {\n display: flex;\n flex: 0 0 auto;\n align-items: center;\n gap: 6px;\n padding: 0 14px 6px;\n color: var(--dsw-alias-label-tertiary, #979da6);\n}\n.vx-pop-group {\n padding: 6px 2px 2px;\n font-size: var(--dsw-font-xxxs-11-font-size, 11px);\n color: var(--dsw-alias-label-tertiary, #979da6);\n}\n.vx-prompt-row {\n display: flex;\n flex-direction: column;\n gap: 2px;\n width: 100%;\n text-align: left;\n border: none;\n background: transparent;\n color: var(--dsw-alias-label-primary, #1b1b1c);\n font-family: inherit;\n padding: 6px 8px;\n border-radius: var(--dsw-radius-sm, 8px);\n cursor: pointer;\n transition: background-color var(--ds-transition-duration-fast, .1s) var(--vx-ease);\n}\n.vx-prompt-row:hover { background: var(--dsw-alias-interactive-bg-hover, rgba(38, 49, 72, .06)); }\n.vx-prompt-row-name { font-size: var(--dsw-font-xs-13-font-size, 13px); font-weight: 500; }\n.vx-prompt-row-text {\n font-size: var(--dsw-font-xxs-12-font-size, 12px);\n color: var(--dsw-alias-label-secondary, #61666b);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.vx-prompt-row-tags { font-size: var(--dsw-font-xxxs-11-font-size, 11px); color: var(--dsw-alias-label-tertiary, #979da6); }\n.vx-pop-foot {\n display: flex;\n flex: 0 0 auto;\n align-items: center;\n justify-content: flex-end;\n gap: 8px;\n padding: 6px 14px 12px;\n border-top: 1px solid var(--dsw-alias-border-l1, rgba(0, 0, 0, .04));\n}\n/* The usage tables sit in a 380px card; fixed layout keeps six columns from\n pushing the panel into horizontal scroll. */\n.vx-balance-pop .vx-table { table-layout: fixed; }\n.vx-balance-pop .vx-table th,\n.vx-balance-pop .vx-table td {\n padding: 4px 3px;\n font-size: var(--dsw-font-xxxs-11-font-size, 11px);\n white-space: nowrap;\n}\n.vx-balance-pop .vx-table th:first-child,\n.vx-balance-pop .vx-table td:first-child {\n width: 34%;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.vx-balance-pop .vx-table th:not(:first-child),\n.vx-balance-pop .vx-table td:not(:first-child) { text-align: right; }\n.vx-balance-totals {\n font-size: var(--dsw-font-xs-13-font-size, 13px);\n font-weight: 500;\n line-height: var(--dsw-font-xs-13-line-height, 20px);\n}\n.vx-balance-hint { margin-top: 6px; }\n.vx-settings-page { display: flex; flex-direction: column; gap: 16px; max-width: 980px; }\n/* The host settings surface is a side panel, not a full page: a stacked nav\n strip keeps the card at full panel width instead of squeezing it beside a\n rail. */\n.vx-settings-shell { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }\n.vx-settings-nav {\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n gap: 4px;\n padding-bottom: 2px;\n}\n.vx-settings-nav-item {\n text-align: left;\n white-space: nowrap;\n border: none;\n background: transparent;\n color: var(--dsw-alias-label-secondary, #61666b);\n font-family: inherit;\n font-size: var(--dsw-font-xs-13-font-size, 13px);\n border-radius: var(--dsw-radius-sm, 8px);\n padding: 6px 10px;\n cursor: pointer;\n display: flex;\n align-items: center;\n gap: 8px;\n transition: background-color var(--ds-transition-duration-fast, .1s) var(--vx-ease);\n}\n.vx-settings-nav-item:hover { background: var(--dsw-alias-interactive-bg-hover, rgba(38, 49, 72, .06)); }\n.vx-settings-nav-item.on {\n background: var(--dsw-alias-interactive-bg-active, rgba(38, 49, 72, .1));\n color: var(--dsw-alias-label-primary, #1b1b1c);\n font-weight: 500;\n}\n.vx-settings-content { display: flex; flex-direction: column; gap: 14px; min-width: 0; }\n@media (max-width: 760px) {\n .vx-settings-nav { gap: 2px; }\n}\n\n/* ---------- toasts ---------- */\n.vx-toast-stack {\n position: fixed;\n left: 50%;\n bottom: 26px;\n transform: translateX(-50%);\n display: flex;\n flex-direction: column;\n gap: 8px;\n align-items: center;\n pointer-events: auto;\n z-index: 80;\n}\n.vx-toast {\n display: flex;\n gap: 10px;\n align-items: center;\n max-width: min(560px, calc(100vw - 32px));\n padding: 8px 10px 8px 14px;\n border-radius: var(--dsw-radius-md, 12px);\n background: var(--dsw-alias-toast-bg, #353638);\n color: var(--dsw-alias-toast-label, #fff);\n font-size: var(--dsw-font-xxs-12-font-size, 12px);\n box-shadow: var(--dsw-shadow-lv2, 0 4px 12px rgba(0, 0, 0, .12));\n}\n.vx-toast[data-state='open'] { animation: vx-toast-in .22s var(--vx-ease-out); }\n.vx-toast[data-state='closed'] { animation: vx-toast-out .16s var(--vx-ease-in) forwards; }\n.vx-toast-error { background: var(--dsw-alias-state-error-primary, #ec1313); color: var(--dsw-static-neutral-00, #fff); }\n.vx-toast-text { flex: 1; min-width: 0; }\n.vx-toast-action,\n.vx-toast-close {\n border: none;\n background: transparent;\n color: inherit;\n font-family: inherit;\n font-size: inherit;\n cursor: pointer;\n border-radius: var(--dsw-radius-xs, 4px);\n padding: 2px 6px;\n opacity: .8;\n}\n.vx-toast-action { font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }\n.vx-toast-close { font-size: 14px; line-height: 1; padding: 2px 5px; }\n.vx-toast-action:hover,\n.vx-toast-close:hover { opacity: 1; background: rgba(255, 255, 255, .14); }\n\n/* ---------- mermaid ---------- */\n.vx-mmd-wrap {\n position: relative;\n margin: 6px 0;\n border: 1px solid var(--dsw-alias-border-l2, rgba(0, 0, 0, .1));\n border-radius: var(--dsw-radius-md, 12px);\n overflow: hidden;\n background: var(--dsw-alias-markdown-code-block, transparent);\n}\n.vx-mmd-bar {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 4px 6px;\n border-bottom: 1px solid var(--dsw-alias-border-l1, rgba(0, 0, 0, .04));\n background: var(--dsw-alias-markdown-code-block-banner, transparent);\n}\n.vx-mmd-btn {\n border: none;\n background: transparent;\n color: var(--dsw-alias-label-secondary, #61666b);\n font-family: inherit;\n font-size: var(--dsw-font-xxs-12-font-size, 12px);\n padding: 3px 10px;\n border-radius: var(--dsw-radius-sm, 8px);\n cursor: pointer;\n}\n.vx-mmd-btn:hover { background: var(--dsw-alias-interactive-bg-hover, rgba(38, 49, 72, .06)); }\n.vx-mmd-btn.active {\n background: var(--dsw-alias-markdown-code-segment-selected, var(--dsw-alias-interactive-bg-active, rgba(38, 49, 72, .1)));\n color: var(--dsw-alias-label-primary, #1b1b1c);\n font-weight: 500;\n}\n.vx-mmd-live {\n margin-left: auto;\n font-size: var(--dsw-font-xxxs-11-font-size, 11px);\n color: var(--dsw-alias-label-tertiary, #979da6);\n text-decoration: none;\n padding: 3px 8px;\n}\n.vx-mmd-live:hover { color: var(--dsw-alias-label-secondary, #61666b); }\n.vx-mmd-stage { padding: 16px 12px; overflow-x: auto; text-align: center; }\n.vx-mmd-stage svg { max-width: 100%; height: auto; }\n\n/* ---------- motion / focus polish ---------- */\n.vx-section-in {\n display: flex;\n flex-direction: column;\n gap: 14px;\n animation: vx-section-in .22s var(--vx-ease-out);\n}\n.vx-icon-spin { animation: vx-rotate .9s linear infinite; transform-origin: center; }\n.vx-button,\n.vx-icon-button,\n.vx-header-btn,\n.vx-settings-nav-item,\n.vx-prompt-row,\n.vx-list-item {\n outline: none;\n transition-property: background-color, color, border-color, transform, opacity;\n transition-duration: var(--ds-transition-duration-fast, .1s);\n transition-timing-function: var(--vx-ease);\n}\n.vx-button:focus-visible,\n.vx-icon-button:focus-visible,\n.vx-header-btn:focus-visible,\n.vx-settings-nav-item:focus-visible,\n.vx-prompt-row:focus-visible,\n.vx-list-item:focus-visible {\n outline: 2px solid var(--dsw-alias-brand-primary-new-colorprimary-new-color, #4d6bfe);\n outline-offset: 2px;\n}\n.vx-button:active:not(:disabled),\n.vx-icon-button:active:not(:disabled),\n.vx-header-btn:active,\n.vx-settings-nav-item:active,\n.vx-prompt-row:active,\n.vx-list-item:active { transform: scale(.97); }\n\n/* ---------- reduced motion ---------- */\n@media (prefers-reduced-motion: reduce) {\n .vx-root *,\n .vx-settings-page,\n .vx-settings-page *,\n .vx-popover,\n .vx-dialog,\n .vx-dialog-mask,\n .vx-toast,\n .vx-toast-stack {\n animation: none !important;\n transition: none !important;\n transform: none !important;\n }\n}\n";
12
+ export declare const STATIC_CSS: string;
@@ -16,6 +16,7 @@ export interface AppearanceControlsProps {
16
16
  onPreset: (preset: BgFxPreset) => void;
17
17
  onStrength: (strength: BgStrength) => void;
18
18
  onFocus: (on: boolean) => void;
19
+ onLagoonInk: (on: boolean) => void;
19
20
  onParam: (key: BgParamKey, value: number) => void;
20
21
  onRestoreParams: () => void;
21
22
  compact?: boolean;
@@ -16,6 +16,19 @@ export declare function usePresence(open: boolean, exitMs?: number): {
16
16
  mounted: boolean;
17
17
  state: 'open' | 'closed';
18
18
  };
19
+ /** Current plugin theme, provided by the overlay / settings root. `null` means
20
+ * no provider (unit tests or a non-plugin host), so the document is left alone. */
21
+ export declare const PluginThemeContext: React.Context<boolean | null>;
22
+ /** Mirror the plugin theme onto the document that owns a floating surface.
23
+ * Desktop renders plugin popovers and the settings sheet in their own
24
+ * transparent windows; those documents never receive the main window's
25
+ * appearance classes. Without this, the dark material selectors
26
+ * (`:root.vx-dark …`) never match while the host tokens are already dark,
27
+ * which is the light panel + light text combination in the bug report. */
28
+ export declare function applyDocumentTheme(doc: Document | null | undefined, dark: boolean): void;
29
+ /** Apply the context theme to a surface's owner document before paint. The
30
+ * layout effect avoids a one-frame light flash on the first open. */
31
+ export declare function useDocumentTheme(ref: React.RefObject<HTMLElement | null>, active: boolean): void;
19
32
  export interface PopoverProps {
20
33
  open: boolean;
21
34
  anchor: React.RefObject<HTMLElement | null>;
@@ -12,10 +12,12 @@
12
12
  export declare const CUSTOM_PLUGIN_API_PREFIX = "/api/custom-plugin";
13
13
  /** Path the host serves the fetched Mermaid engine at (script src). */
14
14
  export declare const MERMAID_SCRIPT_PATH = "/custom-plugin/mermaid.js";
15
- /** ASCII preset ids; keep in sync with `ASCII_PRESETS` in `client/bg-ascii.ts`. */
16
- export declare const BG_FX_ASCII_PRESETS: readonly ["flow", "rain", "ocean", "whale", "jelly", "starfield", "ripple", "static"];
17
- /** Shader style ids; keep in sync with `SHADER_STYLES` in `client/bg-shader.ts`. */
18
- export declare const BG_FX_SHADER_STYLES: readonly ["liquid", "grain"];
15
+ /** Character-tier scene ids; every one is an open-source `ascii-things`
16
+ * preset. Keep in sync with `SCENE_PRESETS` in `client/bg-scene.ts`. */
17
+ export declare const BG_FX_ASCII_PRESETS: readonly ["sharks", "jellyfish", "robots", "dog", "reef", "night", "turtle", "manta", "dolphin", "seahorse", "hammerhead", "tang", "koi", "starlings", "fireflies", "city", "servers"];
18
+ /** Shader-tier style ids; every one is a Paper Shaders fragment shader.
19
+ * Keep in sync with `SHADER_STYLES` in `client/bg-shader.ts`. */
20
+ export declare const BG_FX_SHADER_STYLES: readonly ["mesh", "smoke", "rays", "dither", "grain", "warp", "swirl", "metaballs", "voronoi", "spiral", "neuro"];
19
21
  /** The `bgFxPreset` value space: one flat string across both renderer tiers.
20
22
  * `normalizeCfg` narrows it to the set that matches the active `bgFx` mode. */
21
23
  export type BgFxPreset = (typeof BG_FX_ASCII_PRESETS)[number] | (typeof BG_FX_SHADER_STYLES)[number];
@@ -31,28 +33,37 @@ export interface CustomPluginConfig {
31
33
  * The removed 'aurora' value migrates to 'default' on load. */
32
34
  bg?: string;
33
35
  /** Animated page-background layer below the content surfaces. `'none'` is
34
- * off; `'ascii'` runs the character renderer; `'shader'` runs the WebGL1
35
- * full-screen fragment renderer (falling back to ASCII without WebGL). Flat
36
- * string on purpose because `normalizeCfg` drops nested values; a Phase 1
37
- * boolean migrates (true → 'ascii', false → 'none'). */
36
+ * off; `'ascii'` runs the character renderer; `'shader'` runs the WebGL2
37
+ * full-screen fragment renderer (falling back to the character tier without
38
+ * WebGL2). The factory default is the calibrated 天青灰 + 鲨群 pair; an
39
+ * explicit `'none'` (or a legacy `false`) stays off. Flat string on purpose
40
+ * because `normalizeCfg` drops nested values; a Phase 1 boolean migrates
41
+ * (true → 'ascii', false → 'none'). */
38
42
  bgFx?: 'none' | 'ascii' | 'shader';
39
- /** Which piece runs in the active tier: the ASCII ids ('flow', 'rain',
40
- * 'ocean', 'starfield', 'ripple', 'static') or the shader ids ('liquid',
41
- * 'grain'). One flat field for both because the two tiers never coexist;
42
- * `normalizeCfg` resets it into the set that matches `bgFx`. Unknown values
43
- * fall back to the tier default (`'flow'` / `'liquid'`). */
43
+ /** Which piece runs in the active tier: the character-tier scene ids
44
+ * ('sharks', 'jellyfish', 'robots', 'dog', 'reef', …) or the shader-tier
45
+ * style ids ('mesh', 'smoke', 'rays', 'dither', 'grain', 'warp', 'swirl',
46
+ * 'metaballs', 'voronoi', 'spiral', 'neuro'). One flat field for
47
+ * both because the two tiers never coexist; `normalizeCfg` resets it into
48
+ * the set that matches `bgFx`. Unknown values fall back to that tier's
49
+ * remembered preset (`bgAsciiPreset` / `bgShaderPreset`). */
44
50
  bgFxPreset?: BgFxPreset;
45
- /** Ink strength: 'soft' | 'standard' | 'strong'. Default 'soft' (the
46
- * calibrated default feel, paired with the ocean preset's 0.6 density).
51
+ /** Last character-tier scene, restored when the user switches back from the
52
+ * shader tier. Normalized into `BG_FX_ASCII_PRESETS`. */
53
+ bgAsciiPreset?: BgFxPreset;
54
+ /** Last shader-tier style, restored when the user switches back from the
55
+ * character tier. Normalized into `BG_FX_SHADER_STYLES`. */
56
+ bgShaderPreset?: BgFxPreset;
57
+ /** Ink strength: 'soft' | 'standard' | 'strong'. Default 'standard' (the
58
+ * calibrated default feel, paired with each preset's authored opacity).
47
59
  * It scales the per-piece ink step only; density, speed and frame rate are
48
- * unaffected. Unknown values fall back to 'soft'. */
60
+ * unaffected. Unknown values fall back to 'standard'. */
49
61
  bgStrength?: BgStrength;
50
62
  /** Background tunable overrides. One flat numeric field per knob because
51
63
  * `normalizeCfg` drops nested values. `BG_PARAM_UNSET` (-1) means "follow
52
64
  * the active preset"; any other value is clamped into that preset's
53
- * declared `ranges` by the renderer and by the panel. The ASCII tier uses
54
- * density/speed/fps/fontPx/opacity, the shader tier uses
55
- * density/speed/fps/intensity. */
65
+ * declared `ranges` by the renderer and by the panel. The character tier
66
+ * uses density/speed/opacity, the shader tier uses speed/intensity/opacity. */
56
67
  bgDensity?: number;
57
68
  bgSpeed?: number;
58
69
  bgFps?: number;
@@ -65,6 +76,11 @@ export interface CustomPluginConfig {
65
76
  * `normalizeCfg` drops nested values; a document without the field is
66
77
  * treated as `true` (the shipped behaviour) with no migration prompt. */
67
78
  bgFocus?: boolean;
79
+ /** Whole-scene duotone for the lagoon paintings ("单色印刷"): when true the
80
+ * authored colour art is grayscaled and composited against the page tint, so
81
+ * it follows the palette instead of staying blue. Ignored by ink/ambient
82
+ * scenes and the shader tier. */
83
+ bgLagoonInk?: boolean;
68
84
  /** Weather overlay: 'none' | 'snow' | 'rain' | 'sakura'. */
69
85
  weather?: string;
70
86
  /** Master glass toggle for the plugin's own surfaces. */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@alexpeng/dsh-custom-plugin",
3
3
  "description": "Custom convenience suite for the dsh web GUI: appearance, folders, prompts, session export/search, Mermaid, usage analytics, local budget, key-free backups, and a Ctrl/Cmd+K command palette; dual-face plugin mounted without dsh source changes.",
4
- "version": "0.11.0",
4
+ "version": "0.13.0",
5
5
  "type": "module",
6
6
  "icon": "./icon.svg",
7
7
  "main": "lib/index.js",
@@ -49,7 +49,7 @@
49
49
  },
50
50
  "packageManager": "pnpm@11.28.5",
51
51
  "scripts": {
52
- "build": "tsc -p tsconfig.build.json && tsdown",
52
+ "build": "node scripts/clean-types.mjs && tsc -p tsconfig.build.json && tsdown",
53
53
  "bundle": "tsdown",
54
54
  "watch": "tsdown --watch",
55
55
  "typecheck": "tsc --noEmit",
@@ -59,6 +59,7 @@
59
59
  "smoke": "node scripts/smoke.mjs",
60
60
  "canary": "node scripts/compat-canary.mjs",
61
61
  "bench:mermaid": "node scripts/mermaid-scan-bench.mjs",
62
+ "bench:glass": "node scripts/glass-visual.mjs",
62
63
  "prepare": "npm run build",
63
64
  "prepublishOnly": "tsc --noEmit && vitest run"
64
65
  },
@@ -80,9 +81,11 @@
80
81
  "@deepseek-ai/dsh-session": "0.2.1-rc.5",
81
82
  "@deepseek-ai/dsh-session-query": "0.2.1-rc.5",
82
83
  "@deepseek-ai/dsh-tools": "0.2.1-rc.5",
84
+ "@paper-design/shaders": "0.0.82",
83
85
  "@types/node": "^22.20.0",
84
86
  "@types/react": "~18.3.1",
85
87
  "@types/react-dom": "^18.3.5",
88
+ "ascii-things": "1.1.1",
86
89
  "puppeteer-core": "^25.8.0",
87
90
  "react": "^18.3.1",
88
91
  "react-dom": "^18.3.1",
@@ -1,44 +0,0 @@
1
- /**
2
- * Balance transport for the DeepSeek account endpoint.
3
- *
4
- * Node's bundled fetch verifies TLS against its own CA set, which does not
5
- * include roots installed in the Windows store by proxy/security software.
6
- * On such machines every balance call dies with `SELF_SIGNED_CERT_IN_CHAIN`
7
- * even though the browser, PowerShell and curl reach the endpoint fine. The
8
- * primary path stays Node fetch; certificate failures fall back to the
9
- * platform curl, which verifies against the system trust store. The API key
10
- * travels through curl's stdin config so it never appears in the process
11
- * command line.
12
- * @module @alexpeng/dsh-custom-plugin/balance
13
- */
14
- export declare const BALANCE_URL = "https://api.deepseek.com/user/balance";
15
- export interface BalanceHttpResult {
16
- /** True only for a 2xx response with a parsed JSON body. */
17
- ok: boolean;
18
- status: number;
19
- json?: unknown;
20
- /** Human-readable failure; the caller may replace it with a key-aware hint. */
21
- error?: string;
22
- transport: 'node' | 'curl';
23
- /** Node/curl error code, for diagnostics. */
24
- causeCode?: string;
25
- }
26
- /** Extract the `cause.code` (or a cert-looking message) from a failed fetch. */
27
- export declare function certificateErrorCode(error: unknown): string;
28
- /** Whether the machine declares an outbound proxy we can only honour via curl. */
29
- export declare function proxyFromEnv(env?: Record<string, string | undefined>): string;
30
- /** Curl config passed on stdin; keeps the bearer token out of argv. */
31
- export declare function curlConfig(url: string, key: string): string;
32
- /** Split curl's `-w` trailer from the response body. */
33
- export declare function parseCurlOutput(stdout: string): {
34
- status: number;
35
- body: string;
36
- };
37
- /**
38
- * Query the balance endpoint. `certificateRetry: false` keeps unit tests and
39
- * callers that must not spawn a process on the Node path.
40
- */
41
- export declare function fetchBalance(key: string, options?: {
42
- timeoutMs?: number;
43
- certificateRetry?: boolean;
44
- }): Promise<BalanceHttpResult>;