BlueGit

timfa filemanager

Publieke URL achter reverse proxy (publicUrl/trustProxy) + link naar Connected apps in gebruikersmenu

timfa Ada · pushed by timfa

Authored 2026-10-24 · 3 weeks ago

Hash
bcfc476dfb904fe70322fa1ac58da0ebde1f5830
Parent
13e7590c
Pipeline
Passed
9 files changed +2071 −1745
.github/tests.md +8 −0
@@ -88,6 +88,14 @@
88 88
89 89 ---
90 90
91 ## `test/public-url.test.js`
92 - `normalizePublicUrl`
93 - `trustProxySetting`
94 - `URLs in OAuth metadata, redirects and OpenAPI`
95 - `Main UI links to the connected apps page`
96
97 ---
98
91 99 ## `test/search-index.test.js`
92 100 - `search index`
93 101
@@ -88,6 +88,14 @@
88
88
89---
89---
90
90
91## `test/public-url.test.js`
92- `normalizePublicUrl`
93- `trustProxySetting`
94- `URLs in OAuth metadata, redirects and OpenAPI`
95- `Main UI links to the connected apps page`
96
97---
98
91## `test/search-index.test.js`
99## `test/search-index.test.js`
92- `search index`
100- `search index`
93
101
docs/api.md +43 −2
@@ -9,7 +9,8 @@ conflict detection.
9 9 - Machine-readable spec: [`docs/openapi.json`](openapi.json). A running
10 10 server also serves it at `/api/v1/openapi.json`.
11 11 - OAuth metadata: `/.well-known/oauth-authorization-server`.
12 - Users manage access on **`/apps.html`** ("Connected apps"). There they
12 - Users manage access on **`/apps.html`** ("Connected apps", also in the
13 user menu of the web UI). There they
13 14 can see every authorised app, device and token, see when each was last
14 15 used, revoke them, and create personal tokens.
15 16
@@ -199,7 +200,47 @@ The limits are in `GET /api/v1/me` and can be set in `config.json` under
199 200 The personal-folder quota (`userFolderSizeLimit`) also applies to the
200 201 API. The change history is kept for 30 days.
201 202
202 ## 6. Example (curl, personal token)
203 ## 6. Server behind a reverse proxy (for the server admin)
204
205 The URLs in the OAuth metadata, the `iss` parameter, the consent page and
206 the OpenAPI spec (`servers`, `authorizationUrl`, `tokenUrl`) use the
207 server's public address. You set it in `config.json`:
208
209 ```json
210 {
211 "publicUrl": "https://files.example.com",
212 "trustProxy": "loopback"
213 }
214 ```
215
216 - **`publicUrl`** is optional. When set, it always wins. A path prefix is
217 allowed, for example `https://example.com/files`. Query strings,
218 fragments and credentials are refused, and an invalid value is ignored.
219 - **`trustProxy`** is used when `publicUrl` is not set. It is the Express
220 `trust proxy` setting and decides from which addresses
221 `X-Forwarded-Proto`, `X-Forwarded-Host` and `X-Forwarded-For` are
222 believed. The default is `"loopback"`, which only trusts a proxy on the
223 same machine. Other values:
224 - `false`: never trust them.
225 - A number of hops.
226 - An IP address or subnet list, for example `"10.0.0.0/8, loopback"`.
227
228 This setting also determines the client IP that sessions and the login
229 rate limit see.
230
231 The proxy has to pass on `X-Forwarded-Proto: https` and, if the host
232 differs, `X-Forwarded-Host`. In nginx:
233
234 ```nginx
235 proxy_set_header Host $host;
236 proxy_set_header X-Forwarded-Proto $scheme;
237 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
238 ```
239
240 `trustProxy` is read at startup, while `publicUrl` takes effect
241 immediately.
242
243 ## 7. Example (curl, personal token)
203 244
204 245 ```bash
205 246 T=fmp_...; H="Authorization: Bearer $T"; S=https://files.example.com/api/v1
@@ -9,7 +9,8 @@ conflict detection.
9- Machine-readable spec: [`docs/openapi.json`](openapi.json). A running
9- Machine-readable spec: [`docs/openapi.json`](openapi.json). A running
10 server also serves it at `/api/v1/openapi.json`.
10 server also serves it at `/api/v1/openapi.json`.
11- OAuth metadata: `/.well-known/oauth-authorization-server`.
11- OAuth metadata: `/.well-known/oauth-authorization-server`.
12- Users manage access on **`/apps.html`** ("Connected apps"). There they
12- Users manage access on **`/apps.html`** ("Connected apps", also in the
13 user menu of the web UI). There they
13 can see every authorised app, device and token, see when each was last
14 can see every authorised app, device and token, see when each was last
14 used, revoke them, and create personal tokens.
15 used, revoke them, and create personal tokens.
15
16
@@ -199,7 +200,47 @@ The limits are in `GET /api/v1/me` and can be set in `config.json` under
199The personal-folder quota (`userFolderSizeLimit`) also applies to the
200The personal-folder quota (`userFolderSizeLimit`) also applies to the
200API. The change history is kept for 30 days.
201API. The change history is kept for 30 days.
201
202
202## 6. Example (curl, personal token)
203## 6. Server behind a reverse proxy (for the server admin)
204
205The URLs in the OAuth metadata, the `iss` parameter, the consent page and
206the OpenAPI spec (`servers`, `authorizationUrl`, `tokenUrl`) use the
207server's public address. You set it in `config.json`:
208
209```json
210{
211 "publicUrl": "https://files.example.com",
212 "trustProxy": "loopback"
213}
214```
215
216- **`publicUrl`** is optional. When set, it always wins. A path prefix is
217 allowed, for example `https://example.com/files`. Query strings,
218 fragments and credentials are refused, and an invalid value is ignored.
219- **`trustProxy`** is used when `publicUrl` is not set. It is the Express
220 `trust proxy` setting and decides from which addresses
221 `X-Forwarded-Proto`, `X-Forwarded-Host` and `X-Forwarded-For` are
222 believed. The default is `"loopback"`, which only trusts a proxy on the
223 same machine. Other values:
224 - `false`: never trust them.
225 - A number of hops.
226 - An IP address or subnet list, for example `"10.0.0.0/8, loopback"`.
227
228 This setting also determines the client IP that sessions and the login
229 rate limit see.
230
231The proxy has to pass on `X-Forwarded-Proto: https` and, if the host
232differs, `X-Forwarded-Host`. In nginx:
233
234```nginx
235proxy_set_header Host $host;
236proxy_set_header X-Forwarded-Proto $scheme;
237proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
238```
239
240`trustProxy` is read at startup, while `publicUrl` takes effect
241immediately.
242
243## 7. Example (curl, personal token)
203
244
204```bash
245```bash
205T=fmp_...; H="Authorization: Bearer $T"; S=https://files.example.com/api/v1
246T=fmp_...; H="Authorization: Bearer $T"; S=https://files.example.com/api/v1
public/index.html +9 −0
@@ -126,6 +126,15 @@
126 126 </svg>
127 127 Change Password
128 128 </button>
129 <a id="btn-connected-apps" class="topbar-menu-item" href="/apps.html" role="menuitem"
130 title="Connected apps &amp; API access" aria-label="Connected apps and API access">
131 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
132 stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
133 <rect x="5" y="2" width="14" height="20" rx="2" ry="2" />
134 <line x1="12" y1="18" x2="12.01" y2="18" />
135 </svg>
136 Connected apps
137 </a>
129 138 <button id="btn-logout" class="topbar-menu-item" type="button" role="menuitem" title="Sign out"
130 139 aria-label="Sign out">
131 140 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
@@ -126,6 +126,15 @@
126 </svg>
126 </svg>
127 Change Password
127 Change Password
128 </button>
128 </button>
129 <a id="btn-connected-apps" class="topbar-menu-item" href="/apps.html" role="menuitem"
130 title="Connected apps &amp; API access" aria-label="Connected apps and API access">
131 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
132 stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
133 <rect x="5" y="2" width="14" height="20" rx="2" ry="2" />
134 <line x1="12" y1="18" x2="12.01" y2="18" />
135 </svg>
136 Connected apps
137 </a>
129 <button id="btn-logout" class="topbar-menu-item" type="button" role="menuitem" title="Sign out"
138 <button id="btn-logout" class="topbar-menu-item" type="button" role="menuitem" title="Sign out"
130 aria-label="Sign out">
139 aria-label="Sign out">
131 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
140 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
public/style.css +1741 −1734
@@ -1,1566 +1,1573 @@
1 /* =========================================================
2 RESET & CUSTOM PROPERTIES
3 ========================================================= */
4 *,
5 *::before,
6 *::after {
7 box-sizing: border-box;
8 margin: 0;
9 padding: 0;
10 }
11
12 :root {
13 --bg: #0f1117;
14 --surface: #1a1d27;
15 --surface2: #21242f;
16 --border: #2e3247;
17 --accent: #5b7fff;
18 --accent-hover: #7b9fff;
19 --text: #e8eaf0;
20 --text-muted: #7880a0;
21 --danger: #e05c6e;
22 --success: #3fcf8e;
23 --radius: 10px;
24 --topbar-h: 56px;
25 --sidebar-w: 300px;
26 --transition: 0.18s ease;
27 }
28
29 html,
30 body {
31 height: 100%;
32 font-family: system-ui, -apple-system, sans-serif;
33 }
34
35 body {
36 background: var(--bg);
37 color: var(--text);
38 overflow: hidden;
39 }
40
41 .hidden {
42 display: none !important;
43 }
44
45 .muted {
46 color: var(--text-muted);
47 }
48
49 .error {
50 color: var(--danger);
51 font-size: 0.85rem;
52 margin-top: 0.3rem;
53 }
54
55 /* =========================================================
56 AUTH OVERLAY
57 ========================================================= */
58 .overlay {
59 position: fixed;
60 inset: 0;
61 background: var(--bg);
62 display: flex;
63 align-items: center;
64 justify-content: center;
65 z-index: 100;
66 }
67
68 .auth-card {
69 background: var(--surface);
70 border: 1px solid var(--border);
71 border-radius: var(--radius);
72 padding: 2.5rem 2rem;
73 width: min(420px, 92vw);
74 }
75
76 .auth-card h1 {
77 font-size: 1.6rem;
78 margin-bottom: 0.5rem;
79 }
80
81 .auth-subtitle {
82 font-size: 0.88rem;
83 color: var(--text-muted);
84 margin-bottom: 1.2rem;
85 }
86
87 #auth-form label {
88 display: flex;
89 flex-direction: column;
90 gap: 0.3rem;
91 font-size: 0.85rem;
92 color: var(--text-muted);
93 margin-bottom: 1rem;
94 }
95
96 #auth-form input {
97 background: var(--bg);
98 border: 1px solid var(--border);
99 border-radius: 6px;
100 padding: 0.55rem 0.75rem;
101 color: var(--text);
102 font-size: 1rem;
103 outline: none;
104 transition: border-color var(--transition);
105 }
106
107 #auth-form input:focus {
108 border-color: var(--accent);
109 }
110
111 /* =========================================================
112 BUTTONS
113 ========================================================= */
114 button {
115 cursor: pointer;
116 border: none;
117 border-radius: 6px;
118 font-size: 0.9rem;
119 transition: background var(--transition), color var(--transition);
120 }
121
122 .icon-btn {
123 display: flex;
124 align-items: center;
125 gap: 0.4rem;
126 background: transparent;
127 color: var(--text-muted);
128 padding: 0.4rem 0.7rem;
129 border-radius: 6px;
130 position: relative;
131 }
132
133 .icon-btn:hover {
134 background: var(--surface2);
135 color: var(--text);
136 }
137
138 .icon-btn svg {
139 width: 18px;
140 height: 18px;
141 }
142
143 .topbar-badge {
144 position: absolute;
145 top: -0.25rem;
146 right: -0.3rem;
147 min-width: 1.1rem;
148 height: 1.1rem;
149 padding: 0 0.28rem;
150 border-radius: 999px;
151 background: #d33131;
152 color: #fff;
153 font-size: 0.68rem;
154 font-weight: 700;
155 line-height: 1.1rem;
156 text-align: center;
157 border: 1px solid var(--surface);
158 }
159
160 button[type="submit"],
161 .primary {
162 background: var(--accent);
163 color: #fff;
164 padding: 0.55rem 1.2rem;
165 font-weight: 600;
166 width: 100%;
167 margin-top: 0.5rem;
168 }
169
170 button[type="submit"]:hover,
171 .primary:hover {
172 background: var(--accent-hover);
173 }
174
175 button.danger {
176 background: var(--surface2);
177 color: var(--danger);
178 padding: 0.55rem 1.2rem;
179 width: 100%;
180 margin-top: 0.5rem;
181 }
182
183 button.danger:hover {
184 background: var(--border);
185 }
186
187 button:disabled,
188 input:disabled,
189 select:disabled {
190 opacity: 0.55;
191 cursor: not-allowed;
192 }
193
194 button.danger.admin-update-highlight {
195 animation: admin-update-pulse 0.9s ease-in-out 2;
196 }
197
198 @keyframes admin-update-pulse {
199 0% {
200 box-shadow: 0 0 0 0 rgba(211, 49, 49, 0.55);
201 transform: scale(1);
202 }
203
204 50% {
205 box-shadow: 0 0 0 10px rgba(211, 49, 49, 0);
206 transform: scale(1.02);
207 }
208
209 100% {
210 box-shadow: 0 0 0 0 rgba(211, 49, 49, 0);
211 transform: scale(1);
212 }
213 }
214
215 /* =========================================================
216 TOP BAR
217 ========================================================= */
218 #app {
219 display: flex;
220 flex-direction: column;
221 height: 100vh;
222 }
223
224 #topbar {
225 height: var(--topbar-h);
226 background: var(--surface);
227 border-bottom: 1px solid var(--border);
228 display: flex;
229 align-items: center;
230 padding: 0 1rem;
231 gap: 0.5rem;
232 flex-shrink: 0;
233 }
234
235 #topbar>#btn-refresh {
236 flex: 0 0 auto;
237 }
238
239 #breadcrumb-wrap {
240 flex: 1;
241 min-width: 0;
242 }
243
244 #breadcrumb {
245 display: flex;
246 align-items: center;
247 flex-wrap: wrap;
248 gap: 0.1rem;
249 font-size: 0.9rem;
250 white-space: nowrap;
251 overflow: hidden;
252 }
253
254 #breadcrumb .crumb {
255 color: var(--text-muted);
256 background: none;
257 padding: 0.2rem 0.35rem;
258 border-radius: 4px;
259 text-decoration: none;
260 cursor: pointer;
261 }
262
263 #breadcrumb .crumb:hover {
264 color: var(--text);
265 background: var(--surface2);
266 }
267
268 #breadcrumb .crumb.active {
269 color: var(--text);
270 cursor: default;
271 }
272
273 #breadcrumb .sep {
274 color: var(--border);
275 user-select: none;
276 }
277
278 #topbar-actions {
279 display: flex;
280 align-items: center;
281 gap: 0.25rem;
282 flex-shrink: 0;
283 position: relative;
284 }
285
286 .topbar-dropdown {
287 position: relative;
288 }
289
290 .topbar-dropdown-menu {
291 position: absolute;
292 top: calc(100% + 0.4rem);
293 left: 0;
294 min-width: 180px;
295 background: var(--surface);
296 border: 1px solid var(--border);
297 border-radius: var(--radius);
298 box-shadow: 0 12px 22px rgba(0, 0, 0, 0.28);
299 padding: 0.35rem;
300 z-index: 140;
301 display: none;
302 }
303
304 .topbar-dropdown-menu--right {
305 left: auto;
306 right: 0;
307 }
308
309 .topbar-dropdown.open .topbar-dropdown-menu {
310 display: flex;
311 flex-direction: column;
312 gap: 0.2rem;
313 }
314
315 .topbar-menu-item {
316 display: flex;
317 align-items: center;
318 gap: 0.48rem;
319 width: 100%;
320 background: transparent;
321 color: var(--text-muted);
322 border-radius: 6px;
323 padding: 0.45rem 0.55rem;
324 text-align: left;
325 position: relative;
326 }
327
328 .topbar-menu-item svg {
329 width: 16px;
330 height: 16px;
331 flex: 0 0 auto;
332 }
333
334 .topbar-menu-item:hover {
335 background: var(--surface2);
336 color: var(--text);
337 }
338
339 .topbar-menu-item .topbar-badge {
340 top: -0.24rem;
341 right: -0.22rem;
342 }
343
344 .top-search {
345 display: flex;
346 align-items: center;
347 gap: 0.35rem;
348 margin-right: 0.2rem;
349 }
350
351 .top-search input {
352 width: min(34vw, 300px);
353 min-width: 150px;
354 background: var(--bg);
355 border: 1px solid var(--border);
356 border-radius: 6px;
357 color: var(--text);
358 font-size: 0.88rem;
359 padding: 0.42rem 0.6rem;
360 outline: none;
361 }
362
363 .top-search input:focus {
364 border-color: var(--accent);
365 }
366
367 #btn-search {
368 padding: 0.36rem 0.62rem;
369 }
370
371 .global-favicon-preview {
372 width: 18px;
373 height: 18px;
374 display: inline-flex;
375 align-items: center;
376 justify-content: center;
377 border-radius: 4px;
378 overflow: hidden;
379 color: #fff;
380 }
381
382 .global-favicon-preview svg,
383 .global-favicon-preview img {
384 width: 100%;
385 height: 100%;
386 display: block;
387 object-fit: cover;
388 }
389
390 .icon-btn.icon-only {
391 width: 2rem;
392 height: 2rem;
393 padding: 0;
394 justify-content: center;
395 }
396
397 /* =========================================================
398 MAIN + SIDEBAR LAYOUT
399 ========================================================= */
400 #main-content {
401 flex: 1;
402 overflow-y: auto;
403 padding: 1.25rem;
404 position: relative;
405 }
406
407 #folder-stats {
408 margin-bottom: 0.8rem;
409 font-size: 0.85rem;
410 }
411
412 /* Drop overlay */
413 #drop-overlay {
414 position: absolute;
415 inset: 0;
416 background: rgba(91, 127, 255, 0.12);
417 border: 3px dashed var(--accent);
418 border-radius: var(--radius);
419 display: flex;
420 align-items: center;
421 justify-content: center;
422 z-index: 10;
423 font-size: 1.4rem;
424 color: var(--accent);
425 pointer-events: none;
426 }
427
428 /* When sidebar is open, shrink main content */
429 #app.sidebar-open #main-content {
430 margin-right: var(--sidebar-w);
431 }
432
433 /* =========================================================
434 FILE GRID
435 ========================================================= */
436 #file-grid {
437 display: grid;
438 grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
439 gap: 0.75rem;
440 }
441
442 .file-group-separator {
443 grid-column: 1 / -1;
444 display: flex;
445 align-items: center;
446 gap: 0.55rem;
447 margin-top: 0.1rem;
448 margin-bottom: 0.1rem;
449 color: var(--text-muted);
450 font-size: 0.76rem;
451 letter-spacing: 0.02em;
452 }
453
454 .file-group-separator::before,
455 .file-group-separator::after {
456 content: '';
457 height: 1px;
458 background: var(--border);
459 flex: 1;
460 }
461
462 .file-group-separator span {
463 padding: 0.12rem 0.45rem;
464 border: 1px solid var(--border);
465 border-radius: 999px;
466 background: rgba(255, 255, 255, 0.02);
467 white-space: nowrap;
468 }
469
470 .file-item {
471 display: flex;
472 flex-direction: column;
473 align-items: center;
474 padding: 0.9rem 0.5rem 0.7rem;
475 border-radius: var(--radius);
476 border: 1px solid transparent;
477 cursor: pointer;
478 user-select: none;
479 transition: background var(--transition), border-color var(--transition);
480 text-align: center;
481 gap: 0.4rem;
482 position: relative;
483 touch-action: manipulation;
484 }
485
486 .file-item:hover {
487 background: var(--surface);
488 border-color: var(--border);
489 }
490
491 .file-item.file-item--preview-placeholder {
492 visibility: hidden;
493 pointer-events: none;
494 }
495
496 .file-item.selected {
497 background: var(--surface2);
498 border-color: var(--accent);
499 }
500
501 .file-item .icon {
502 width: 52px;
503 height: 52px;
504 display: flex;
505 align-items: center;
506 justify-content: center;
507 position: relative;
508 }
509
510 .file-item .icon.thumb-pending::after {
511 content: '';
512 position: absolute;
513 width: 14px;
514 height: 14px;
515 left: 50%;
516 top: 50%;
517 border: 2px solid rgba(232, 234, 240, 0.35);
518 border-top-color: var(--accent);
519 border-radius: 50%;
520 animation: icon-thumb-spin 0.75s linear infinite;
521 background: rgba(15, 17, 23, 0.85);
522 }
523
524 @keyframes icon-thumb-spin {
525 from {
526 transform: translate(-50%, -50%) rotate(0deg);
527 }
528
529 to {
530 transform: translate(-50%, -50%) rotate(360deg);
531 }
532 }
533
534 .file-item .icon svg {
535 width: 100%;
536 height: 100%;
537 }
538
539 .file-item .icon .watched-overlay {
540 position: absolute;
541 left: 50%;
542 top: 50%;
543 width: 28px;
544 height: 28px;
545 transform: translate(-50%, -50%);
546 display: flex;
547 align-items: center;
548 justify-content: center;
549 pointer-events: none;
550 border-radius: 50%;
551 background: rgba(15, 17, 23, 0.45);
552 }
553
554 .file-item .icon .watched-overlay--partway {
555 width: 16.8px;
556 height: 16.8px;
557 }
558
559 .file-item .icon .watched-overlay--partway path {
560 fill: #8f98a5;
561 }
562
563 .file-item .icon .watched-overlay-svg {
564 width: 100%;
565 height: 100%;
566 }
567
568 .file-item .name {
569 font-size: 0.8rem;
570 word-break: normal;
571 overflow-wrap: anywhere;
572 max-width: 100%;
573 line-height: 1.3;
574 color: var(--text);
575 white-space: normal;
576 overflow: hidden;
577 text-overflow: ellipsis;
578 max-height: calc(1.3em * 4);
579 display: -webkit-box;
580 -webkit-box-orient: vertical;
581 -webkit-line-clamp: 4;
582 line-clamp: 4;
583 }
584
585 /* =========================================================
586 SIDEBAR
587 ========================================================= */
588 #sidebar {
589 position: fixed;
590 top: var(--topbar-h);
591 right: 0;
592 bottom: 0;
593 width: var(--sidebar-w);
594 background: var(--surface);
595 border-left: 1px solid var(--border);
596 padding: 1.25rem;
597 overflow-y: auto;
598 z-index: 20;
599 display: flex;
600 flex-direction: column;
601 gap: 0.75rem;
602 }
603
604 #sidebar-close {
605 display: none;
606 align-items: center;
607 justify-content: center;
608 width: 1.7rem;
609 height: 1.7rem;
610 border: 1px solid transparent;
611 border-radius: 999px;
612 background: transparent;
613 color: var(--text-muted);
614 font-size: 1rem;
615 line-height: 1;
616 }
617
618 #sidebar-close:hover {
619 background: var(--surface2);
620 color: var(--text);
621 }
622
623 #sidebar-icon {
624 display: flex;
625 justify-content: center;
626 }
627
628 #sidebar-icon svg {
629 width: 64px;
630 height: 64px;
631 }
632
633 #sidebar-name {
634 font-size: 1rem;
635 word-break: break-all;
636 text-align: center;
637 }
638
639 #sidebar-meta {
640 display: grid;
641 grid-template-columns: auto 1fr;
642 gap: 0.3rem 0.75rem;
643 }
644
645 #sidebar-meta dt {
646 color: var(--text-muted);
647 font-size: 0.8rem;
648 font-weight: 600;
649 }
650
651 #sidebar-meta dd {
652 font-size: 0.8rem;
653 word-break: break-all;
654 }
655
656 #sidebar-meta .root-access-list {
657 margin: 0;
658 padding-left: 1rem;
659 }
660
661 #sidebar-meta .root-access-list li {
662 margin: 0.12rem 0;
663 }
664
665 #sidebar-actions {
666 display: flex;
667 flex-direction: column;
668 gap: 0.5rem;
669 margin-top: 0.5rem;
670 }
671
672 #sidebar-actions button {
673 background: var(--surface2);
674 color: var(--text);
675 padding: 0.5rem 0.8rem;
676 text-align: left;
677 }
678
679 #sidebar-actions button:hover {
680 background: var(--border);
681 }
682
683 #sidebar-actions button.danger {
684 color: var(--danger);
685 }
686
687 .sidebar-view-options {
688 display: flex;
689 flex-direction: column;
690 gap: 0.5rem;
691 border-top: 1px solid var(--border);
692 padding-top: 0.7rem;
693 margin-top: 0.2rem;
694 }
695
696 .sidebar-view-options h3 {
697 margin: 0;
698 font-size: 0.82rem;
699 color: var(--text-muted);
700 text-transform: uppercase;
701 letter-spacing: 0.04em;
702 }
703
704 .sidebar-view-option-label {
705 display: flex;
706 flex-direction: column;
707 gap: 0.28rem;
708 font-size: 0.8rem;
709 color: var(--text-muted);
710 }
711
712 .sidebar-view-option-control {
713 width: 100%;
714 background: var(--surface2);
715 border: 1px solid var(--border);
716 border-radius: var(--radius);
717 color: var(--text);
718 padding: 0.42rem 0.5rem;
719 }
720
721 .sidebar-view-toggle {
722 display: flex;
723 align-items: center;
724 gap: 0.45rem;
725 font-size: 0.8rem;
726 color: var(--text);
727 }
728
729 .custom-context-menu {
730 position: fixed;
731 min-width: 220px;
732 max-width: min(320px, calc(100vw - 12px));
733 background: var(--surface);
734 border: 1px solid var(--border);
735 border-radius: var(--radius);
736 box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
737 padding: 0.35rem;
738 z-index: 12000;
739 }
740
741 .custom-context-menu button,
742 .custom-context-menu .custom-context-menu-item {
743 display: flex;
744 align-items: center;
745 justify-content: space-between;
746 width: 100%;
747 background: transparent;
748 color: var(--text);
749 padding: 0.45rem 0.55rem;
750 text-align: left;
751 border-radius: 6px;
752 }
753
754 .custom-context-menu button:hover,
755 .custom-context-menu .custom-context-menu-item:hover {
756 background: var(--surface2);
757 }
758
759 .custom-context-menu button.danger,
760 .custom-context-menu .custom-context-menu-item.danger {
761 color: var(--danger);
762 }
763
764 .custom-context-menu-separator {
765 height: 1px;
766 background: var(--border);
767 margin: 0.32rem 0;
768 }
769
770 .custom-context-menu-row {
771 position: relative;
772 }
773
774 .custom-context-submenu {
775 position: absolute;
776 top: 0;
777 left: calc(100% + 0.3rem);
778 min-width: 210px;
779 background: var(--surface);
780 border: 1px solid var(--border);
781 border-radius: var(--radius);
782 box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
783 padding: 0.35rem;
784 display: none;
785 }
786
787 .custom-context-menu-row:hover>.custom-context-submenu,
788 .custom-context-menu-row:focus-within>.custom-context-submenu {
789 display: block;
790 }
791
792 /* ─── Duplicates panel ─────────────────────────────────── */
793 #sidebar-duplicates {
794 margin-top: 1rem;
795 border-top: 1px solid var(--border);
796 padding-top: 0.75rem;
797 }
798
799 .sidebar-duplicates-heading {
800 font-size: 0.75rem;
801 font-weight: 600;
802 text-transform: uppercase;
803 letter-spacing: 0.05em;
804 color: var(--text-muted, #888);
805 margin: 0 0 0.4rem;
806 }
807
808 .sidebar-duplicates-list {
809 list-style: none;
810 margin: 0;
811 padding: 0;
812 display: flex;
813 flex-direction: column;
814 gap: 0.25rem;
815 }
816
817 .sidebar-duplicate-entry {
818 display: block;
819 width: 100%;
820 background: var(--surface2);
821 color: var(--text);
822 padding: 0.35rem 0.6rem;
823 text-align: left;
824 font-size: 0.8rem;
825 white-space: nowrap;
826 overflow: hidden;
827 text-overflow: ellipsis;
828 border-radius: var(--radius);
829 cursor: pointer;
830 }
831
832 .sidebar-duplicate-entry:hover {
833 background: var(--border);
834 }
835
836 .admin-size-feedback {
837 font-size: 0.82rem;
838 margin: 0.25rem 0 0.5rem;
839 padding: 0.25rem 0.5rem;
840 border-radius: var(--radius);
841 }
842
843 .admin-size-feedback.ok {
844 color: var(--accent);
845 }
846
847 .admin-size-feedback.err {
848 color: #e55;
849 }
850
851 /* =========================================================
852 MODALS
853 ========================================================= */
854 .modal-overlay {
855 position: fixed;
856 inset: 0;
857 background: rgba(0, 0, 0, 0.65);
858 display: flex;
859 align-items: center;
860 justify-content: center;
861 z-index: 11000;
862 }
863
864 #file-conflict-modal,
865 #overwrite-modal {
866 z-index: 11150;
867 }
868
869 .modal {
870 background: var(--surface);
871 border: 1px solid var(--border);
872 border-radius: var(--radius);
873 padding: 2rem;
874 width: min(560px, 94vw);
875 max-height: 90vh;
876 overflow-y: auto;
877 position: relative;
878 }
879
880 .modal.small {
881 width: min(340px, 94vw);
882 }
883
884 #confirm-modal .modal.confirm-modal-wide {
885 width: min(760px, 94vw);
886 }
887
888 .modal h2 {
889 font-size: 1.3rem;
890 margin-bottom: 1.25rem;
891 }
892
893 .modal h3 {
894 font-size: 1rem;
895 color: var(--text-muted);
896 margin: 1rem 0 0.5rem;
897 }
898
899 .modal-close {
900 position: absolute;
901 top: 0.75rem;
902 right: 0.75rem;
903 background: none;
904 color: var(--text-muted);
905 font-size: 1.1rem;
906 padding: 0.25rem 0.5rem;
907 }
908
909 .modal-close:hover {
910 color: var(--text);
911 }
912
913 .update-commit-list {
914 max-height: min(48vh, 420px);
915 overflow: auto;
916 border: 1px solid var(--border);
917 border-radius: 10px;
918 background: var(--bg);
919 padding: 0.6rem 0.8rem;
920 }
921
922 .update-commit-item+.update-commit-item {
923 margin-top: 0.9rem;
924 padding-top: 0.9rem;
925 border-top: 1px solid var(--border);
926 }
927
928 .update-commit-item h3 {
929 margin: 0;
930 font-size: 1.06rem;
931 font-weight: 700;
932 color: var(--text);
933 }
934
935 .update-commit-hash {
936 color: var(--text-muted);
937 font-weight: 600;
938 font-size: 0.9rem;
939 }
940
941 .update-commit-subject {
942 color: var(--text);
943 }
944
945 .update-commit-body {
946 margin: 0.45rem 0 0;
947 font-size: 0.94rem;
948 color: var(--text-muted);
949 line-height: 1.45;
950 }
951
952 /* =========================================================
953 FOLDER ICON PICKER
954 ========================================================= */
955 .folder-icon-modal {
956 width: min(680px, 94vw);
957 max-height: 90vh;
958 display: flex;
959 flex-direction: column;
960 gap: 0.75rem;
961 overflow: hidden;
962 }
963
964 .folder-icon-grid {
965 display: grid;
966 grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
967 gap: 0.5rem;
968 max-height: 50vh;
969 overflow-y: auto;
970 padding: 0.25rem;
971 background: var(--bg);
972 border: 1px solid var(--border);
973 border-radius: var(--radius);
974 }
975
976 .folder-icon-filter {
977 width: 100%;
978 background: var(--bg);
979 border: 1px solid var(--border);
980 border-radius: 6px;
981 color: var(--text);
982 font-size: 0.9rem;
983 padding: 0.48rem 0.68rem;
984 outline: none;
985 }
986
987 .folder-icon-filter:focus {
988 border-color: var(--accent);
989 }
990
991 .debug-modal {
992 width: min(980px, 96vw);
993 max-height: 92vh;
994 }
995
996 .debug-toolbar {
997 display: flex;
998 justify-content: space-between;
999 align-items: center;
1000 gap: 0.8rem;
1001 margin: 0.75rem 0 1rem;
1002 }
1003
1004 .debug-section-head {
1005 display: flex;
1006 align-items: center;
1007 justify-content: space-between;
1008 gap: 0.8rem;
1009 }
1010
1011 .debug-copy-btn {
1012 padding: 0.3rem 0.55rem;
1013 border-radius: 7px;
1014 font-size: 0.78rem;
1015 border: 1px solid var(--border);
1016 background: var(--bg);
1017 color: var(--text-muted);
1018 }
1019
1020 .debug-copy-btn:hover {
1021 color: var(--text);
1022 border-color: var(--accent);
1023 }
1024
1025 .debug-summary-grid {
1026 display: grid;
1027 grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
1028 gap: 0.6rem;
1029 margin-bottom: 0.8rem;
1030 }
1031
1032 .debug-summary-item {
1033 background: var(--bg);
1034 border: 1px solid var(--border);
1035 border-radius: 10px;
1036 padding: 0.55rem 0.7rem;
1037 }
1038
1039 .debug-summary-item .k {
1040 display: block;
1041 color: var(--text-muted);
1042 font-size: 0.82rem;
1043 }
1044
1045 .debug-summary-item .v {
1046 display: block;
1047 color: var(--text);
1048 font-weight: 650;
1049 margin-top: 0.12rem;
1050 }
1051
1052 .debug-chips {
1053 display: flex;
1054 flex-wrap: wrap;
1055 gap: 0.45rem;
1056 }
1057
1058 .debug-chip {
1059 border: 1px solid var(--border);
1060 border-radius: 999px;
1061 padding: 0.22rem 0.6rem;
1062 background: var(--bg);
1063 font-size: 0.82rem;
1064 }
1065
1066 .debug-table-wrap {
1067 border: 1px solid var(--border);
1068 border-radius: 10px;
1069 overflow: auto;
1070 background: var(--bg);
1071 }
1072
1073 .debug-table {
1074 width: 100%;
1075 border-collapse: collapse;
1076 font-size: 0.85rem;
1077 }
1078
1079 .debug-table th,
1080 .debug-table td {
1081 border-bottom: 1px solid var(--border);
1082 text-align: left;
1083 vertical-align: top;
1084 padding: 0.45rem 0.55rem;
1085 }
1086
1087 .debug-table thead th {
1088 position: sticky;
1089 top: 0;
1090 z-index: 1;
1091 background: var(--surface);
1092 }
1093
1094 .debug-table tr:last-child td {
1095 border-bottom: 0;
1096 }
1097
1098 .debug-path {
1099 font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
1100 word-break: break-word;
1101 }
1102
1103 .folder-icon-cell {
1104 display: flex;
1105 flex-direction: column;
1106 align-items: center;
1107 gap: 0.3rem;
1108 padding: 0.4rem;
1109 border-radius: var(--radius);
1110 border: 2px solid transparent;
1111 cursor: pointer;
1112 transition: border-color var(--transition), background var(--transition);
1113 }
1114
1115 .folder-icon-cell:hover {
1116 background: var(--surface2);
1117 }
1118
1119 .folder-icon-cell.selected {
1120 border-color: var(--accent);
1121 background: rgba(91, 127, 255, 0.12);
1122 }
1123
1124 .folder-icon-thumb {
1125 width: 60px;
1126 height: 60px;
1127 object-fit: cover;
1128 border-radius: 4px;
1129 background: var(--surface2);
1130 }
1131
1132 .folder-icon-label {
1133 font-size: 0.68rem;
1134 color: var(--text-muted);
1135 word-break: break-all;
1136 text-align: center;
1137 max-width: 72px;
1138 overflow: hidden;
1139 display: -webkit-box;
1140 -webkit-line-clamp: 2;
1141 -webkit-box-orient: vertical;
1142 }
1143
1144 .vjs-text-track-cue>div {
1145 background: transparent !important;
1146 text-shadow: 2px 0 black, -2px 0 black, 0 2px black, 0 -2px black,
1147 1px 1px black, -1px -1px black, 1px -1px black, -1px 1px black;
1148 }
1149
1150 /* Admin path list */
1151 .path-row {
1152 display: flex;
1153 align-items: center;
1154 gap: 0.5rem;
1155 padding: 0.4rem 0;
1156 border-bottom: 1px solid var(--border);
1157 font-size: 0.88rem;
1158 }
1159
1160 .path-row span {
1161 flex: 1;
1162 word-break: break-all;
1163 }
1164
1165 .path-row button {
1166 background: none;
1167 color: var(--danger);
1168 padding: 0.2rem 0.5rem;
1169 }
1170
1171 .path-add-row {
1172 display: flex;
1173 gap: 0.5rem;
1174 margin: 0.5rem 0;
1175 }
1176
1177 .path-add-row input {
1178 flex: 1;
1179 background: var(--bg);
1180 border: 1px solid var(--border);
1181 border-radius: 6px;
1182 padding: 0.45rem 0.7rem;
1183 color: var(--text);
1184 font-size: 0.9rem;
1185 outline: none;
1186 }
1187
1188 .path-add-row input:focus {
1189 border-color: var(--accent);
1190 }
1191
1192 .path-add-row button {
1193 background: var(--surface2);
1194 color: var(--text);
1195 padding: 0.45rem 0.9rem;
1196 }
1197
1198 .path-add-row button:hover {
1199 background: var(--border);
1200 }
1201
1202 .admin-favicon-row {
1203 display: flex;
1204 align-items: center;
1205 justify-content: space-between;
1206 margin: 0.35rem 0 0.6rem;
1207 font-size: 0.88rem;
1208 color: var(--text-muted);
1209 }
1210
1211 .admin-favicon-row .icon-btn {
1212 color: var(--text);
1213 background: var(--surface2);
1214 }
1215
1216 .admin-favicon-row .icon-btn:hover {
1217 background: var(--border);
1218 }
1219
1220 .admin-scheduled-restart {
1221 margin: 0.4rem 0 0.8rem;
1222 padding: 0.6rem;
1223 border: 1px solid var(--border);
1224 border-radius: var(--radius);
1225 background: var(--bg);
1226 }
1227
1228 .admin-scheduled-restart.admin-scheduled-restart--disabled {
1229 opacity: 0.7;
1230 }
1231
1232 .admin-scheduled-restart-toggle {
1233 margin-bottom: 0.5rem;
1234 }
1235
1236 .admin-scheduled-restart-grid {
1237 display: grid;
1238 grid-template-columns: 1fr 1fr;
1239 gap: 0.6rem;
1240 }
1241
1242 .admin-scheduled-restart-grid label {
1243 display: flex;
1244 flex-direction: column;
1245 gap: 0.28rem;
1246 font-size: 0.82rem;
1247 color: var(--text-muted);
1248 }
1249
1250 .admin-scheduled-restart-grid input,
1251 .admin-scheduled-restart-grid select {
1252 background: var(--surface2);
1253 border: 1px solid var(--border);
1254 border-radius: 6px;
1255 color: var(--text);
1256 padding: 0.4rem 0.55rem;
1257 }
1258
1259 /* User list */
1260 .user-row {
1261 display: flex;
1262 align-items: center;
1263 gap: 0.6rem;
1264 padding: 0.5rem 0;
1265 border-bottom: 1px solid var(--border);
1266 }
1267
1268 .user-row .user-name {
1269 flex: 1;
1270 font-weight: 600;
1271 font-size: 0.9rem;
1272 }
1273
1274 .user-row .user-admin-badge {
1275 font-size: 0.72rem;
1276 background: var(--accent);
1277 color: #fff;
1278 border-radius: 4px;
1279 padding: 0.1rem 0.4rem;
1280 }
1281
1282 .user-row button {
1283 background: none;
1284 color: var(--text-muted);
1285 padding: 0.2rem 0.5rem;
1286 font-size: 0.85rem;
1287 }
1288
1289 .user-row button:hover {
1290 color: var(--text);
1291 }
1292
1293 .user-row button.danger {
1294 color: var(--danger);
1295 }
1296
1297 #admin-orphan-userfolders-section {
1298 margin-top: 1rem;
1299 padding-top: 0.55rem;
1300 border-top: 1px solid var(--border);
1301 }
1302
1303 #admin-orphan-userfolders-section h4 {
1304 margin: 0 0 0.35rem;
1305 font-size: 0.86rem;
1306 color: var(--text);
1307 }
1308
1309 .orphan-folder-row .orphan-folder-meta {
1310 font-size: 0.8rem;
1311 color: var(--text-muted);
1312 }
1313
1314 /* User form permissions */
1315 #user-permissions {
1316 margin-top: 0.75rem;
1317 }
1318
1319 #user-permissions h4 {
1320 font-size: 0.85rem;
1321 color: var(--text-muted);
1322 margin-bottom: 0.4rem;
1323 }
1324
1325 .perm-row {
1326 display: flex;
1327 align-items: center;
1328 gap: 0.75rem;
1329 flex-wrap: wrap;
1330 font-size: 0.85rem;
1331 margin-bottom: 0.4rem;
1332 }
1333
1334 .perm-row .perm-label {
1335 min-width: 130px;
1336 color: var(--text);
1337 }
1338
1339 .checkbox-label {
1340 display: flex;
1341 align-items: center;
1342 gap: 0.5rem;
1343 font-size: 0.9rem;
1344 margin-bottom: 0.5rem;
1345 }
1346
1347 .checkbox-label input[type="checkbox"] {
1348 width: 16px;
1349 height: 16px;
1350 accent-color: var(--accent);
1351 }
1352
1353 /* Form labels in modals */
1354 .modal form label {
1355 display: flex;
1356 flex-direction: column;
1357 gap: 0.3rem;
1358 font-size: 0.85rem;
1359 color: var(--text-muted);
1360 margin-bottom: 0.9rem;
1361 }
1362
1363 .modal form input[type="text"],
1364 .modal form input[type="password"] {
1365 background: var(--bg);
1366 border: 1px solid var(--border);
1367 border-radius: 6px;
1368 padding: 0.5rem 0.75rem;
1369 color: var(--text);
1370 font-size: 0.95rem;
1371 outline: none;
1372 transition: border-color var(--transition);
1373 }
1374
1375 .modal form input:focus {
1376 border-color: var(--accent);
1377 }
1378
1379 /* Admin user-folder controls use the same visual language as modal forms. */
1380 #admin-userfolder-section label {
1381 display: flex;
1382 flex-direction: column;
1383 gap: 0.3rem;
1384 font-size: 0.85rem;
1385 color: var(--text-muted);
1386 margin-bottom: 0.9rem;
1387 }
1388
1389 #admin-userfolder-section input[type="text"] {
1390 background: var(--bg);
1391 border: 1px solid var(--border);
1392 border-radius: 6px;
1393 padding: 0.5rem 0.75rem;
1394 color: var(--text);
1395 font-size: 0.95rem;
1396 outline: none;
1397 transition: border-color var(--transition);
1398 }
1399
1400 #admin-userfolder-section input[type="text"]:focus {
1401 border-color: var(--accent);
1402 }
1403
1404 /* =========================================================
1405 FILE PREVIEW — SHARED MEDIA STYLES
1406 ========================================================= */
1407 .preview-media {
1408 max-width: 100%;
1409 max-height: 100%;
1410 width: auto;
1411 height: auto;
1412 object-fit: contain;
1413 }
1414
1415 .preview-frame {
1416 width: 100%;
1417 height: 100%;
1418 border: none;
1419 border-radius: 8px;
1420 background: #fff;
1421 }
1422
1423 .preview-audio {
1424 width: min(640px, 95%);
1425 }
1426
1427 .preview-model-wrap {
1428 width: 100%;
1429 height: 100%;
1430 min-height: 240px;
1431 border: 1px solid var(--border);
1432 border-radius: 8px;
1433 background: #0d111a;
1434 display: flex;
1435 flex-direction: column;
1436 align-items: stretch;
1437 justify-content: stretch;
1438 overflow: hidden;
1439 }
1440
1441 .preview-model-canvas {
1442 flex: 1 1 auto;
1443 width: 100%;
1444 min-height: 180px;
1445 display: block;
1446 cursor: grab;
1447 }
1448
1449 .preview-model-canvas:active {
1450 cursor: grabbing;
1451 }
1452
1453 .preview-model-hint {
1454 margin: 0;
1455 padding: 0.45rem 0.7rem;
1456 border-top: 1px solid rgba(120, 128, 160, 0.35);
1457 color: #b8c4e8;
1458 font-size: 0.78rem;
1459 text-align: center;
1460 }
1461
1462 .preview-text {
1463 width: 100%;
1464 min-height: 100%;
1465 color: #dce4ff;
1466 background: #0d111a;
1467 border: 1px solid var(--border);
1468 border-radius: 8px;
1469 padding: 0.9rem;
1470 font: 0.85rem/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
1471 overflow: auto;
1472 white-space: pre;
1473 text-align: left;
1474 }
1475
1476 .preview-code .tok-comment {
1477 color: #6f7f9a;
1478 }
1479
1480 .preview-code .tok-string {
1481 color: #9ee37d;
1482 }
1483
1484 .preview-code .tok-number {
1485 color: #f8c46a;
1486 }
1487
1488 .preview-code .tok-keyword {
1489 color: #8bb4ff;
1490 font-weight: 600;
1491 }
1492
1493 .preview-code .tok-key {
1494 color: #59c8ff;
1495 }
1496
1497 .preview-unsupported {
1498 color: var(--text-muted);
1499 font-size: 0.95rem;
1500 max-width: 56ch;
1501 text-align: center;
1502 }
1503
1504 .preview-footer {
1505 border-top: 1px solid var(--border);
1506 padding: 0.8rem 1rem;
1507 display: flex;
1508 justify-content: flex-end;
1509 }
1510
1511 .preview-footer .primary {
1512 width: auto;
1513 margin-top: 0;
1514 min-width: 8rem;
1515 }
1516
1517
1518
1519 /* =========================================================
1520
1521 .toast-msg {
1522 background: var(--surface2);
1523 border: 1px solid var(--border);
1524 border-radius: 8px;
1525 padding: 0.6rem 1.25rem;
1526 font-size: 0.9rem;
1527 animation: slideup 0.25s ease;
1528 }
1529
1530 .toast-msg.err {
1531 border-color: var(--danger);
1532 color: var(--danger);
1533 }
1534
1535 .toast-msg.ok {
1536 border-color: var(--success);
1537 color: var(--success);
1538 }
1539
1540 @keyframes slideup {
1541 from {
1542 opacity: 0;
1543 transform: translateY(12px);
1544 }
1545
1546 to {
1547 opacity: 1;
1548 transform: translateY(0);
1549 }
1550 }
1551
1552 /* =========================================================
1553 UPLOAD PROGRESS
1554 ========================================================= */
1 /* =========================================================
2 RESET & CUSTOM PROPERTIES
3 ========================================================= */
4 *,
5 *::before,
6 *::after {
7 box-sizing: border-box;
8 margin: 0;
9 padding: 0;
10 }
11
12 :root {
13 --bg: #0f1117;
14 --surface: #1a1d27;
15 --surface2: #21242f;
16 --border: #2e3247;
17 --accent: #5b7fff;
18 --accent-hover: #7b9fff;
19 --text: #e8eaf0;
20 --text-muted: #7880a0;
21 --danger: #e05c6e;
22 --success: #3fcf8e;
23 --radius: 10px;
24 --topbar-h: 56px;
25 --sidebar-w: 300px;
26 --transition: 0.18s ease;
27 }
28
29 html,
30 body {
31 height: 100%;
32 font-family: system-ui, -apple-system, sans-serif;
33 }
34
35 body {
36 background: var(--bg);
37 color: var(--text);
38 overflow: hidden;
39 }
40
41 .hidden {
42 display: none !important;
43 }
44
45 .muted {
46 color: var(--text-muted);
47 }
48
49 .error {
50 color: var(--danger);
51 font-size: 0.85rem;
52 margin-top: 0.3rem;
53 }
54
55 /* =========================================================
56 AUTH OVERLAY
57 ========================================================= */
58 .overlay {
59 position: fixed;
60 inset: 0;
61 background: var(--bg);
62 display: flex;
63 align-items: center;
64 justify-content: center;
65 z-index: 100;
66 }
67
68 .auth-card {
69 background: var(--surface);
70 border: 1px solid var(--border);
71 border-radius: var(--radius);
72 padding: 2.5rem 2rem;
73 width: min(420px, 92vw);
74 }
75
76 .auth-card h1 {
77 font-size: 1.6rem;
78 margin-bottom: 0.5rem;
79 }
80
81 .auth-subtitle {
82 font-size: 0.88rem;
83 color: var(--text-muted);
84 margin-bottom: 1.2rem;
85 }
86
87 #auth-form label {
88 display: flex;
89 flex-direction: column;
90 gap: 0.3rem;
91 font-size: 0.85rem;
92 color: var(--text-muted);
93 margin-bottom: 1rem;
94 }
95
96 #auth-form input {
97 background: var(--bg);
98 border: 1px solid var(--border);
99 border-radius: 6px;
100 padding: 0.55rem 0.75rem;
101 color: var(--text);
102 font-size: 1rem;
103 outline: none;
104 transition: border-color var(--transition);
105 }
106
107 #auth-form input:focus {
108 border-color: var(--accent);
109 }
110
111 /* =========================================================
112 BUTTONS
113 ========================================================= */
114 button {
115 cursor: pointer;
116 border: none;
117 border-radius: 6px;
118 font-size: 0.9rem;
119 transition: background var(--transition), color var(--transition);
120 }
121
122 .icon-btn {
123 display: flex;
124 align-items: center;
125 gap: 0.4rem;
126 background: transparent;
127 color: var(--text-muted);
128 padding: 0.4rem 0.7rem;
129 border-radius: 6px;
130 position: relative;
131 }
132
133 .icon-btn:hover {
134 background: var(--surface2);
135 color: var(--text);
136 }
137
138 .icon-btn svg {
139 width: 18px;
140 height: 18px;
141 }
142
143 .topbar-badge {
144 position: absolute;
145 top: -0.25rem;
146 right: -0.3rem;
147 min-width: 1.1rem;
148 height: 1.1rem;
149 padding: 0 0.28rem;
150 border-radius: 999px;
151 background: #d33131;
152 color: #fff;
153 font-size: 0.68rem;
154 font-weight: 700;
155 line-height: 1.1rem;
156 text-align: center;
157 border: 1px solid var(--surface);
158 }
159
160 button[type="submit"],
161 .primary {
162 background: var(--accent);
163 color: #fff;
164 padding: 0.55rem 1.2rem;
165 font-weight: 600;
166 width: 100%;
167 margin-top: 0.5rem;
168 }
169
170 button[type="submit"]:hover,
171 .primary:hover {
172 background: var(--accent-hover);
173 }
174
175 button.danger {
176 background: var(--surface2);
177 color: var(--danger);
178 padding: 0.55rem 1.2rem;
179 width: 100%;
180 margin-top: 0.5rem;
181 }
182
183 button.danger:hover {
184 background: var(--border);
185 }
186
187 button:disabled,
188 input:disabled,
189 select:disabled {
190 opacity: 0.55;
191 cursor: not-allowed;
192 }
193
194 button.danger.admin-update-highlight {
195 animation: admin-update-pulse 0.9s ease-in-out 2;
196 }
197
198 @keyframes admin-update-pulse {
199 0% {
200 box-shadow: 0 0 0 0 rgba(211, 49, 49, 0.55);
201 transform: scale(1);
202 }
203
204 50% {
205 box-shadow: 0 0 0 10px rgba(211, 49, 49, 0);
206 transform: scale(1.02);
207 }
208
209 100% {
210 box-shadow: 0 0 0 0 rgba(211, 49, 49, 0);
211 transform: scale(1);
212 }
213 }
214
215 /* =========================================================
216 TOP BAR
217 ========================================================= */
218 #app {
219 display: flex;
220 flex-direction: column;
221 height: 100vh;
222 }
223
224 #topbar {
225 height: var(--topbar-h);
226 background: var(--surface);
227 border-bottom: 1px solid var(--border);
228 display: flex;
229 align-items: center;
230 padding: 0 1rem;
231 gap: 0.5rem;
232 flex-shrink: 0;
233 }
234
235 #topbar>#btn-refresh {
236 flex: 0 0 auto;
237 }
238
239 #breadcrumb-wrap {
240 flex: 1;
241 min-width: 0;
242 }
243
244 #breadcrumb {
245 display: flex;
246 align-items: center;
247 flex-wrap: wrap;
248 gap: 0.1rem;
249 font-size: 0.9rem;
250 white-space: nowrap;
251 overflow: hidden;
252 }
253
254 #breadcrumb .crumb {
255 color: var(--text-muted);
256 background: none;
257 padding: 0.2rem 0.35rem;
258 border-radius: 4px;
259 text-decoration: none;
260 cursor: pointer;
261 }
262
263 #breadcrumb .crumb:hover {
264 color: var(--text);
265 background: var(--surface2);
266 }
267
268 #breadcrumb .crumb.active {
269 color: var(--text);
270 cursor: default;
271 }
272
273 #breadcrumb .sep {
274 color: var(--border);
275 user-select: none;
276 }
277
278 #topbar-actions {
279 display: flex;
280 align-items: center;
281 gap: 0.25rem;
282 flex-shrink: 0;
283 position: relative;
284 }
285
286 .topbar-dropdown {
287 position: relative;
288 }
289
290 .topbar-dropdown-menu {
291 position: absolute;
292 top: calc(100% + 0.4rem);
293 left: 0;
294 min-width: 180px;
295 background: var(--surface);
296 border: 1px solid var(--border);
297 border-radius: var(--radius);
298 box-shadow: 0 12px 22px rgba(0, 0, 0, 0.28);
299 padding: 0.35rem;
300 z-index: 140;
301 display: none;
302 }
303
304 .topbar-dropdown-menu--right {
305 left: auto;
306 right: 0;
307 }
308
309 .topbar-dropdown.open .topbar-dropdown-menu {
310 display: flex;
311 flex-direction: column;
312 gap: 0.2rem;
313 }
314
315 .topbar-menu-item {
316 display: flex;
317 align-items: center;
318 gap: 0.48rem;
319 width: 100%;
320 background: transparent;
321 color: var(--text-muted);
322 border-radius: 6px;
323 padding: 0.45rem 0.55rem;
324 text-align: left;
325 position: relative;
326 }
327
328 a.topbar-menu-item {
329 text-decoration: none;
330 box-sizing: border-box;
331 font: inherit;
332 min-height: 2.25rem;
333 }
334
335 .topbar-menu-item svg {
336 width: 16px;
337 height: 16px;
338 flex: 0 0 auto;
339 }
340
341 .topbar-menu-item:hover {
342 background: var(--surface2);
343 color: var(--text);
344 }
345
346 .topbar-menu-item .topbar-badge {
347 top: -0.24rem;
348 right: -0.22rem;
349 }
350
351 .top-search {
352 display: flex;
353 align-items: center;
354 gap: 0.35rem;
355 margin-right: 0.2rem;
356 }
357
358 .top-search input {
359 width: min(34vw, 300px);
360 min-width: 150px;
361 background: var(--bg);
362 border: 1px solid var(--border);
363 border-radius: 6px;
364 color: var(--text);
365 font-size: 0.88rem;
366 padding: 0.42rem 0.6rem;
367 outline: none;
368 }
369
370 .top-search input:focus {
371 border-color: var(--accent);
372 }
373
374 #btn-search {
375 padding: 0.36rem 0.62rem;
376 }
377
378 .global-favicon-preview {
379 width: 18px;
380 height: 18px;
381 display: inline-flex;
382 align-items: center;
383 justify-content: center;
384 border-radius: 4px;
385 overflow: hidden;
386 color: #fff;
387 }
388
389 .global-favicon-preview svg,
390 .global-favicon-preview img {
391 width: 100%;
392 height: 100%;
393 display: block;
394 object-fit: cover;
395 }
396
397 .icon-btn.icon-only {
398 width: 2rem;
399 height: 2rem;
400 padding: 0;
401 justify-content: center;
402 }
403
404 /* =========================================================
405 MAIN + SIDEBAR LAYOUT
406 ========================================================= */
407 #main-content {
408 flex: 1;
409 overflow-y: auto;
410 padding: 1.25rem;
411 position: relative;
412 }
413
414 #folder-stats {
415 margin-bottom: 0.8rem;
416 font-size: 0.85rem;
417 }
418
419 /* Drop overlay */
420 #drop-overlay {
421 position: absolute;
422 inset: 0;
423 background: rgba(91, 127, 255, 0.12);
424 border: 3px dashed var(--accent);
425 border-radius: var(--radius);
426 display: flex;
427 align-items: center;
428 justify-content: center;
429 z-index: 10;
430 font-size: 1.4rem;
431 color: var(--accent);
432 pointer-events: none;
433 }
434
435 /* When sidebar is open, shrink main content */
436 #app.sidebar-open #main-content {
437 margin-right: var(--sidebar-w);
438 }
439
440 /* =========================================================
441 FILE GRID
442 ========================================================= */
443 #file-grid {
444 display: grid;
445 grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
446 gap: 0.75rem;
447 }
448
449 .file-group-separator {
450 grid-column: 1 / -1;
451 display: flex;
452 align-items: center;
453 gap: 0.55rem;
454 margin-top: 0.1rem;
455 margin-bottom: 0.1rem;
456 color: var(--text-muted);
457 font-size: 0.76rem;
458 letter-spacing: 0.02em;
459 }
460
461 .file-group-separator::before,
462 .file-group-separator::after {
463 content: '';
464 height: 1px;
465 background: var(--border);
466 flex: 1;
467 }
468
469 .file-group-separator span {
470 padding: 0.12rem 0.45rem;
471 border: 1px solid var(--border);
472 border-radius: 999px;
473 background: rgba(255, 255, 255, 0.02);
474 white-space: nowrap;
475 }
476
477 .file-item {
478 display: flex;
479 flex-direction: column;
480 align-items: center;
481 padding: 0.9rem 0.5rem 0.7rem;
482 border-radius: var(--radius);
483 border: 1px solid transparent;
484 cursor: pointer;
485 user-select: none;
486 transition: background var(--transition), border-color var(--transition);
487 text-align: center;
488 gap: 0.4rem;
489 position: relative;
490 touch-action: manipulation;
491 }
492
493 .file-item:hover {
494 background: var(--surface);
495 border-color: var(--border);
496 }
497
498 .file-item.file-item--preview-placeholder {
499 visibility: hidden;
500 pointer-events: none;
501 }
502
503 .file-item.selected {
504 background: var(--surface2);
505 border-color: var(--accent);
506 }
507
508 .file-item .icon {
509 width: 52px;
510 height: 52px;
511 display: flex;
512 align-items: center;
513 justify-content: center;
514 position: relative;
515 }
516
517 .file-item .icon.thumb-pending::after {
518 content: '';
519 position: absolute;
520 width: 14px;
521 height: 14px;
522 left: 50%;
523 top: 50%;
524 border: 2px solid rgba(232, 234, 240, 0.35);
525 border-top-color: var(--accent);
526 border-radius: 50%;
527 animation: icon-thumb-spin 0.75s linear infinite;
528 background: rgba(15, 17, 23, 0.85);
529 }
530
531 @keyframes icon-thumb-spin {
532 from {
533 transform: translate(-50%, -50%) rotate(0deg);
534 }
535
536 to {
537 transform: translate(-50%, -50%) rotate(360deg);
538 }
539 }
540
541 .file-item .icon svg {
542 width: 100%;
543 height: 100%;
544 }
545
546 .file-item .icon .watched-overlay {
547 position: absolute;
548 left: 50%;
549 top: 50%;
550 width: 28px;
551 height: 28px;
552 transform: translate(-50%, -50%);
553 display: flex;
554 align-items: center;
555 justify-content: center;
556 pointer-events: none;
557 border-radius: 50%;
558 background: rgba(15, 17, 23, 0.45);
559 }
560
561 .file-item .icon .watched-overlay--partway {
562 width: 16.8px;
563 height: 16.8px;
564 }
565
566 .file-item .icon .watched-overlay--partway path {
567 fill: #8f98a5;
568 }
569
570 .file-item .icon .watched-overlay-svg {
571 width: 100%;
572 height: 100%;
573 }
574
575 .file-item .name {
576 font-size: 0.8rem;
577 word-break: normal;
578 overflow-wrap: anywhere;
579 max-width: 100%;
580 line-height: 1.3;
581 color: var(--text);
582 white-space: normal;
583 overflow: hidden;
584 text-overflow: ellipsis;
585 max-height: calc(1.3em * 4);
586 display: -webkit-box;
587 -webkit-box-orient: vertical;
588 -webkit-line-clamp: 4;
589 line-clamp: 4;
590 }
591
592 /* =========================================================
593 SIDEBAR
594 ========================================================= */
595 #sidebar {
596 position: fixed;
597 top: var(--topbar-h);
598 right: 0;
599 bottom: 0;
600 width: var(--sidebar-w);
601 background: var(--surface);
602 border-left: 1px solid var(--border);
603 padding: 1.25rem;
604 overflow-y: auto;
605 z-index: 20;
606 display: flex;
607 flex-direction: column;
608 gap: 0.75rem;
609 }
610
611 #sidebar-close {
612 display: none;
613 align-items: center;
614 justify-content: center;
615 width: 1.7rem;
616 height: 1.7rem;
617 border: 1px solid transparent;
618 border-radius: 999px;
619 background: transparent;
620 color: var(--text-muted);
621 font-size: 1rem;
622 line-height: 1;
623 }
624
625 #sidebar-close:hover {
626 background: var(--surface2);
627 color: var(--text);
628 }
629
630 #sidebar-icon {
631 display: flex;
632 justify-content: center;
633 }
634
635 #sidebar-icon svg {
636 width: 64px;
637 height: 64px;
638 }
639
640 #sidebar-name {
641 font-size: 1rem;
642 word-break: break-all;
643 text-align: center;
644 }
645
646 #sidebar-meta {
647 display: grid;
648 grid-template-columns: auto 1fr;
649 gap: 0.3rem 0.75rem;
650 }
651
652 #sidebar-meta dt {
653 color: var(--text-muted);
654 font-size: 0.8rem;
655 font-weight: 600;
656 }
657
658 #sidebar-meta dd {
659 font-size: 0.8rem;
660 word-break: break-all;
661 }
662
663 #sidebar-meta .root-access-list {
664 margin: 0;
665 padding-left: 1rem;
666 }
667
668 #sidebar-meta .root-access-list li {
669 margin: 0.12rem 0;
670 }
671
672 #sidebar-actions {
673 display: flex;
674 flex-direction: column;
675 gap: 0.5rem;
676 margin-top: 0.5rem;
677 }
678
679 #sidebar-actions button {
680 background: var(--surface2);
681 color: var(--text);
682 padding: 0.5rem 0.8rem;
683 text-align: left;
684 }
685
686 #sidebar-actions button:hover {
687 background: var(--border);
688 }
689
690 #sidebar-actions button.danger {
691 color: var(--danger);
692 }
693
694 .sidebar-view-options {
695 display: flex;
696 flex-direction: column;
697 gap: 0.5rem;
698 border-top: 1px solid var(--border);
699 padding-top: 0.7rem;
700 margin-top: 0.2rem;
701 }
702
703 .sidebar-view-options h3 {
704 margin: 0;
705 font-size: 0.82rem;
706 color: var(--text-muted);
707 text-transform: uppercase;
708 letter-spacing: 0.04em;
709 }
710
711 .sidebar-view-option-label {
712 display: flex;
713 flex-direction: column;
714 gap: 0.28rem;
715 font-size: 0.8rem;
716 color: var(--text-muted);
717 }
718
719 .sidebar-view-option-control {
720 width: 100%;
721 background: var(--surface2);
722 border: 1px solid var(--border);
723 border-radius: var(--radius);
724 color: var(--text);
725 padding: 0.42rem 0.5rem;
726 }
727
728 .sidebar-view-toggle {
729 display: flex;
730 align-items: center;
731 gap: 0.45rem;
732 font-size: 0.8rem;
733 color: var(--text);
734 }
735
736 .custom-context-menu {
737 position: fixed;
738 min-width: 220px;
739 max-width: min(320px, calc(100vw - 12px));
740 background: var(--surface);
741 border: 1px solid var(--border);
742 border-radius: var(--radius);
743 box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
744 padding: 0.35rem;
745 z-index: 12000;
746 }
747
748 .custom-context-menu button,
749 .custom-context-menu .custom-context-menu-item {
750 display: flex;
751 align-items: center;
752 justify-content: space-between;
753 width: 100%;
754 background: transparent;
755 color: var(--text);
756 padding: 0.45rem 0.55rem;
757 text-align: left;
758 border-radius: 6px;
759 }
760
761 .custom-context-menu button:hover,
762 .custom-context-menu .custom-context-menu-item:hover {
763 background: var(--surface2);
764 }
765
766 .custom-context-menu button.danger,
767 .custom-context-menu .custom-context-menu-item.danger {
768 color: var(--danger);
769 }
770
771 .custom-context-menu-separator {
772 height: 1px;
773 background: var(--border);
774 margin: 0.32rem 0;
775 }
776
777 .custom-context-menu-row {
778 position: relative;
779 }
780
781 .custom-context-submenu {
782 position: absolute;
783 top: 0;
784 left: calc(100% + 0.3rem);
785 min-width: 210px;
786 background: var(--surface);
787 border: 1px solid var(--border);
788 border-radius: var(--radius);
789 box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
790 padding: 0.35rem;
791 display: none;
792 }
793
794 .custom-context-menu-row:hover>.custom-context-submenu,
795 .custom-context-menu-row:focus-within>.custom-context-submenu {
796 display: block;
797 }
798
799 /* ─── Duplicates panel ─────────────────────────────────── */
800 #sidebar-duplicates {
801 margin-top: 1rem;
802 border-top: 1px solid var(--border);
803 padding-top: 0.75rem;
804 }
805
806 .sidebar-duplicates-heading {
807 font-size: 0.75rem;
808 font-weight: 600;
809 text-transform: uppercase;
810 letter-spacing: 0.05em;
811 color: var(--text-muted, #888);
812 margin: 0 0 0.4rem;
813 }
814
815 .sidebar-duplicates-list {
816 list-style: none;
817 margin: 0;
818 padding: 0;
819 display: flex;
820 flex-direction: column;
821 gap: 0.25rem;
822 }
823
824 .sidebar-duplicate-entry {
825 display: block;
826 width: 100%;
827 background: var(--surface2);
828 color: var(--text);
829 padding: 0.35rem 0.6rem;
830 text-align: left;
831 font-size: 0.8rem;
832 white-space: nowrap;
833 overflow: hidden;
834 text-overflow: ellipsis;
835 border-radius: var(--radius);
836 cursor: pointer;
837 }
838
839 .sidebar-duplicate-entry:hover {
840 background: var(--border);
841 }
842
843 .admin-size-feedback {
844 font-size: 0.82rem;
845 margin: 0.25rem 0 0.5rem;
846 padding: 0.25rem 0.5rem;
847 border-radius: var(--radius);
848 }
849
850 .admin-size-feedback.ok {
851 color: var(--accent);
852 }
853
854 .admin-size-feedback.err {
855 color: #e55;
856 }
857
858 /* =========================================================
859 MODALS
860 ========================================================= */
861 .modal-overlay {
862 position: fixed;
863 inset: 0;
864 background: rgba(0, 0, 0, 0.65);
865 display: flex;
866 align-items: center;
867 justify-content: center;
868 z-index: 11000;
869 }
870
871 #file-conflict-modal,
872 #overwrite-modal {
873 z-index: 11150;
874 }
875
876 .modal {
877 background: var(--surface);
878 border: 1px solid var(--border);
879 border-radius: var(--radius);
880 padding: 2rem;
881 width: min(560px, 94vw);
882 max-height: 90vh;
883 overflow-y: auto;
884 position: relative;
885 }
886
887 .modal.small {
888 width: min(340px, 94vw);
889 }
890
891 #confirm-modal .modal.confirm-modal-wide {
892 width: min(760px, 94vw);
893 }
894
895 .modal h2 {
896 font-size: 1.3rem;
897 margin-bottom: 1.25rem;
898 }
899
900 .modal h3 {
901 font-size: 1rem;
902 color: var(--text-muted);
903 margin: 1rem 0 0.5rem;
904 }
905
906 .modal-close {
907 position: absolute;
908 top: 0.75rem;
909 right: 0.75rem;
910 background: none;
911 color: var(--text-muted);
912 font-size: 1.1rem;
913 padding: 0.25rem 0.5rem;
914 }
915
916 .modal-close:hover {
917 color: var(--text);
918 }
919
920 .update-commit-list {
921 max-height: min(48vh, 420px);
922 overflow: auto;
923 border: 1px solid var(--border);
924 border-radius: 10px;
925 background: var(--bg);
926 padding: 0.6rem 0.8rem;
927 }
928
929 .update-commit-item+.update-commit-item {
930 margin-top: 0.9rem;
931 padding-top: 0.9rem;
932 border-top: 1px solid var(--border);
933 }
934
935 .update-commit-item h3 {
936 margin: 0;
937 font-size: 1.06rem;
938 font-weight: 700;
939 color: var(--text);
940 }
941
942 .update-commit-hash {
943 color: var(--text-muted);
944 font-weight: 600;
945 font-size: 0.9rem;
946 }
947
948 .update-commit-subject {
949 color: var(--text);
950 }
951
952 .update-commit-body {
953 margin: 0.45rem 0 0;
954 font-size: 0.94rem;
955 color: var(--text-muted);
956 line-height: 1.45;
957 }
958
959 /* =========================================================
960 FOLDER ICON PICKER
961 ========================================================= */
962 .folder-icon-modal {
963 width: min(680px, 94vw);
964 max-height: 90vh;
965 display: flex;
966 flex-direction: column;
967 gap: 0.75rem;
968 overflow: hidden;
969 }
970
971 .folder-icon-grid {
972 display: grid;
973 grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
974 gap: 0.5rem;
975 max-height: 50vh;
976 overflow-y: auto;
977 padding: 0.25rem;
978 background: var(--bg);
979 border: 1px solid var(--border);
980 border-radius: var(--radius);
981 }
982
983 .folder-icon-filter {
984 width: 100%;
985 background: var(--bg);
986 border: 1px solid var(--border);
987 border-radius: 6px;
988 color: var(--text);
989 font-size: 0.9rem;
990 padding: 0.48rem 0.68rem;
991 outline: none;
992 }
993
994 .folder-icon-filter:focus {
995 border-color: var(--accent);
996 }
997
998 .debug-modal {
999 width: min(980px, 96vw);
1000 max-height: 92vh;
1001 }
1002
1003 .debug-toolbar {
1004 display: flex;
1005 justify-content: space-between;
1006 align-items: center;
1007 gap: 0.8rem;
1008 margin: 0.75rem 0 1rem;
1009 }
1010
1011 .debug-section-head {
1012 display: flex;
1013 align-items: center;
1014 justify-content: space-between;
1015 gap: 0.8rem;
1016 }
1017
1018 .debug-copy-btn {
1019 padding: 0.3rem 0.55rem;
1020 border-radius: 7px;
1021 font-size: 0.78rem;
1022 border: 1px solid var(--border);
1023 background: var(--bg);
1024 color: var(--text-muted);
1025 }
1026
1027 .debug-copy-btn:hover {
1028 color: var(--text);
1029 border-color: var(--accent);
1030 }
1031
1032 .debug-summary-grid {
1033 display: grid;
1034 grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
1035 gap: 0.6rem;
1036 margin-bottom: 0.8rem;
1037 }
1038
1039 .debug-summary-item {
1040 background: var(--bg);
1041 border: 1px solid var(--border);
1042 border-radius: 10px;
1043 padding: 0.55rem 0.7rem;
1044 }
1045
1046 .debug-summary-item .k {
1047 display: block;
1048 color: var(--text-muted);
1049 font-size: 0.82rem;
1050 }
1051
1052 .debug-summary-item .v {
1053 display: block;
1054 color: var(--text);
1055 font-weight: 650;
1056 margin-top: 0.12rem;
1057 }
1058
1059 .debug-chips {
1060 display: flex;
1061 flex-wrap: wrap;
1062 gap: 0.45rem;
1063 }
1064
1065 .debug-chip {
1066 border: 1px solid var(--border);
1067 border-radius: 999px;
1068 padding: 0.22rem 0.6rem;
1069 background: var(--bg);
1070 font-size: 0.82rem;
1071 }
1072
1073 .debug-table-wrap {
1074 border: 1px solid var(--border);
1075 border-radius: 10px;
1076 overflow: auto;
1077 background: var(--bg);
1078 }
1079
1080 .debug-table {
1081 width: 100%;
1082 border-collapse: collapse;
1083 font-size: 0.85rem;
1084 }
1085
1086 .debug-table th,
1087 .debug-table td {
1088 border-bottom: 1px solid var(--border);
1089 text-align: left;
1090 vertical-align: top;
1091 padding: 0.45rem 0.55rem;
1092 }
1093
1094 .debug-table thead th {
1095 position: sticky;
1096 top: 0;
1097 z-index: 1;
1098 background: var(--surface);
1099 }
1100
1101 .debug-table tr:last-child td {
1102 border-bottom: 0;
1103 }
1104
1105 .debug-path {
1106 font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
1107 word-break: break-word;
1108 }
1109
1110 .folder-icon-cell {
1111 display: flex;
1112 flex-direction: column;
1113 align-items: center;
1114 gap: 0.3rem;
1115 padding: 0.4rem;
1116 border-radius: var(--radius);
1117 border: 2px solid transparent;
1118 cursor: pointer;
1119 transition: border-color var(--transition), background var(--transition);
1120 }
1121
1122 .folder-icon-cell:hover {
1123 background: var(--surface2);
1124 }
1125
1126 .folder-icon-cell.selected {
1127 border-color: var(--accent);
1128 background: rgba(91, 127, 255, 0.12);
1129 }
1130
1131 .folder-icon-thumb {
1132 width: 60px;
1133 height: 60px;
1134 object-fit: cover;
1135 border-radius: 4px;
1136 background: var(--surface2);
1137 }
1138
1139 .folder-icon-label {
1140 font-size: 0.68rem;
1141 color: var(--text-muted);
1142 word-break: break-all;
1143 text-align: center;
1144 max-width: 72px;
1145 overflow: hidden;
1146 display: -webkit-box;
1147 -webkit-line-clamp: 2;
1148 -webkit-box-orient: vertical;
1149 }
1150
1151 .vjs-text-track-cue>div {
1152 background: transparent !important;
1153 text-shadow: 2px 0 black, -2px 0 black, 0 2px black, 0 -2px black,
1154 1px 1px black, -1px -1px black, 1px -1px black, -1px 1px black;
1155 }
1156
1157 /* Admin path list */
1158 .path-row {
1159 display: flex;
1160 align-items: center;
1161 gap: 0.5rem;
1162 padding: 0.4rem 0;
1163 border-bottom: 1px solid var(--border);
1164 font-size: 0.88rem;
1165 }
1166
1167 .path-row span {
1168 flex: 1;
1169 word-break: break-all;
1170 }
1171
1172 .path-row button {
1173 background: none;
1174 color: var(--danger);
1175 padding: 0.2rem 0.5rem;
1176 }
1177
1178 .path-add-row {
1179 display: flex;
1180 gap: 0.5rem;
1181 margin: 0.5rem 0;
1182 }
1183
1184 .path-add-row input {
1185 flex: 1;
1186 background: var(--bg);
1187 border: 1px solid var(--border);
1188 border-radius: 6px;
1189 padding: 0.45rem 0.7rem;
1190 color: var(--text);
1191 font-size: 0.9rem;
1192 outline: none;
1193 }
1194
1195 .path-add-row input:focus {
1196 border-color: var(--accent);
1197 }
1198
1199 .path-add-row button {
1200 background: var(--surface2);
1201 color: var(--text);
1202 padding: 0.45rem 0.9rem;
1203 }
1204
1205 .path-add-row button:hover {
1206 background: var(--border);
1207 }
1208
1209 .admin-favicon-row {
1210 display: flex;
1211 align-items: center;
1212 justify-content: space-between;
1213 margin: 0.35rem 0 0.6rem;
1214 font-size: 0.88rem;
1215 color: var(--text-muted);
1216 }
1217
1218 .admin-favicon-row .icon-btn {
1219 color: var(--text);
1220 background: var(--surface2);
1221 }
1222
1223 .admin-favicon-row .icon-btn:hover {
1224 background: var(--border);
1225 }
1226
1227 .admin-scheduled-restart {
1228 margin: 0.4rem 0 0.8rem;
1229 padding: 0.6rem;
1230 border: 1px solid var(--border);
1231 border-radius: var(--radius);
1232 background: var(--bg);
1233 }
1234
1235 .admin-scheduled-restart.admin-scheduled-restart--disabled {
1236 opacity: 0.7;
1237 }
1238
1239 .admin-scheduled-restart-toggle {
1240 margin-bottom: 0.5rem;
1241 }
1242
1243 .admin-scheduled-restart-grid {
1244 display: grid;
1245 grid-template-columns: 1fr 1fr;
1246 gap: 0.6rem;
1247 }
1248
1249 .admin-scheduled-restart-grid label {
1250 display: flex;
1251 flex-direction: column;
1252 gap: 0.28rem;
1253 font-size: 0.82rem;
1254 color: var(--text-muted);
1255 }
1256
1257 .admin-scheduled-restart-grid input,
1258 .admin-scheduled-restart-grid select {
1259 background: var(--surface2);
1260 border: 1px solid var(--border);
1261 border-radius: 6px;
1262 color: var(--text);
1263 padding: 0.4rem 0.55rem;
1264 }
1265
1266 /* User list */
1267 .user-row {
1268 display: flex;
1269 align-items: center;
1270 gap: 0.6rem;
1271 padding: 0.5rem 0;
1272 border-bottom: 1px solid var(--border);
1273 }
1274
1275 .user-row .user-name {
1276 flex: 1;
1277 font-weight: 600;
1278 font-size: 0.9rem;
1279 }
1280
1281 .user-row .user-admin-badge {
1282 font-size: 0.72rem;
1283 background: var(--accent);
1284 color: #fff;
1285 border-radius: 4px;
1286 padding: 0.1rem 0.4rem;
1287 }
1288
1289 .user-row button {
1290 background: none;
1291 color: var(--text-muted);
1292 padding: 0.2rem 0.5rem;
1293 font-size: 0.85rem;
1294 }
1295
1296 .user-row button:hover {
1297 color: var(--text);
1298 }
1299
1300 .user-row button.danger {
1301 color: var(--danger);
1302 }
1303
1304 #admin-orphan-userfolders-section {
1305 margin-top: 1rem;
1306 padding-top: 0.55rem;
1307 border-top: 1px solid var(--border);
1308 }
1309
1310 #admin-orphan-userfolders-section h4 {
1311 margin: 0 0 0.35rem;
1312 font-size: 0.86rem;
1313 color: var(--text);
1314 }
1315
1316 .orphan-folder-row .orphan-folder-meta {
1317 font-size: 0.8rem;
1318 color: var(--text-muted);
1319 }
1320
1321 /* User form permissions */
1322 #user-permissions {
1323 margin-top: 0.75rem;
1324 }
1325
1326 #user-permissions h4 {
1327 font-size: 0.85rem;
1328 color: var(--text-muted);
1329 margin-bottom: 0.4rem;
1330 }
1331
1332 .perm-row {
1333 display: flex;
1334 align-items: center;
1335 gap: 0.75rem;
1336 flex-wrap: wrap;
1337 font-size: 0.85rem;
1338 margin-bottom: 0.4rem;
1339 }
1340
1341 .perm-row .perm-label {
1342 min-width: 130px;
1343 color: var(--text);
1344 }
1345
1346 .checkbox-label {
1347 display: flex;
1348 align-items: center;
1349 gap: 0.5rem;
1350 font-size: 0.9rem;
1351 margin-bottom: 0.5rem;
1352 }
1353
1354 .checkbox-label input[type="checkbox"] {
1355 width: 16px;
1356 height: 16px;
1357 accent-color: var(--accent);
1358 }
1359
1360 /* Form labels in modals */
1361 .modal form label {
1362 display: flex;
1363 flex-direction: column;
1364 gap: 0.3rem;
1365 font-size: 0.85rem;
1366 color: var(--text-muted);
1367 margin-bottom: 0.9rem;
1368 }
1369
1370 .modal form input[type="text"],
1371 .modal form input[type="password"] {
1372 background: var(--bg);
1373 border: 1px solid var(--border);
1374 border-radius: 6px;
1375 padding: 0.5rem 0.75rem;
1376 color: var(--text);
1377 font-size: 0.95rem;
1378 outline: none;
1379 transition: border-color var(--transition);
1380 }
1381
1382 .modal form input:focus {
1383 border-color: var(--accent);
1384 }
1385
1386 /* Admin user-folder controls use the same visual language as modal forms. */
1387 #admin-userfolder-section label {
1388 display: flex;
1389 flex-direction: column;
1390 gap: 0.3rem;
1391 font-size: 0.85rem;
1392 color: var(--text-muted);
1393 margin-bottom: 0.9rem;
1394 }
1395
1396 #admin-userfolder-section input[type="text"] {
1397 background: var(--bg);
1398 border: 1px solid var(--border);
1399 border-radius: 6px;
1400 padding: 0.5rem 0.75rem;
1401 color: var(--text);
1402 font-size: 0.95rem;
1403 outline: none;
1404 transition: border-color var(--transition);
1405 }
1406
1407 #admin-userfolder-section input[type="text"]:focus {
1408 border-color: var(--accent);
1409 }
1410
1411 /* =========================================================
1412 FILE PREVIEW — SHARED MEDIA STYLES
1413 ========================================================= */
1414 .preview-media {
1415 max-width: 100%;
1416 max-height: 100%;
1417 width: auto;
1418 height: auto;
1419 object-fit: contain;
1420 }
1421
1422 .preview-frame {
1423 width: 100%;
1424 height: 100%;
1425 border: none;
1426 border-radius: 8px;
1427 background: #fff;
1428 }
1429
1430 .preview-audio {
1431 width: min(640px, 95%);
1432 }
1433
1434 .preview-model-wrap {
1435 width: 100%;
1436 height: 100%;
1437 min-height: 240px;
1438 border: 1px solid var(--border);
1439 border-radius: 8px;
1440 background: #0d111a;
1441 display: flex;
1442 flex-direction: column;
1443 align-items: stretch;
1444 justify-content: stretch;
1445 overflow: hidden;
1446 }
1447
1448 .preview-model-canvas {
1449 flex: 1 1 auto;
1450 width: 100%;
1451 min-height: 180px;
1452 display: block;
1453 cursor: grab;
1454 }
1455
1456 .preview-model-canvas:active {
1457 cursor: grabbing;
1458 }
1459
1460 .preview-model-hint {
1461 margin: 0;
1462 padding: 0.45rem 0.7rem;
1463 border-top: 1px solid rgba(120, 128, 160, 0.35);
1464 color: #b8c4e8;
1465 font-size: 0.78rem;
1466 text-align: center;
1467 }
1468
1469 .preview-text {
1470 width: 100%;
1471 min-height: 100%;
1472 color: #dce4ff;
1473 background: #0d111a;
1474 border: 1px solid var(--border);
1475 border-radius: 8px;
1476 padding: 0.9rem;
1477 font: 0.85rem/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
1478 overflow: auto;
1479 white-space: pre;
1480 text-align: left;
1481 }
1482
1483 .preview-code .tok-comment {
1484 color: #6f7f9a;
1485 }
1486
1487 .preview-code .tok-string {
1488 color: #9ee37d;
1489 }
1490
1491 .preview-code .tok-number {
1492 color: #f8c46a;
1493 }
1494
1495 .preview-code .tok-keyword {
1496 color: #8bb4ff;
1497 font-weight: 600;
1498 }
1499
1500 .preview-code .tok-key {
1501 color: #59c8ff;
1502 }
1503
1504 .preview-unsupported {
1505 color: var(--text-muted);
1506 font-size: 0.95rem;
1507 max-width: 56ch;
1508 text-align: center;
1509 }
1510
1511 .preview-footer {
1512 border-top: 1px solid var(--border);
1513 padding: 0.8rem 1rem;
1514 display: flex;
1515 justify-content: flex-end;
1516 }
1517
1518 .preview-footer .primary {
1519 width: auto;
1520 margin-top: 0;
1521 min-width: 8rem;
1522 }
1523
1524
1525
1526 /* =========================================================
1527
1528 .toast-msg {
1529 background: var(--surface2);
1530 border: 1px solid var(--border);
1531 border-radius: 8px;
1532 padding: 0.6rem 1.25rem;
1533 font-size: 0.9rem;
1534 animation: slideup 0.25s ease;
1535 }
1536
1537 .toast-msg.err {
1538 border-color: var(--danger);
1539 color: var(--danger);
1540 }
1541
1542 .toast-msg.ok {
1543 border-color: var(--success);
1544 color: var(--success);
1545 }
1546
1547 @keyframes slideup {
1548 from {
1549 opacity: 0;
1550 transform: translateY(12px);
1551 }
1552
1553 to {
1554 opacity: 1;
1555 transform: translateY(0);
1556 }
1557 }
1558
1559 /* =========================================================
1560 UPLOAD PROGRESS
1561 ========================================================= */
1555 1562 .upload-bar-wrap {
1556 1563 position: fixed;
1557 1564 bottom: 0;
1558 1565 left: 0;
1559 1566 right: 0;
1560 background: var(--surface);
1561 border-top: 1px solid var(--border);
1562 padding: 0.5rem 1rem;
1563 z-index: 80;
1567 background: var(--surface);
1568 border-top: 1px solid var(--border);
1569 padding: 0.5rem 1rem;
1570 z-index: 80;
1564 1571 font-size: 0.85rem;
1565 1572 }
1566 1573
@@ -1598,180 +1605,180 @@ button.danger.admin-update-highlight {
1598 1605 background: var(--border);
1599 1606 border-radius: 3px;
1600 1607 margin-top: 0.3rem;
1601 }
1602
1603 .upload-bar-fill {
1604 height: 100%;
1605 background: var(--accent);
1606 border-radius: 3px;
1607 transition: width 0.2s linear;
1608 }
1609
1610 /* =========================================================
1611 RESPONSIVE — narrow screens
1612 ========================================================= */
1613 @media (max-width: 600px) {
1614 #topbar {
1615 height: auto;
1616 min-height: var(--topbar-h);
1617 padding: 0.5rem 0.6rem;
1618 align-items: flex-start;
1619 flex-direction: column;
1620 }
1621
1622 #topbar>#btn-refresh {
1623 align-self: flex-start;
1624 }
1625
1626 #breadcrumb-wrap {
1627 width: 100%;
1628 }
1629
1630 #topbar-actions {
1631 width: 100%;
1632 flex-wrap: wrap;
1633 gap: 0.15rem;
1634 }
1635
1636 .top-search {
1637 order: -1;
1638 width: 100%;
1639 margin-right: 0;
1640 }
1641
1642 .top-search input {
1643 flex: 1;
1644 min-width: 0;
1645 width: auto;
1646 }
1647
1648 .topbar-dropdown-menu {
1649 position: fixed;
1650 top: calc(var(--topbar-h) + 0.35rem);
1651 left: 0.6rem;
1652 right: 0.6rem;
1653 min-width: 0;
1654 }
1655
1656 .topbar-dropdown-menu--right {
1657 left: 0.6rem;
1658 right: 0.6rem;
1659 }
1660
1661 .icon-btn {
1662 padding: 0.4rem 0.55rem;
1663 font-size: 0.82rem;
1664 }
1665
1666 #main-content {
1667 padding: 0.9rem;
1668 }
1669
1670 #file-grid {
1671 grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
1672 }
1673
1674 #app.sidebar-open #main-content {
1675 margin-right: 0;
1676 }
1677
1678 #sidebar {
1679 top: auto;
1680 right: 0;
1681 bottom: 0;
1682 left: 0;
1683 height: auto;
1684 max-height: min(68vh, calc(100vh - 0.5rem));
1685 padding: 0.9rem 0.9rem 1rem;
1686 border-left: none;
1687 border-top: 1px solid var(--border);
1688 width: 100%;
1689 border-radius: 14px 14px 0 0;
1690 box-shadow: 0 -12px 26px rgba(0, 0, 0, 0.34);
1691 gap: 0.55rem;
1692 }
1693
1694 #sidebar-close {
1695 display: inline-flex;
1696 position: absolute;
1697 top: 0.45rem;
1698 right: 0.45rem;
1699 border-color: var(--border);
1700 background: var(--surface2);
1701 }
1702
1703 #sidebar-name {
1704 padding-right: 2rem;
1705 }
1706
1707 #sidebar-icon svg {
1708 width: 54px;
1709 height: 54px;
1710 }
1711
1712 #sidebar-actions {
1713 margin-top: 0.2rem;
1714 }
1715
1716 .modal {
1717 padding: 1.25rem;
1718 }
1719
1720 .preview-overlay {
1721 padding: 0.8rem;
1722 }
1723
1724 .preview-sheet {
1725 width: 100%;
1726 height: 92vh;
1727 }
1728
1729 .preview-fold {
1730 width: 54px;
1731 height: 54px;
1732 }
1733
1734 .preview-close {
1735 top: 5px;
1736 right: 5px;
1737 }
1738 }
1739
1740 /* =========================================================
1741 DIALOG MODALS (confirm / prompt / overwrite)
1742 ========================================================= */
1743 .dialog-message {
1744 color: var(--text-muted);
1745 font-size: 0.93rem;
1746 margin: 0 0 1.5rem;
1747 line-height: 1.5;
1748 word-break: break-word;
1749 }
1750
1751 .dialog-actions {
1752 display: flex;
1753 gap: 0.6rem;
1754 justify-content: flex-end;
1755 flex-wrap: wrap;
1756 }
1757
1758 .dialog-actions--overwrite {
1759 justify-content: space-between;
1760 }
1761
1762 .dialog-actions button {
1763 min-width: 5rem;
1764 background: var(--surface2);
1765 color: var(--text);
1766 padding: 0.5rem 1rem;
1767 }
1768
1769 .dialog-actions button:hover {
1770 background: var(--border);
1771 }
1772
1773 /* Override .primary full-width inside dialog rows */
1774 .dialog-actions button.primary {
1775 width: auto;
1776 margin-top: 0;
1608 }
1609
1610 .upload-bar-fill {
1611 height: 100%;
1612 background: var(--accent);
1613 border-radius: 3px;
1614 transition: width 0.2s linear;
1615 }
1616
1617 /* =========================================================
1618 RESPONSIVE — narrow screens
1619 ========================================================= */
1620 @media (max-width: 600px) {
1621 #topbar {
1622 height: auto;
1623 min-height: var(--topbar-h);
1624 padding: 0.5rem 0.6rem;
1625 align-items: flex-start;
1626 flex-direction: column;
1627 }
1628
1629 #topbar>#btn-refresh {
1630 align-self: flex-start;
1631 }
1632
1633 #breadcrumb-wrap {
1634 width: 100%;
1635 }
1636
1637 #topbar-actions {
1638 width: 100%;
1639 flex-wrap: wrap;
1640 gap: 0.15rem;
1641 }
1642
1643 .top-search {
1644 order: -1;
1645 width: 100%;
1646 margin-right: 0;
1647 }
1648
1649 .top-search input {
1650 flex: 1;
1651 min-width: 0;
1652 width: auto;
1653 }
1654
1655 .topbar-dropdown-menu {
1656 position: fixed;
1657 top: calc(var(--topbar-h) + 0.35rem);
1658 left: 0.6rem;
1659 right: 0.6rem;
1660 min-width: 0;
1661 }
1662
1663 .topbar-dropdown-menu--right {
1664 left: 0.6rem;
1665 right: 0.6rem;
1666 }
1667
1668 .icon-btn {
1669 padding: 0.4rem 0.55rem;
1670 font-size: 0.82rem;
1671 }
1672
1673 #main-content {
1674 padding: 0.9rem;
1675 }
1676
1677 #file-grid {
1678 grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
1679 }
1680
1681 #app.sidebar-open #main-content {
1682 margin-right: 0;
1683 }
1684
1685 #sidebar {
1686 top: auto;
1687 right: 0;
1688 bottom: 0;
1689 left: 0;
1690 height: auto;
1691 max-height: min(68vh, calc(100vh - 0.5rem));
1692 padding: 0.9rem 0.9rem 1rem;
1693 border-left: none;
1694 border-top: 1px solid var(--border);
1695 width: 100%;
1696 border-radius: 14px 14px 0 0;
1697 box-shadow: 0 -12px 26px rgba(0, 0, 0, 0.34);
1698 gap: 0.55rem;
1699 }
1700
1701 #sidebar-close {
1702 display: inline-flex;
1703 position: absolute;
1704 top: 0.45rem;
1705 right: 0.45rem;
1706 border-color: var(--border);
1707 background: var(--surface2);
1708 }
1709
1710 #sidebar-name {
1711 padding-right: 2rem;
1712 }
1713
1714 #sidebar-icon svg {
1715 width: 54px;
1716 height: 54px;
1717 }
1718
1719 #sidebar-actions {
1720 margin-top: 0.2rem;
1721 }
1722
1723 .modal {
1724 padding: 1.25rem;
1725 }
1726
1727 .preview-overlay {
1728 padding: 0.8rem;
1729 }
1730
1731 .preview-sheet {
1732 width: 100%;
1733 height: 92vh;
1734 }
1735
1736 .preview-fold {
1737 width: 54px;
1738 height: 54px;
1739 }
1740
1741 .preview-close {
1742 top: 5px;
1743 right: 5px;
1744 }
1745 }
1746
1747 /* =========================================================
1748 DIALOG MODALS (confirm / prompt / overwrite)
1749 ========================================================= */
1750 .dialog-message {
1751 color: var(--text-muted);
1752 font-size: 0.93rem;
1753 margin: 0 0 1.5rem;
1754 line-height: 1.5;
1755 word-break: break-word;
1756 }
1757
1758 .dialog-actions {
1759 display: flex;
1760 gap: 0.6rem;
1761 justify-content: flex-end;
1762 flex-wrap: wrap;
1763 }
1764
1765 .dialog-actions--overwrite {
1766 justify-content: space-between;
1767 }
1768
1769 .dialog-actions button {
1770 min-width: 5rem;
1771 background: var(--surface2);
1772 color: var(--text);
1773 padding: 0.5rem 1rem;
1774 }
1775
1776 .dialog-actions button:hover {
1777 background: var(--border);
1778 }
1779
1780 /* Override .primary full-width inside dialog rows */
1781 .dialog-actions button.primary {
1782 width: auto;
1783 margin-top: 0;
1777 1784 }
@@ -1,1566 +1,1573 @@
1/* =========================================================
1/* =========================================================
2 RESET & CUSTOM PROPERTIES
2 RESET & CUSTOM PROPERTIES
3 ========================================================= */
3 ========================================================= */
4*,
4*,
5*::before,
5*::before,
6*::after {
6*::after {
7 box-sizing: border-box;
7 box-sizing: border-box;
8 margin: 0;
8 margin: 0;
9 padding: 0;
9 padding: 0;
10}
10}
11
11
12:root {
12:root {
13 --bg: #0f1117;
13 --bg: #0f1117;
14 --surface: #1a1d27;
14 --surface: #1a1d27;
15 --surface2: #21242f;
15 --surface2: #21242f;
16 --border: #2e3247;
16 --border: #2e3247;
17 --accent: #5b7fff;
17 --accent: #5b7fff;
18 --accent-hover: #7b9fff;
18 --accent-hover: #7b9fff;
19 --text: #e8eaf0;
19 --text: #e8eaf0;
20 --text-muted: #7880a0;
20 --text-muted: #7880a0;
21 --danger: #e05c6e;
21 --danger: #e05c6e;
22 --success: #3fcf8e;
22 --success: #3fcf8e;
23 --radius: 10px;
23 --radius: 10px;
24 --topbar-h: 56px;
24 --topbar-h: 56px;
25 --sidebar-w: 300px;
25 --sidebar-w: 300px;
26 --transition: 0.18s ease;
26 --transition: 0.18s ease;
27}
27}
28
28
29html,
29html,
30body {
30body {
31 height: 100%;
31 height: 100%;
32 font-family: system-ui, -apple-system, sans-serif;
32 font-family: system-ui, -apple-system, sans-serif;
33}
33}
34
34
35body {
35body {
36 background: var(--bg);
36 background: var(--bg);
37 color: var(--text);
37 color: var(--text);
38 overflow: hidden;
38 overflow: hidden;
39}
39}
40
40
41.hidden {
41.hidden {
42 display: none !important;
42 display: none !important;
43}
43}
44
44
45.muted {
45.muted {
46 color: var(--text-muted);
46 color: var(--text-muted);
47}
47}
48
48
49.error {
49.error {
50 color: var(--danger);
50 color: var(--danger);
51 font-size: 0.85rem;
51 font-size: 0.85rem;
52 margin-top: 0.3rem;
52 margin-top: 0.3rem;
53}
53}
54
54
55/* =========================================================
55/* =========================================================
56 AUTH OVERLAY
56 AUTH OVERLAY
57 ========================================================= */
57 ========================================================= */
58.overlay {
58.overlay {
59 position: fixed;
59 position: fixed;
60 inset: 0;
60 inset: 0;
61 background: var(--bg);
61 background: var(--bg);
62 display: flex;
62 display: flex;
63 align-items: center;
63 align-items: center;
64 justify-content: center;
64 justify-content: center;
65 z-index: 100;
65 z-index: 100;
66}
66}
67
67
68.auth-card {
68.auth-card {
69 background: var(--surface);
69 background: var(--surface);
70 border: 1px solid var(--border);
70 border: 1px solid var(--border);
71 border-radius: var(--radius);
71 border-radius: var(--radius);
72 padding: 2.5rem 2rem;
72 padding: 2.5rem 2rem;
73 width: min(420px, 92vw);
73 width: min(420px, 92vw);
74}
74}
75
75
76.auth-card h1 {
76.auth-card h1 {
77 font-size: 1.6rem;
77 font-size: 1.6rem;
78 margin-bottom: 0.5rem;
78 margin-bottom: 0.5rem;
79}
79}
80
80
81.auth-subtitle {
81.auth-subtitle {
82 font-size: 0.88rem;
82 font-size: 0.88rem;
83 color: var(--text-muted);
83 color: var(--text-muted);
84 margin-bottom: 1.2rem;
84 margin-bottom: 1.2rem;
85}
85}
86
86
87#auth-form label {
87#auth-form label {
88 display: flex;
88 display: flex;
89 flex-direction: column;
89 flex-direction: column;
90 gap: 0.3rem;
90 gap: 0.3rem;
91 font-size: 0.85rem;
91 font-size: 0.85rem;
92 color: var(--text-muted);
92 color: var(--text-muted);
93 margin-bottom: 1rem;
93 margin-bottom: 1rem;
94}
94}
95
95
96#auth-form input {
96#auth-form input {
97 background: var(--bg);
97 background: var(--bg);
98 border: 1px solid var(--border);
98 border: 1px solid var(--border);
99 border-radius: 6px;
99 border-radius: 6px;
100 padding: 0.55rem 0.75rem;
100 padding: 0.55rem 0.75rem;
101 color: var(--text);
101 color: var(--text);
102 font-size: 1rem;
102 font-size: 1rem;
103 outline: none;
103 outline: none;
104 transition: border-color var(--transition);
104 transition: border-color var(--transition);
105}
105}
106
106
107#auth-form input:focus {
107#auth-form input:focus {
108 border-color: var(--accent);
108 border-color: var(--accent);
109}
109}
110
110
111/* =========================================================
111/* =========================================================
112 BUTTONS
112 BUTTONS
113 ========================================================= */
113 ========================================================= */
114button {
114button {
115 cursor: pointer;
115 cursor: pointer;
116 border: none;
116 border: none;
117 border-radius: 6px;
117 border-radius: 6px;
118 font-size: 0.9rem;
118 font-size: 0.9rem;
119 transition: background var(--transition), color var(--transition);
119 transition: background var(--transition), color var(--transition);
120}
120}
121
121
122.icon-btn {
122.icon-btn {
123 display: flex;
123 display: flex;
124 align-items: center;
124 align-items: center;
125 gap: 0.4rem;
125 gap: 0.4rem;
126 background: transparent;
126 background: transparent;
127 color: var(--text-muted);
127 color: var(--text-muted);
128 padding: 0.4rem 0.7rem;
128 padding: 0.4rem 0.7rem;
129 border-radius: 6px;
129 border-radius: 6px;
130 position: relative;
130 position: relative;
131}
131}
132
132
133.icon-btn:hover {
133.icon-btn:hover {
134 background: var(--surface2);
134 background: var(--surface2);
135 color: var(--text);
135 color: var(--text);
136}
136}
137
137
138.icon-btn svg {
138.icon-btn svg {
139 width: 18px;
139 width: 18px;
140 height: 18px;
140 height: 18px;
141}
141}
142
142
143.topbar-badge {
143.topbar-badge {
144 position: absolute;
144 position: absolute;
145 top: -0.25rem;
145 top: -0.25rem;
146 right: -0.3rem;
146 right: -0.3rem;
147 min-width: 1.1rem;
147 min-width: 1.1rem;
148 height: 1.1rem;
148 height: 1.1rem;
149 padding: 0 0.28rem;
149 padding: 0 0.28rem;
150 border-radius: 999px;
150 border-radius: 999px;
151 background: #d33131;
151 background: #d33131;
152 color: #fff;
152 color: #fff;
153 font-size: 0.68rem;
153 font-size: 0.68rem;
154 font-weight: 700;
154 font-weight: 700;
155 line-height: 1.1rem;
155 line-height: 1.1rem;
156 text-align: center;
156 text-align: center;
157 border: 1px solid var(--surface);
157 border: 1px solid var(--surface);
158}
158}
159
159
160button[type="submit"],
160button[type="submit"],
161.primary {
161.primary {
162 background: var(--accent);
162 background: var(--accent);
163 color: #fff;
163 color: #fff;
164 padding: 0.55rem 1.2rem;
164 padding: 0.55rem 1.2rem;
165 font-weight: 600;
165 font-weight: 600;
166 width: 100%;
166 width: 100%;
167 margin-top: 0.5rem;
167 margin-top: 0.5rem;
168}
168}
169
169
170button[type="submit"]:hover,
170button[type="submit"]:hover,
171.primary:hover {
171.primary:hover {
172 background: var(--accent-hover);
172 background: var(--accent-hover);
173}
173}
174
174
175button.danger {
175button.danger {
176 background: var(--surface2);
176 background: var(--surface2);
177 color: var(--danger);
177 color: var(--danger);
178 padding: 0.55rem 1.2rem;
178 padding: 0.55rem 1.2rem;
179 width: 100%;
179 width: 100%;
180 margin-top: 0.5rem;
180 margin-top: 0.5rem;
181}
181}
182
182
183button.danger:hover {
183button.danger:hover {
184 background: var(--border);
184 background: var(--border);
185}
185}
186
186
187button:disabled,
187button:disabled,
188input:disabled,
188input:disabled,
189select:disabled {
189select:disabled {
190 opacity: 0.55;
190 opacity: 0.55;
191 cursor: not-allowed;
191 cursor: not-allowed;
192}
192}
193
193
194button.danger.admin-update-highlight {
194button.danger.admin-update-highlight {
195 animation: admin-update-pulse 0.9s ease-in-out 2;
195 animation: admin-update-pulse 0.9s ease-in-out 2;
196}
196}
197
197
198@keyframes admin-update-pulse {
198@keyframes admin-update-pulse {
199 0% {
199 0% {
200 box-shadow: 0 0 0 0 rgba(211, 49, 49, 0.55);
200 box-shadow: 0 0 0 0 rgba(211, 49, 49, 0.55);
201 transform: scale(1);
201 transform: scale(1);
202 }
202 }
203
203
204 50% {
204 50% {
205 box-shadow: 0 0 0 10px rgba(211, 49, 49, 0);
205 box-shadow: 0 0 0 10px rgba(211, 49, 49, 0);
206 transform: scale(1.02);
206 transform: scale(1.02);
207 }
207 }
208
208
209 100% {
209 100% {
210 box-shadow: 0 0 0 0 rgba(211, 49, 49, 0);
210 box-shadow: 0 0 0 0 rgba(211, 49, 49, 0);
211 transform: scale(1);
211 transform: scale(1);
212 }
212 }
213}
213}
214
214
215/* =========================================================
215/* =========================================================
216 TOP BAR
216 TOP BAR
217 ========================================================= */
217 ========================================================= */
218#app {
218#app {
219 display: flex;
219 display: flex;
220 flex-direction: column;
220 flex-direction: column;
221 height: 100vh;
221 height: 100vh;
222}
222}
223
223
224#topbar {
224#topbar {
225 height: var(--topbar-h);
225 height: var(--topbar-h);
226 background: var(--surface);
226 background: var(--surface);
227 border-bottom: 1px solid var(--border);
227 border-bottom: 1px solid var(--border);
228 display: flex;
228 display: flex;
229 align-items: center;
229 align-items: center;
230 padding: 0 1rem;
230 padding: 0 1rem;
231 gap: 0.5rem;
231 gap: 0.5rem;
232 flex-shrink: 0;
232 flex-shrink: 0;
233}
233}
234
234
235#topbar>#btn-refresh {
235#topbar>#btn-refresh {
236 flex: 0 0 auto;
236 flex: 0 0 auto;
237}
237}
238
238
239#breadcrumb-wrap {
239#breadcrumb-wrap {
240 flex: 1;
240 flex: 1;
241 min-width: 0;
241 min-width: 0;
242}
242}
243
243
244#breadcrumb {
244#breadcrumb {
245 display: flex;
245 display: flex;
246 align-items: center;
246 align-items: center;
247 flex-wrap: wrap;
247 flex-wrap: wrap;
248 gap: 0.1rem;
248 gap: 0.1rem;
249 font-size: 0.9rem;
249 font-size: 0.9rem;
250 white-space: nowrap;
250 white-space: nowrap;
251 overflow: hidden;
251 overflow: hidden;
252}
252}
253
253
254#breadcrumb .crumb {
254#breadcrumb .crumb {
255 color: var(--text-muted);
255 color: var(--text-muted);
256 background: none;
256 background: none;
257 padding: 0.2rem 0.35rem;
257 padding: 0.2rem 0.35rem;
258 border-radius: 4px;
258 border-radius: 4px;
259 text-decoration: none;
259 text-decoration: none;
260 cursor: pointer;
260 cursor: pointer;
261}
261}
262
262
263#breadcrumb .crumb:hover {
263#breadcrumb .crumb:hover {
264 color: var(--text);
264 color: var(--text);
265 background: var(--surface2);
265 background: var(--surface2);
266}
266}
267
267
268#breadcrumb .crumb.active {
268#breadcrumb .crumb.active {
269 color: var(--text);
269 color: var(--text);
270 cursor: default;
270 cursor: default;
271}
271}
272
272
273#breadcrumb .sep {
273#breadcrumb .sep {
274 color: var(--border);
274 color: var(--border);
275 user-select: none;
275 user-select: none;
276}
276}
277
277
278#topbar-actions {
278#topbar-actions {
279 display: flex;
279 display: flex;
280 align-items: center;
280 align-items: center;
281 gap: 0.25rem;
281 gap: 0.25rem;
282 flex-shrink: 0;
282 flex-shrink: 0;
283 position: relative;
283 position: relative;
284}
284}
285
285
286.topbar-dropdown {
286.topbar-dropdown {
287 position: relative;
287 position: relative;
288}
288}
289
289
290.topbar-dropdown-menu {
290.topbar-dropdown-menu {
291 position: absolute;
291 position: absolute;
292 top: calc(100% + 0.4rem);
292 top: calc(100% + 0.4rem);
293 left: 0;
293 left: 0;
294 min-width: 180px;
294 min-width: 180px;
295 background: var(--surface);
295 background: var(--surface);
296 border: 1px solid var(--border);
296 border: 1px solid var(--border);
297 border-radius: var(--radius);
297 border-radius: var(--radius);
298 box-shadow: 0 12px 22px rgba(0, 0, 0, 0.28);
298 box-shadow: 0 12px 22px rgba(0, 0, 0, 0.28);
299 padding: 0.35rem;
299 padding: 0.35rem;
300 z-index: 140;
300 z-index: 140;
301 display: none;
301 display: none;
302}
302}
303
303
304.topbar-dropdown-menu--right {
304.topbar-dropdown-menu--right {
305 left: auto;
305 left: auto;
306 right: 0;
306 right: 0;
307}
307}
308
308
309.topbar-dropdown.open .topbar-dropdown-menu {
309.topbar-dropdown.open .topbar-dropdown-menu {
310 display: flex;
310 display: flex;
311 flex-direction: column;
311 flex-direction: column;
312 gap: 0.2rem;
312 gap: 0.2rem;
313}
313}
314
314
315.topbar-menu-item {
315.topbar-menu-item {
316 display: flex;
316 display: flex;
317 align-items: center;
317 align-items: center;
318 gap: 0.48rem;
318 gap: 0.48rem;
319 width: 100%;
319 width: 100%;
320 background: transparent;
320 background: transparent;
321 color: var(--text-muted);
321 color: var(--text-muted);
322 border-radius: 6px;
322 border-radius: 6px;
323 padding: 0.45rem 0.55rem;
323 padding: 0.45rem 0.55rem;
324 text-align: left;
324 text-align: left;
325 position: relative;
325 position: relative;
326}
326}
327
327
328.topbar-menu-item svg {
328a.topbar-menu-item {
329 width: 16px;
329 text-decoration: none;
330 height: 16px;
330 box-sizing: border-box;
331 flex: 0 0 auto;
331 font: inherit;
332}
332 min-height: 2.25rem;
333
333}
334.topbar-menu-item:hover {
334
335 background: var(--surface2);
335.topbar-menu-item svg {
336 color: var(--text);
336 width: 16px;
337}
337 height: 16px;
338
338 flex: 0 0 auto;
339.topbar-menu-item .topbar-badge {
339}
340 top: -0.24rem;
340
341 right: -0.22rem;
341.topbar-menu-item:hover {
342}
342 background: var(--surface2);
343
343 color: var(--text);
344.top-search {
344}
345 display: flex;
345
346 align-items: center;
346.topbar-menu-item .topbar-badge {
347 gap: 0.35rem;
347 top: -0.24rem;
348 margin-right: 0.2rem;
348 right: -0.22rem;
349}
349}
350
350
351.top-search input {
351.top-search {
352 width: min(34vw, 300px);
352 display: flex;
353 min-width: 150px;
353 align-items: center;
354 background: var(--bg);
354 gap: 0.35rem;
355 border: 1px solid var(--border);
355 margin-right: 0.2rem;
356 border-radius: 6px;
356}
357 color: var(--text);
357
358 font-size: 0.88rem;
358.top-search input {
359 padding: 0.42rem 0.6rem;
359 width: min(34vw, 300px);
360 outline: none;
360 min-width: 150px;
361}
361 background: var(--bg);
362
362 border: 1px solid var(--border);
363.top-search input:focus {
363 border-radius: 6px;
364 border-color: var(--accent);
364 color: var(--text);
365}
365 font-size: 0.88rem;
366
366 padding: 0.42rem 0.6rem;
367#btn-search {
367 outline: none;
368 padding: 0.36rem 0.62rem;
368}
369}
369
370
370.top-search input:focus {
371.global-favicon-preview {
371 border-color: var(--accent);
372 width: 18px;
372}
373 height: 18px;
373
374 display: inline-flex;
374#btn-search {
375 align-items: center;
375 padding: 0.36rem 0.62rem;
376 justify-content: center;
376}
377 border-radius: 4px;
377
378 overflow: hidden;
378.global-favicon-preview {
379 color: #fff;
379 width: 18px;
380}
380 height: 18px;
381
381 display: inline-flex;
382.global-favicon-preview svg,
382 align-items: center;
383.global-favicon-preview img {
383 justify-content: center;
384 width: 100%;
384 border-radius: 4px;
385 height: 100%;
385 overflow: hidden;
386 display: block;
386 color: #fff;
387 object-fit: cover;
387}
388}
388
389
389.global-favicon-preview svg,
390.icon-btn.icon-only {
390.global-favicon-preview img {
391 width: 2rem;
391 width: 100%;
392 height: 2rem;
392 height: 100%;
393 padding: 0;
393 display: block;
394 justify-content: center;
394 object-fit: cover;
395}
395}
396
396
397/* =========================================================
397.icon-btn.icon-only {
398 MAIN + SIDEBAR LAYOUT
398 width: 2rem;
399 ========================================================= */
399 height: 2rem;
400#main-content {
400 padding: 0;
401 flex: 1;
401 justify-content: center;
402 overflow-y: auto;
402}
403 padding: 1.25rem;
403
404 position: relative;
404/* =========================================================
405}
405 MAIN + SIDEBAR LAYOUT
406
406 ========================================================= */
407#folder-stats {
407#main-content {
408 margin-bottom: 0.8rem;
408 flex: 1;
409 font-size: 0.85rem;
409 overflow-y: auto;
410}
410 padding: 1.25rem;
411
411 position: relative;
412/* Drop overlay */
412}
413#drop-overlay {
413
414 position: absolute;
414#folder-stats {
415 inset: 0;
415 margin-bottom: 0.8rem;
416 background: rgba(91, 127, 255, 0.12);
416 font-size: 0.85rem;
417 border: 3px dashed var(--accent);
417}
418 border-radius: var(--radius);
418
419 display: flex;
419/* Drop overlay */
420 align-items: center;
420#drop-overlay {
421 justify-content: center;
421 position: absolute;
422 z-index: 10;
422 inset: 0;
423 font-size: 1.4rem;
423 background: rgba(91, 127, 255, 0.12);
424 color: var(--accent);
424 border: 3px dashed var(--accent);
425 pointer-events: none;
425 border-radius: var(--radius);
426}
426 display: flex;
427
427 align-items: center;
428/* When sidebar is open, shrink main content */
428 justify-content: center;
429#app.sidebar-open #main-content {
429 z-index: 10;
430 margin-right: var(--sidebar-w);
430 font-size: 1.4rem;
431}
431 color: var(--accent);
432
432 pointer-events: none;
433/* =========================================================
433}
434 FILE GRID
434
435 ========================================================= */
435/* When sidebar is open, shrink main content */
436#file-grid {
436#app.sidebar-open #main-content {
437 display: grid;
437 margin-right: var(--sidebar-w);
438 grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
438}
439 gap: 0.75rem;
439
440}
440/* =========================================================
441
441 FILE GRID
442.file-group-separator {
442 ========================================================= */
443 grid-column: 1 / -1;
443#file-grid {
444 display: flex;
444 display: grid;
445 align-items: center;
445 grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
446 gap: 0.55rem;
446 gap: 0.75rem;
447 margin-top: 0.1rem;
447}
448 margin-bottom: 0.1rem;
448
449 color: var(--text-muted);
449.file-group-separator {
450 font-size: 0.76rem;
450 grid-column: 1 / -1;
451 letter-spacing: 0.02em;
451 display: flex;
452}
452 align-items: center;
453
453 gap: 0.55rem;
454.file-group-separator::before,
454 margin-top: 0.1rem;
455.file-group-separator::after {
455 margin-bottom: 0.1rem;
456 content: '';
456 color: var(--text-muted);
457 height: 1px;
457 font-size: 0.76rem;
458 background: var(--border);
458 letter-spacing: 0.02em;
459 flex: 1;
459}
460}
460
461
461.file-group-separator::before,
462.file-group-separator span {
462.file-group-separator::after {
463 padding: 0.12rem 0.45rem;
463 content: '';
464 border: 1px solid var(--border);
464 height: 1px;
465 border-radius: 999px;
465 background: var(--border);
466 background: rgba(255, 255, 255, 0.02);
466 flex: 1;
467 white-space: nowrap;
467}
468}
468
469
469.file-group-separator span {
470.file-item {
470 padding: 0.12rem 0.45rem;
471 display: flex;
471 border: 1px solid var(--border);
472 flex-direction: column;
472 border-radius: 999px;
473 align-items: center;
473 background: rgba(255, 255, 255, 0.02);
474 padding: 0.9rem 0.5rem 0.7rem;
474 white-space: nowrap;
475 border-radius: var(--radius);
475}
476 border: 1px solid transparent;
476
477 cursor: pointer;
477.file-item {
478 user-select: none;
478 display: flex;
479 transition: background var(--transition), border-color var(--transition);
479 flex-direction: column;
480 text-align: center;
480 align-items: center;
481 gap: 0.4rem;
481 padding: 0.9rem 0.5rem 0.7rem;
482 position: relative;
482 border-radius: var(--radius);
483 touch-action: manipulation;
483 border: 1px solid transparent;
484}
484 cursor: pointer;
485
485 user-select: none;
486.file-item:hover {
486 transition: background var(--transition), border-color var(--transition);
487 background: var(--surface);
487 text-align: center;
488 border-color: var(--border);
488 gap: 0.4rem;
489}
489 position: relative;
490
490 touch-action: manipulation;
491.file-item.file-item--preview-placeholder {
491}
492 visibility: hidden;
492
493 pointer-events: none;
493.file-item:hover {
494}
494 background: var(--surface);
495
495 border-color: var(--border);
496.file-item.selected {
496}
497 background: var(--surface2);
497
498 border-color: var(--accent);
498.file-item.file-item--preview-placeholder {
499}
499 visibility: hidden;
500
500 pointer-events: none;
501.file-item .icon {
501}
502 width: 52px;
502
503 height: 52px;
503.file-item.selected {
504 display: flex;
504 background: var(--surface2);
505 align-items: center;
505 border-color: var(--accent);
506 justify-content: center;
506}
507 position: relative;
507
508}
508.file-item .icon {
509
509 width: 52px;
510.file-item .icon.thumb-pending::after {
510 height: 52px;
511 content: '';
511 display: flex;
512 position: absolute;
512 align-items: center;
513 width: 14px;
513 justify-content: center;
514 height: 14px;
514 position: relative;
515 left: 50%;
515}
516 top: 50%;
516
517 border: 2px solid rgba(232, 234, 240, 0.35);
517.file-item .icon.thumb-pending::after {
518 border-top-color: var(--accent);
518 content: '';
519 border-radius: 50%;
519 position: absolute;
520 animation: icon-thumb-spin 0.75s linear infinite;
520 width: 14px;
521 background: rgba(15, 17, 23, 0.85);
521 height: 14px;
522}
522 left: 50%;
523
523 top: 50%;
524@keyframes icon-thumb-spin {
524 border: 2px solid rgba(232, 234, 240, 0.35);
525 from {
525 border-top-color: var(--accent);
526 transform: translate(-50%, -50%) rotate(0deg);
526 border-radius: 50%;
527 }
527 animation: icon-thumb-spin 0.75s linear infinite;
528
528 background: rgba(15, 17, 23, 0.85);
529 to {
529}
530 transform: translate(-50%, -50%) rotate(360deg);
530
531 }
531@keyframes icon-thumb-spin {
532}
532 from {
533
533 transform: translate(-50%, -50%) rotate(0deg);
534.file-item .icon svg {
534 }
535 width: 100%;
535
536 height: 100%;
536 to {
537}
537 transform: translate(-50%, -50%) rotate(360deg);
538
538 }
539.file-item .icon .watched-overlay {
539}
540 position: absolute;
540
541 left: 50%;
541.file-item .icon svg {
542 top: 50%;
542 width: 100%;
543 width: 28px;
543 height: 100%;
544 height: 28px;
544}
545 transform: translate(-50%, -50%);
545
546 display: flex;
546.file-item .icon .watched-overlay {
547 align-items: center;
547 position: absolute;
548 justify-content: center;
548 left: 50%;
549 pointer-events: none;
549 top: 50%;
550 border-radius: 50%;
550 width: 28px;
551 background: rgba(15, 17, 23, 0.45);
551 height: 28px;
552}
552 transform: translate(-50%, -50%);
553
553 display: flex;
554.file-item .icon .watched-overlay--partway {
554 align-items: center;
555 width: 16.8px;
555 justify-content: center;
556 height: 16.8px;
556 pointer-events: none;
557}
557 border-radius: 50%;
558
558 background: rgba(15, 17, 23, 0.45);
559.file-item .icon .watched-overlay--partway path {
559}
560 fill: #8f98a5;
560
561}
561.file-item .icon .watched-overlay--partway {
562
562 width: 16.8px;
563.file-item .icon .watched-overlay-svg {
563 height: 16.8px;
564 width: 100%;
564}
565 height: 100%;
565
566}
566.file-item .icon .watched-overlay--partway path {
567
567 fill: #8f98a5;
568.file-item .name {
568}
569 font-size: 0.8rem;
569
570 word-break: normal;
570.file-item .icon .watched-overlay-svg {
571 overflow-wrap: anywhere;
571 width: 100%;
572 max-width: 100%;
572 height: 100%;
573 line-height: 1.3;
573}
574 color: var(--text);
574
575 white-space: normal;
575.file-item .name {
576 overflow: hidden;
576 font-size: 0.8rem;
577 text-overflow: ellipsis;
577 word-break: normal;
578 max-height: calc(1.3em * 4);
578 overflow-wrap: anywhere;
579 display: -webkit-box;
579 max-width: 100%;
580 -webkit-box-orient: vertical;
580 line-height: 1.3;
581 -webkit-line-clamp: 4;
581 color: var(--text);
582 line-clamp: 4;
582 white-space: normal;
583}
583 overflow: hidden;
584
584 text-overflow: ellipsis;
585/* =========================================================
585 max-height: calc(1.3em * 4);
586 SIDEBAR
586 display: -webkit-box;
587 ========================================================= */
587 -webkit-box-orient: vertical;
588#sidebar {
588 -webkit-line-clamp: 4;
589 position: fixed;
589 line-clamp: 4;
590 top: var(--topbar-h);
590}
591 right: 0;
591
592 bottom: 0;
592/* =========================================================
593 width: var(--sidebar-w);
593 SIDEBAR
594 background: var(--surface);
594 ========================================================= */
595 border-left: 1px solid var(--border);
595#sidebar {
596 padding: 1.25rem;
596 position: fixed;
597 overflow-y: auto;
597 top: var(--topbar-h);
598 z-index: 20;
598 right: 0;
599 display: flex;
599 bottom: 0;
600 flex-direction: column;
600 width: var(--sidebar-w);
601 gap: 0.75rem;
601 background: var(--surface);
602}
602 border-left: 1px solid var(--border);
603
603 padding: 1.25rem;
604#sidebar-close {
604 overflow-y: auto;
605 display: none;
605 z-index: 20;
606 align-items: center;
606 display: flex;
607 justify-content: center;
607 flex-direction: column;
608 width: 1.7rem;
608 gap: 0.75rem;
609 height: 1.7rem;
609}
610 border: 1px solid transparent;
610
611 border-radius: 999px;
611#sidebar-close {
612 background: transparent;
612 display: none;
613 color: var(--text-muted);
613 align-items: center;
614 font-size: 1rem;
614 justify-content: center;
615 line-height: 1;
615 width: 1.7rem;
616}
616 height: 1.7rem;
617
617 border: 1px solid transparent;
618#sidebar-close:hover {
618 border-radius: 999px;
619 background: var(--surface2);
619 background: transparent;
620 color: var(--text);
620 color: var(--text-muted);
621}
621 font-size: 1rem;
622
622 line-height: 1;
623#sidebar-icon {
623}
624 display: flex;
624
625 justify-content: center;
625#sidebar-close:hover {
626}
626 background: var(--surface2);
627
627 color: var(--text);
628#sidebar-icon svg {
628}
629 width: 64px;
629
630 height: 64px;
630#sidebar-icon {
631}
631 display: flex;
632
632 justify-content: center;
633#sidebar-name {
633}
634 font-size: 1rem;
634
635 word-break: break-all;
635#sidebar-icon svg {
636 text-align: center;
636 width: 64px;
637}
637 height: 64px;
638
638}
639#sidebar-meta {
639
640 display: grid;
640#sidebar-name {
641 grid-template-columns: auto 1fr;
641 font-size: 1rem;
642 gap: 0.3rem 0.75rem;
642 word-break: break-all;
643}
643 text-align: center;
644
644}
645#sidebar-meta dt {
645
646 color: var(--text-muted);
646#sidebar-meta {
647 font-size: 0.8rem;
647 display: grid;
648 font-weight: 600;
648 grid-template-columns: auto 1fr;
649}
649 gap: 0.3rem 0.75rem;
650
650}
651#sidebar-meta dd {
651
652 font-size: 0.8rem;
652#sidebar-meta dt {
653 word-break: break-all;
653 color: var(--text-muted);
654}
654 font-size: 0.8rem;
655
655 font-weight: 600;
656#sidebar-meta .root-access-list {
656}
657 margin: 0;
657
658 padding-left: 1rem;
658#sidebar-meta dd {
659}
659 font-size: 0.8rem;
660
660 word-break: break-all;
661#sidebar-meta .root-access-list li {
661}
662 margin: 0.12rem 0;
662
663}
663#sidebar-meta .root-access-list {
664
664 margin: 0;
665#sidebar-actions {
665 padding-left: 1rem;
666 display: flex;
666}
667 flex-direction: column;
667
668 gap: 0.5rem;
668#sidebar-meta .root-access-list li {
669 margin-top: 0.5rem;
669 margin: 0.12rem 0;
670}
670}
671
671
672#sidebar-actions button {
672#sidebar-actions {
673 background: var(--surface2);
673 display: flex;
674 color: var(--text);
674 flex-direction: column;
675 padding: 0.5rem 0.8rem;
675 gap: 0.5rem;
676 text-align: left;
676 margin-top: 0.5rem;
677}
677}
678
678
679#sidebar-actions button:hover {
679#sidebar-actions button {
680 background: var(--border);
680 background: var(--surface2);
681}
681 color: var(--text);
682
682 padding: 0.5rem 0.8rem;
683#sidebar-actions button.danger {
683 text-align: left;
684 color: var(--danger);
684}
685}
685
686
686#sidebar-actions button:hover {
687.sidebar-view-options {
687 background: var(--border);
688 display: flex;
688}
689 flex-direction: column;
689
690 gap: 0.5rem;
690#sidebar-actions button.danger {
691 border-top: 1px solid var(--border);
691 color: var(--danger);
692 padding-top: 0.7rem;
692}
693 margin-top: 0.2rem;
693
694}
694.sidebar-view-options {
695
695 display: flex;
696.sidebar-view-options h3 {
696 flex-direction: column;
697 margin: 0;
697 gap: 0.5rem;
698 font-size: 0.82rem;
698 border-top: 1px solid var(--border);
699 color: var(--text-muted);
699 padding-top: 0.7rem;
700 text-transform: uppercase;
700 margin-top: 0.2rem;
701 letter-spacing: 0.04em;
701}
702}
702
703
703.sidebar-view-options h3 {
704.sidebar-view-option-label {
704 margin: 0;
705 display: flex;
705 font-size: 0.82rem;
706 flex-direction: column;
706 color: var(--text-muted);
707 gap: 0.28rem;
707 text-transform: uppercase;
708 font-size: 0.8rem;
708 letter-spacing: 0.04em;
709 color: var(--text-muted);
709}
710}
710
711
711.sidebar-view-option-label {
712.sidebar-view-option-control {
712 display: flex;
713 width: 100%;
713 flex-direction: column;
714 background: var(--surface2);
714 gap: 0.28rem;
715 border: 1px solid var(--border);
715 font-size: 0.8rem;
716 border-radius: var(--radius);
716 color: var(--text-muted);
717 color: var(--text);
717}
718 padding: 0.42rem 0.5rem;
718
719}
719.sidebar-view-option-control {
720
720 width: 100%;
721.sidebar-view-toggle {
721 background: var(--surface2);
722 display: flex;
722 border: 1px solid var(--border);
723 align-items: center;
723 border-radius: var(--radius);
724 gap: 0.45rem;
724 color: var(--text);
725 font-size: 0.8rem;
725 padding: 0.42rem 0.5rem;
726 color: var(--text);
726}
727}
727
728
728.sidebar-view-toggle {
729.custom-context-menu {
729 display: flex;
730 position: fixed;
730 align-items: center;
731 min-width: 220px;
731 gap: 0.45rem;
732 max-width: min(320px, calc(100vw - 12px));
732 font-size: 0.8rem;
733 background: var(--surface);
733 color: var(--text);
734 border: 1px solid var(--border);
734}
735 border-radius: var(--radius);
735
736 box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
736.custom-context-menu {
737 padding: 0.35rem;
737 position: fixed;
738 z-index: 12000;
738 min-width: 220px;
739}
739 max-width: min(320px, calc(100vw - 12px));
740
740 background: var(--surface);
741.custom-context-menu button,
741 border: 1px solid var(--border);
742.custom-context-menu .custom-context-menu-item {
742 border-radius: var(--radius);
743 display: flex;
743 box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
744 align-items: center;
744 padding: 0.35rem;
745 justify-content: space-between;
745 z-index: 12000;
746 width: 100%;
746}
747 background: transparent;
747
748 color: var(--text);
748.custom-context-menu button,
749 padding: 0.45rem 0.55rem;
749.custom-context-menu .custom-context-menu-item {
750 text-align: left;
750 display: flex;
751 border-radius: 6px;
751 align-items: center;
752}
752 justify-content: space-between;
753
753 width: 100%;
754.custom-context-menu button:hover,
754 background: transparent;
755.custom-context-menu .custom-context-menu-item:hover {
755 color: var(--text);
756 background: var(--surface2);
756 padding: 0.45rem 0.55rem;
757}
757 text-align: left;
758
758 border-radius: 6px;
759.custom-context-menu button.danger,
759}
760.custom-context-menu .custom-context-menu-item.danger {
760
761 color: var(--danger);
761.custom-context-menu button:hover,
762}
762.custom-context-menu .custom-context-menu-item:hover {
763
763 background: var(--surface2);
764.custom-context-menu-separator {
764}
765 height: 1px;
765
766 background: var(--border);
766.custom-context-menu button.danger,
767 margin: 0.32rem 0;
767.custom-context-menu .custom-context-menu-item.danger {
768}
768 color: var(--danger);
769
769}
770.custom-context-menu-row {
770
771 position: relative;
771.custom-context-menu-separator {
772}
772 height: 1px;
773
773 background: var(--border);
774.custom-context-submenu {
774 margin: 0.32rem 0;
775 position: absolute;
775}
776 top: 0;
776
777 left: calc(100% + 0.3rem);
777.custom-context-menu-row {
778 min-width: 210px;
778 position: relative;
779 background: var(--surface);
779}
780 border: 1px solid var(--border);
780
781 border-radius: var(--radius);
781.custom-context-submenu {
782 box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
782 position: absolute;
783 padding: 0.35rem;
783 top: 0;
784 display: none;
784 left: calc(100% + 0.3rem);
785}
785 min-width: 210px;
786
786 background: var(--surface);
787.custom-context-menu-row:hover>.custom-context-submenu,
787 border: 1px solid var(--border);
788.custom-context-menu-row:focus-within>.custom-context-submenu {
788 border-radius: var(--radius);
789 display: block;
789 box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
790}
790 padding: 0.35rem;
791
791 display: none;
792/* ─── Duplicates panel ─────────────────────────────────── */
792}
793#sidebar-duplicates {
793
794 margin-top: 1rem;
794.custom-context-menu-row:hover>.custom-context-submenu,
795 border-top: 1px solid var(--border);
795.custom-context-menu-row:focus-within>.custom-context-submenu {
796 padding-top: 0.75rem;
796 display: block;
797}
797}
798
798
799.sidebar-duplicates-heading {
799/* ─── Duplicates panel ─────────────────────────────────── */
800 font-size: 0.75rem;
800#sidebar-duplicates {
801 font-weight: 600;
801 margin-top: 1rem;
802 text-transform: uppercase;
802 border-top: 1px solid var(--border);
803 letter-spacing: 0.05em;
803 padding-top: 0.75rem;
804 color: var(--text-muted, #888);
804}
805 margin: 0 0 0.4rem;
805
806}
806.sidebar-duplicates-heading {
807
807 font-size: 0.75rem;
808.sidebar-duplicates-list {
808 font-weight: 600;
809 list-style: none;
809 text-transform: uppercase;
810 margin: 0;
810 letter-spacing: 0.05em;
811 padding: 0;
811 color: var(--text-muted, #888);
812 display: flex;
812 margin: 0 0 0.4rem;
813 flex-direction: column;
813}
814 gap: 0.25rem;
814
815}
815.sidebar-duplicates-list {
816
816 list-style: none;
817.sidebar-duplicate-entry {
817 margin: 0;
818 display: block;
818 padding: 0;
819 width: 100%;
819 display: flex;
820 background: var(--surface2);
820 flex-direction: column;
821 color: var(--text);
821 gap: 0.25rem;
822 padding: 0.35rem 0.6rem;
822}
823 text-align: left;
823
824 font-size: 0.8rem;
824.sidebar-duplicate-entry {
825 white-space: nowrap;
825 display: block;
826 overflow: hidden;
826 width: 100%;
827 text-overflow: ellipsis;
827 background: var(--surface2);
828 border-radius: var(--radius);
828 color: var(--text);
829 cursor: pointer;
829 padding: 0.35rem 0.6rem;
830}
830 text-align: left;
831
831 font-size: 0.8rem;
832.sidebar-duplicate-entry:hover {
832 white-space: nowrap;
833 background: var(--border);
833 overflow: hidden;
834}
834 text-overflow: ellipsis;
835
835 border-radius: var(--radius);
836.admin-size-feedback {
836 cursor: pointer;
837 font-size: 0.82rem;
837}
838 margin: 0.25rem 0 0.5rem;
838
839 padding: 0.25rem 0.5rem;
839.sidebar-duplicate-entry:hover {
840 border-radius: var(--radius);
840 background: var(--border);
841}
841}
842
842
843.admin-size-feedback.ok {
843.admin-size-feedback {
844 color: var(--accent);
844 font-size: 0.82rem;
845}
845 margin: 0.25rem 0 0.5rem;
846
846 padding: 0.25rem 0.5rem;
847.admin-size-feedback.err {
847 border-radius: var(--radius);
848 color: #e55;
848}
849}
849
850
850.admin-size-feedback.ok {
851/* =========================================================
851 color: var(--accent);
852 MODALS
852}
853 ========================================================= */
853
854.modal-overlay {
854.admin-size-feedback.err {
855 position: fixed;
855 color: #e55;
856 inset: 0;
856}
857 background: rgba(0, 0, 0, 0.65);
857
858 display: flex;
858/* =========================================================
859 align-items: center;
859 MODALS
860 justify-content: center;
860 ========================================================= */
861 z-index: 11000;
861.modal-overlay {
862}
862 position: fixed;
863
863 inset: 0;
864#file-conflict-modal,
864 background: rgba(0, 0, 0, 0.65);
865#overwrite-modal {
865 display: flex;
866 z-index: 11150;
866 align-items: center;
867}
867 justify-content: center;
868
868 z-index: 11000;
869.modal {
869}
870 background: var(--surface);
870
871 border: 1px solid var(--border);
871#file-conflict-modal,
872 border-radius: var(--radius);
872#overwrite-modal {
873 padding: 2rem;
873 z-index: 11150;
874 width: min(560px, 94vw);
874}
875 max-height: 90vh;
875
876 overflow-y: auto;
876.modal {
877 position: relative;
877 background: var(--surface);
878}
878 border: 1px solid var(--border);
879
879 border-radius: var(--radius);
880.modal.small {
880 padding: 2rem;
881 width: min(340px, 94vw);
881 width: min(560px, 94vw);
882}
882 max-height: 90vh;
883
883 overflow-y: auto;
884#confirm-modal .modal.confirm-modal-wide {
884 position: relative;
885 width: min(760px, 94vw);
885}
886}
886
887
887.modal.small {
888.modal h2 {
888 width: min(340px, 94vw);
889 font-size: 1.3rem;
889}
890 margin-bottom: 1.25rem;
890
891}
891#confirm-modal .modal.confirm-modal-wide {
892
892 width: min(760px, 94vw);
893.modal h3 {
893}
894 font-size: 1rem;
894
895 color: var(--text-muted);
895.modal h2 {
896 margin: 1rem 0 0.5rem;
896 font-size: 1.3rem;
897}
897 margin-bottom: 1.25rem;
898
898}
899.modal-close {
899
900 position: absolute;
900.modal h3 {
901 top: 0.75rem;
901 font-size: 1rem;
902 right: 0.75rem;
902 color: var(--text-muted);
903 background: none;
903 margin: 1rem 0 0.5rem;
904 color: var(--text-muted);
904}
905 font-size: 1.1rem;
905
906 padding: 0.25rem 0.5rem;
906.modal-close {
907}
907 position: absolute;
908
908 top: 0.75rem;
909.modal-close:hover {
909 right: 0.75rem;
910 color: var(--text);
910 background: none;
911}
911 color: var(--text-muted);
912
912 font-size: 1.1rem;
913.update-commit-list {
913 padding: 0.25rem 0.5rem;
914 max-height: min(48vh, 420px);
914}
915 overflow: auto;
915
916 border: 1px solid var(--border);
916.modal-close:hover {
917 border-radius: 10px;
917 color: var(--text);
918 background: var(--bg);
918}
919 padding: 0.6rem 0.8rem;
919
920}
920.update-commit-list {
921
921 max-height: min(48vh, 420px);
922.update-commit-item+.update-commit-item {
922 overflow: auto;
923 margin-top: 0.9rem;
923 border: 1px solid var(--border);
924 padding-top: 0.9rem;
924 border-radius: 10px;
925 border-top: 1px solid var(--border);
925 background: var(--bg);
926}
926 padding: 0.6rem 0.8rem;
927
927}
928.update-commit-item h3 {
928
929 margin: 0;
929.update-commit-item+.update-commit-item {
930 font-size: 1.06rem;
930 margin-top: 0.9rem;
931 font-weight: 700;
931 padding-top: 0.9rem;
932 color: var(--text);
932 border-top: 1px solid var(--border);
933}
933}
934
934
935.update-commit-hash {
935.update-commit-item h3 {
936 color: var(--text-muted);
936 margin: 0;
937 font-weight: 600;
937 font-size: 1.06rem;
938 font-size: 0.9rem;
938 font-weight: 700;
939}
939 color: var(--text);
940
940}
941.update-commit-subject {
941
942 color: var(--text);
942.update-commit-hash {
943}
943 color: var(--text-muted);
944
944 font-weight: 600;
945.update-commit-body {
945 font-size: 0.9rem;
946 margin: 0.45rem 0 0;
946}
947 font-size: 0.94rem;
947
948 color: var(--text-muted);
948.update-commit-subject {
949 line-height: 1.45;
949 color: var(--text);
950}
950}
951
951
952/* =========================================================
952.update-commit-body {
953 FOLDER ICON PICKER
953 margin: 0.45rem 0 0;
954 ========================================================= */
954 font-size: 0.94rem;
955.folder-icon-modal {
955 color: var(--text-muted);
956 width: min(680px, 94vw);
956 line-height: 1.45;
957 max-height: 90vh;
957}
958 display: flex;
958
959 flex-direction: column;
959/* =========================================================
960 gap: 0.75rem;
960 FOLDER ICON PICKER
961 overflow: hidden;
961 ========================================================= */
962}
962.folder-icon-modal {
963
963 width: min(680px, 94vw);
964.folder-icon-grid {
964 max-height: 90vh;
965 display: grid;
965 display: flex;
966 grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
966 flex-direction: column;
967 gap: 0.5rem;
967 gap: 0.75rem;
968 max-height: 50vh;
968 overflow: hidden;
969 overflow-y: auto;
969}
970 padding: 0.25rem;
970
971 background: var(--bg);
971.folder-icon-grid {
972 border: 1px solid var(--border);
972 display: grid;
973 border-radius: var(--radius);
973 grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
974}
974 gap: 0.5rem;
975
975 max-height: 50vh;
976.folder-icon-filter {
976 overflow-y: auto;
977 width: 100%;
977 padding: 0.25rem;
978 background: var(--bg);
978 background: var(--bg);
979 border: 1px solid var(--border);
979 border: 1px solid var(--border);
980 border-radius: 6px;
980 border-radius: var(--radius);
981 color: var(--text);
981}
982 font-size: 0.9rem;
982
983 padding: 0.48rem 0.68rem;
983.folder-icon-filter {
984 outline: none;
984 width: 100%;
985}
985 background: var(--bg);
986
986 border: 1px solid var(--border);
987.folder-icon-filter:focus {
987 border-radius: 6px;
988 border-color: var(--accent);
988 color: var(--text);
989}
989 font-size: 0.9rem;
990
990 padding: 0.48rem 0.68rem;
991.debug-modal {
991 outline: none;
992 width: min(980px, 96vw);
992}
993 max-height: 92vh;
993
994}
994.folder-icon-filter:focus {
995
995 border-color: var(--accent);
996.debug-toolbar {
996}
997 display: flex;
997
998 justify-content: space-between;
998.debug-modal {
999 align-items: center;
999 width: min(980px, 96vw);
1000 gap: 0.8rem;
1000 max-height: 92vh;
1001 margin: 0.75rem 0 1rem;
1001}
1002}
1002
1003
1003.debug-toolbar {
1004.debug-section-head {
1004 display: flex;
1005 display: flex;
1005 justify-content: space-between;
1006 align-items: center;
1006 align-items: center;
1007 justify-content: space-between;
1007 gap: 0.8rem;
1008 gap: 0.8rem;
1008 margin: 0.75rem 0 1rem;
1009}
1009}
1010
1010
1011.debug-copy-btn {
1011.debug-section-head {
1012 padding: 0.3rem 0.55rem;
1012 display: flex;
1013 border-radius: 7px;
1013 align-items: center;
1014 font-size: 0.78rem;
1014 justify-content: space-between;
1015 border: 1px solid var(--border);
1015 gap: 0.8rem;
1016 background: var(--bg);
1016}
1017 color: var(--text-muted);
1017
1018}
1018.debug-copy-btn {
1019
1019 padding: 0.3rem 0.55rem;
1020.debug-copy-btn:hover {
1020 border-radius: 7px;
1021 color: var(--text);
1021 font-size: 0.78rem;
1022 border-color: var(--accent);
1022 border: 1px solid var(--border);
1023}
1023 background: var(--bg);
1024
1024 color: var(--text-muted);
1025.debug-summary-grid {
1025}
1026 display: grid;
1026
1027 grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
1027.debug-copy-btn:hover {
1028 gap: 0.6rem;
1028 color: var(--text);
1029 margin-bottom: 0.8rem;
1029 border-color: var(--accent);
1030}
1030}
1031
1031
1032.debug-summary-item {
1032.debug-summary-grid {
1033 background: var(--bg);
1033 display: grid;
1034 border: 1px solid var(--border);
1034 grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
1035 border-radius: 10px;
1035 gap: 0.6rem;
1036 padding: 0.55rem 0.7rem;
1036 margin-bottom: 0.8rem;
1037}
1037}
1038
1038
1039.debug-summary-item .k {
1039.debug-summary-item {
1040 display: block;
1040 background: var(--bg);
1041 color: var(--text-muted);
1041 border: 1px solid var(--border);
1042 font-size: 0.82rem;
1042 border-radius: 10px;
1043}
1043 padding: 0.55rem 0.7rem;
1044
1044}
1045.debug-summary-item .v {
1045
1046 display: block;
1046.debug-summary-item .k {
1047 color: var(--text);
1047 display: block;
1048 font-weight: 650;
1048 color: var(--text-muted);
1049 margin-top: 0.12rem;
1049 font-size: 0.82rem;
1050}
1050}
1051
1051
1052.debug-chips {
1052.debug-summary-item .v {
1053 display: flex;
1053 display: block;
1054 flex-wrap: wrap;
1054 color: var(--text);
1055 gap: 0.45rem;
1055 font-weight: 650;
1056}
1056 margin-top: 0.12rem;
1057
1057}
1058.debug-chip {
1058
1059 border: 1px solid var(--border);
1059.debug-chips {
1060 border-radius: 999px;
1060 display: flex;
1061 padding: 0.22rem 0.6rem;
1061 flex-wrap: wrap;
1062 background: var(--bg);
1062 gap: 0.45rem;
1063 font-size: 0.82rem;
1063}
1064}
1064
1065
1065.debug-chip {
1066.debug-table-wrap {
1066 border: 1px solid var(--border);
1067 border: 1px solid var(--border);
1067 border-radius: 999px;
1068 border-radius: 10px;
1068 padding: 0.22rem 0.6rem;
1069 overflow: auto;
1069 background: var(--bg);
1070 background: var(--bg);
1070 font-size: 0.82rem;
1071}
1071}
1072
1072
1073.debug-table {
1073.debug-table-wrap {
1074 width: 100%;
1074 border: 1px solid var(--border);
1075 border-collapse: collapse;
1075 border-radius: 10px;
1076 font-size: 0.85rem;
1076 overflow: auto;
1077}
1077 background: var(--bg);
1078
1078}
1079.debug-table th,
1079
1080.debug-table td {
1080.debug-table {
1081 border-bottom: 1px solid var(--border);
1081 width: 100%;
1082 text-align: left;
1082 border-collapse: collapse;
1083 vertical-align: top;
1083 font-size: 0.85rem;
1084 padding: 0.45rem 0.55rem;
1084}
1085}
1085
1086
1086.debug-table th,
1087.debug-table thead th {
1087.debug-table td {
1088 position: sticky;
1088 border-bottom: 1px solid var(--border);
1089 top: 0;
1089 text-align: left;
1090 z-index: 1;
1090 vertical-align: top;
1091 background: var(--surface);
1091 padding: 0.45rem 0.55rem;
1092}
1092}
1093
1093
1094.debug-table tr:last-child td {
1094.debug-table thead th {
1095 border-bottom: 0;
1095 position: sticky;
1096}
1096 top: 0;
1097
1097 z-index: 1;
1098.debug-path {
1098 background: var(--surface);
1099 font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
1099}
1100 word-break: break-word;
1100
1101}
1101.debug-table tr:last-child td {
1102
1102 border-bottom: 0;
1103.folder-icon-cell {
1103}
1104 display: flex;
1104
1105 flex-direction: column;
1105.debug-path {
1106 align-items: center;
1106 font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
1107 gap: 0.3rem;
1107 word-break: break-word;
1108 padding: 0.4rem;
1108}
1109 border-radius: var(--radius);
1109
1110 border: 2px solid transparent;
1110.folder-icon-cell {
1111 cursor: pointer;
1111 display: flex;
1112 transition: border-color var(--transition), background var(--transition);
1112 flex-direction: column;
1113}
1113 align-items: center;
1114
1114 gap: 0.3rem;
1115.folder-icon-cell:hover {
1115 padding: 0.4rem;
1116 background: var(--surface2);
1116 border-radius: var(--radius);
1117}
1117 border: 2px solid transparent;
1118
1118 cursor: pointer;
1119.folder-icon-cell.selected {
1119 transition: border-color var(--transition), background var(--transition);
1120 border-color: var(--accent);
1120}
1121 background: rgba(91, 127, 255, 0.12);
1121
1122}
1122.folder-icon-cell:hover {
1123
1123 background: var(--surface2);
1124.folder-icon-thumb {
1124}
1125 width: 60px;
1125
1126 height: 60px;
1126.folder-icon-cell.selected {
1127 object-fit: cover;
1127 border-color: var(--accent);
1128 border-radius: 4px;
1128 background: rgba(91, 127, 255, 0.12);
1129 background: var(--surface2);
1129}
1130}
1130
1131
1131.folder-icon-thumb {
1132.folder-icon-label {
1132 width: 60px;
1133 font-size: 0.68rem;
1133 height: 60px;
1134 color: var(--text-muted);
1134 object-fit: cover;
1135 word-break: break-all;
1135 border-radius: 4px;
1136 text-align: center;
1136 background: var(--surface2);
1137 max-width: 72px;
1137}
1138 overflow: hidden;
1138
1139 display: -webkit-box;
1139.folder-icon-label {
1140 -webkit-line-clamp: 2;
1140 font-size: 0.68rem;
1141 -webkit-box-orient: vertical;
1141 color: var(--text-muted);
1142}
1142 word-break: break-all;
1143
1143 text-align: center;
1144.vjs-text-track-cue>div {
1144 max-width: 72px;
1145 background: transparent !important;
1145 overflow: hidden;
1146 text-shadow: 2px 0 black, -2px 0 black, 0 2px black, 0 -2px black,
1146 display: -webkit-box;
1147 1px 1px black, -1px -1px black, 1px -1px black, -1px 1px black;
1147 -webkit-line-clamp: 2;
1148}
1148 -webkit-box-orient: vertical;
1149
1149}
1150/* Admin path list */
1150
1151.path-row {
1151.vjs-text-track-cue>div {
1152 display: flex;
1152 background: transparent !important;
1153 align-items: center;
1153 text-shadow: 2px 0 black, -2px 0 black, 0 2px black, 0 -2px black,
1154 gap: 0.5rem;
1154 1px 1px black, -1px -1px black, 1px -1px black, -1px 1px black;
1155 padding: 0.4rem 0;
1155}
1156 border-bottom: 1px solid var(--border);
1156
1157 font-size: 0.88rem;
1157/* Admin path list */
1158}
1158.path-row {
1159
1159 display: flex;
1160.path-row span {
1160 align-items: center;
1161 flex: 1;
1161 gap: 0.5rem;
1162 word-break: break-all;
1162 padding: 0.4rem 0;
1163}
1163 border-bottom: 1px solid var(--border);
1164
1164 font-size: 0.88rem;
1165.path-row button {
1165}
1166 background: none;
1166
1167 color: var(--danger);
1167.path-row span {
1168 padding: 0.2rem 0.5rem;
1168 flex: 1;
1169}
1169 word-break: break-all;
1170
1170}
1171.path-add-row {
1171
1172 display: flex;
1172.path-row button {
1173 gap: 0.5rem;
1173 background: none;
1174 margin: 0.5rem 0;
1174 color: var(--danger);
1175}
1175 padding: 0.2rem 0.5rem;
1176
1176}
1177.path-add-row input {
1177
1178 flex: 1;
1178.path-add-row {
1179 background: var(--bg);
1179 display: flex;
1180 border: 1px solid var(--border);
1180 gap: 0.5rem;
1181 border-radius: 6px;
1181 margin: 0.5rem 0;
1182 padding: 0.45rem 0.7rem;
1182}
1183 color: var(--text);
1183
1184 font-size: 0.9rem;
1184.path-add-row input {
1185 outline: none;
1185 flex: 1;
1186}
1186 background: var(--bg);
1187
1187 border: 1px solid var(--border);
1188.path-add-row input:focus {
1188 border-radius: 6px;
1189 border-color: var(--accent);
1189 padding: 0.45rem 0.7rem;
1190}
1190 color: var(--text);
1191
1191 font-size: 0.9rem;
1192.path-add-row button {
1192 outline: none;
1193 background: var(--surface2);
1193}
1194 color: var(--text);
1194
1195 padding: 0.45rem 0.9rem;
1195.path-add-row input:focus {
1196}
1196 border-color: var(--accent);
1197
1197}
1198.path-add-row button:hover {
1198
1199 background: var(--border);
1199.path-add-row button {
1200}
1200 background: var(--surface2);
1201
1201 color: var(--text);
1202.admin-favicon-row {
1202 padding: 0.45rem 0.9rem;
1203 display: flex;
1203}
1204 align-items: center;
1204
1205 justify-content: space-between;
1205.path-add-row button:hover {
1206 margin: 0.35rem 0 0.6rem;
1206 background: var(--border);
1207 font-size: 0.88rem;
1207}
1208 color: var(--text-muted);
1208
1209}
1209.admin-favicon-row {
1210
1210 display: flex;
1211.admin-favicon-row .icon-btn {
1211 align-items: center;
1212 color: var(--text);
1212 justify-content: space-between;
1213 background: var(--surface2);
1213 margin: 0.35rem 0 0.6rem;
1214}
1214 font-size: 0.88rem;
1215
1215 color: var(--text-muted);
1216.admin-favicon-row .icon-btn:hover {
1216}
1217 background: var(--border);
1217
1218}
1218.admin-favicon-row .icon-btn {
1219
1219 color: var(--text);
1220.admin-scheduled-restart {
1220 background: var(--surface2);
1221 margin: 0.4rem 0 0.8rem;
1221}
1222 padding: 0.6rem;
1222
1223 border: 1px solid var(--border);
1223.admin-favicon-row .icon-btn:hover {
1224 border-radius: var(--radius);
1224 background: var(--border);
1225 background: var(--bg);
1225}
1226}
1226
1227
1227.admin-scheduled-restart {
1228.admin-scheduled-restart.admin-scheduled-restart--disabled {
1228 margin: 0.4rem 0 0.8rem;
1229 opacity: 0.7;
1229 padding: 0.6rem;
1230}
1230 border: 1px solid var(--border);
1231
1231 border-radius: var(--radius);
1232.admin-scheduled-restart-toggle {
1232 background: var(--bg);
1233 margin-bottom: 0.5rem;
1233}
1234}
1234
1235
1235.admin-scheduled-restart.admin-scheduled-restart--disabled {
1236.admin-scheduled-restart-grid {
1236 opacity: 0.7;
1237 display: grid;
1237}
1238 grid-template-columns: 1fr 1fr;
1238
1239 gap: 0.6rem;
1239.admin-scheduled-restart-toggle {
1240}
1240 margin-bottom: 0.5rem;
1241
1241}
1242.admin-scheduled-restart-grid label {
1242
1243 display: flex;
1243.admin-scheduled-restart-grid {
1244 flex-direction: column;
1244 display: grid;
1245 gap: 0.28rem;
1245 grid-template-columns: 1fr 1fr;
1246 font-size: 0.82rem;
1246 gap: 0.6rem;
1247 color: var(--text-muted);
1247}
1248}
1248
1249
1249.admin-scheduled-restart-grid label {
1250.admin-scheduled-restart-grid input,
1250 display: flex;
1251.admin-scheduled-restart-grid select {
1251 flex-direction: column;
1252 background: var(--surface2);
1252 gap: 0.28rem;
1253 border: 1px solid var(--border);
1253 font-size: 0.82rem;
1254 border-radius: 6px;
1254 color: var(--text-muted);
1255 color: var(--text);
1255}
1256 padding: 0.4rem 0.55rem;
1256
1257}
1257.admin-scheduled-restart-grid input,
1258
1258.admin-scheduled-restart-grid select {
1259/* User list */
1259 background: var(--surface2);
1260.user-row {
1260 border: 1px solid var(--border);
1261 display: flex;
1261 border-radius: 6px;
1262 align-items: center;
1262 color: var(--text);
1263 gap: 0.6rem;
1263 padding: 0.4rem 0.55rem;
1264 padding: 0.5rem 0;
1264}
1265 border-bottom: 1px solid var(--border);
1265
1266}
1266/* User list */
1267
1267.user-row {
1268.user-row .user-name {
1268 display: flex;
1269 flex: 1;
1269 align-items: center;
1270 font-weight: 600;
1270 gap: 0.6rem;
1271 font-size: 0.9rem;
1271 padding: 0.5rem 0;
1272}
1272 border-bottom: 1px solid var(--border);
1273
1273}
1274.user-row .user-admin-badge {
1274
1275 font-size: 0.72rem;
1275.user-row .user-name {
1276 background: var(--accent);
1276 flex: 1;
1277 color: #fff;
1277 font-weight: 600;
1278 border-radius: 4px;
1278 font-size: 0.9rem;
1279 padding: 0.1rem 0.4rem;
1279}
1280}
1280
1281
1281.user-row .user-admin-badge {
1282.user-row button {
1282 font-size: 0.72rem;
1283 background: none;
1283 background: var(--accent);
1284 color: var(--text-muted);
1284 color: #fff;
1285 padding: 0.2rem 0.5rem;
1285 border-radius: 4px;
1286 font-size: 0.85rem;
1286 padding: 0.1rem 0.4rem;
1287}
1287}
1288
1288
1289.user-row button:hover {
1289.user-row button {
1290 color: var(--text);
1290 background: none;
1291}
1291 color: var(--text-muted);
1292
1292 padding: 0.2rem 0.5rem;
1293.user-row button.danger {
1293 font-size: 0.85rem;
1294 color: var(--danger);
1294}
1295}
1295
1296
1296.user-row button:hover {
1297#admin-orphan-userfolders-section {
1297 color: var(--text);
1298 margin-top: 1rem;
1298}
1299 padding-top: 0.55rem;
1299
1300 border-top: 1px solid var(--border);
1300.user-row button.danger {
1301}
1301 color: var(--danger);
1302
1302}
1303#admin-orphan-userfolders-section h4 {
1303
1304 margin: 0 0 0.35rem;
1304#admin-orphan-userfolders-section {
1305 font-size: 0.86rem;
1305 margin-top: 1rem;
1306 color: var(--text);
1306 padding-top: 0.55rem;
1307}
1307 border-top: 1px solid var(--border);
1308
1308}
1309.orphan-folder-row .orphan-folder-meta {
1309
1310 font-size: 0.8rem;
1310#admin-orphan-userfolders-section h4 {
1311 color: var(--text-muted);
1311 margin: 0 0 0.35rem;
1312}
1312 font-size: 0.86rem;
1313
1313 color: var(--text);
1314/* User form permissions */
1314}
1315#user-permissions {
1315
1316 margin-top: 0.75rem;
1316.orphan-folder-row .orphan-folder-meta {
1317}
1317 font-size: 0.8rem;
1318
1318 color: var(--text-muted);
1319#user-permissions h4 {
1319}
1320 font-size: 0.85rem;
1320
1321 color: var(--text-muted);
1321/* User form permissions */
1322 margin-bottom: 0.4rem;
1322#user-permissions {
1323}
1323 margin-top: 0.75rem;
1324
1324}
1325.perm-row {
1325
1326 display: flex;
1326#user-permissions h4 {
1327 align-items: center;
1327 font-size: 0.85rem;
1328 gap: 0.75rem;
1328 color: var(--text-muted);
1329 flex-wrap: wrap;
1329 margin-bottom: 0.4rem;
1330 font-size: 0.85rem;
1330}
1331 margin-bottom: 0.4rem;
1331
1332}
1332.perm-row {
1333
1333 display: flex;
1334.perm-row .perm-label {
1334 align-items: center;
1335 min-width: 130px;
1335 gap: 0.75rem;
1336 color: var(--text);
1336 flex-wrap: wrap;
1337}
1337 font-size: 0.85rem;
1338
1338 margin-bottom: 0.4rem;
1339.checkbox-label {
1339}
1340 display: flex;
1340
1341 align-items: center;
1341.perm-row .perm-label {
1342 gap: 0.5rem;
1342 min-width: 130px;
1343 font-size: 0.9rem;
1343 color: var(--text);
1344 margin-bottom: 0.5rem;
1344}
1345}
1345
1346
1346.checkbox-label {
1347.checkbox-label input[type="checkbox"] {
1347 display: flex;
1348 width: 16px;
1348 align-items: center;
1349 height: 16px;
1349 gap: 0.5rem;
1350 accent-color: var(--accent);
1350 font-size: 0.9rem;
1351}
1351 margin-bottom: 0.5rem;
1352
1352}
1353/* Form labels in modals */
1353
1354.modal form label {
1354.checkbox-label input[type="checkbox"] {
1355 display: flex;
1355 width: 16px;
1356 flex-direction: column;
1356 height: 16px;
1357 gap: 0.3rem;
1357 accent-color: var(--accent);
1358 font-size: 0.85rem;
1358}
1359 color: var(--text-muted);
1359
1360 margin-bottom: 0.9rem;
1360/* Form labels in modals */
1361}
1361.modal form label {
1362
1362 display: flex;
1363.modal form input[type="text"],
1363 flex-direction: column;
1364.modal form input[type="password"] {
1364 gap: 0.3rem;
1365 background: var(--bg);
1365 font-size: 0.85rem;
1366 border: 1px solid var(--border);
1366 color: var(--text-muted);
1367 border-radius: 6px;
1367 margin-bottom: 0.9rem;
1368 padding: 0.5rem 0.75rem;
1368}
1369 color: var(--text);
1369
1370 font-size: 0.95rem;
1370.modal form input[type="text"],
1371 outline: none;
1371.modal form input[type="password"] {
1372 transition: border-color var(--transition);
1372 background: var(--bg);
1373}
1373 border: 1px solid var(--border);
1374
1374 border-radius: 6px;
1375.modal form input:focus {
1375 padding: 0.5rem 0.75rem;
1376 border-color: var(--accent);
1376 color: var(--text);
1377}
1377 font-size: 0.95rem;
1378
1378 outline: none;
1379/* Admin user-folder controls use the same visual language as modal forms. */
1379 transition: border-color var(--transition);
1380#admin-userfolder-section label {
1380}
1381 display: flex;
1381
1382 flex-direction: column;
1382.modal form input:focus {
1383 gap: 0.3rem;
1383 border-color: var(--accent);
1384 font-size: 0.85rem;
1384}
1385 color: var(--text-muted);
1385
1386 margin-bottom: 0.9rem;
1386/* Admin user-folder controls use the same visual language as modal forms. */
1387}
1387#admin-userfolder-section label {
1388
1388 display: flex;
1389#admin-userfolder-section input[type="text"] {
1389 flex-direction: column;
1390 background: var(--bg);
1390 gap: 0.3rem;
1391 border: 1px solid var(--border);
1391 font-size: 0.85rem;
1392 border-radius: 6px;
1392 color: var(--text-muted);
1393 padding: 0.5rem 0.75rem;
1393 margin-bottom: 0.9rem;
1394 color: var(--text);
1394}
1395 font-size: 0.95rem;
1395
1396 outline: none;
1396#admin-userfolder-section input[type="text"] {
1397 transition: border-color var(--transition);
1397 background: var(--bg);
1398}
1398 border: 1px solid var(--border);
1399
1399 border-radius: 6px;
1400#admin-userfolder-section input[type="text"]:focus {
1400 padding: 0.5rem 0.75rem;
1401 border-color: var(--accent);
1401 color: var(--text);
1402}
1402 font-size: 0.95rem;
1403
1403 outline: none;
1404/* =========================================================
1404 transition: border-color var(--transition);
1405 FILE PREVIEW — SHARED MEDIA STYLES
1405}
1406 ========================================================= */
1406
1407.preview-media {
1407#admin-userfolder-section input[type="text"]:focus {
1408 max-width: 100%;
1408 border-color: var(--accent);
1409 max-height: 100%;
1409}
1410 width: auto;
1410
1411 height: auto;
1411/* =========================================================
1412 object-fit: contain;
1412 FILE PREVIEW — SHARED MEDIA STYLES
1413}
1413 ========================================================= */
1414
1414.preview-media {
1415.preview-frame {
1415 max-width: 100%;
1416 width: 100%;
1416 max-height: 100%;
1417 height: 100%;
1417 width: auto;
1418 border: none;
1418 height: auto;
1419 border-radius: 8px;
1419 object-fit: contain;
1420 background: #fff;
1420}
1421}
1421
1422
1422.preview-frame {
1423.preview-audio {
1423 width: 100%;
1424 width: min(640px, 95%);
1424 height: 100%;
1425}
1425 border: none;
1426
1426 border-radius: 8px;
1427.preview-model-wrap {
1427 background: #fff;
1428 width: 100%;
1428}
1429 height: 100%;
1429
1430 min-height: 240px;
1430.preview-audio {
1431 border: 1px solid var(--border);
1431 width: min(640px, 95%);
1432 border-radius: 8px;
1432}
1433 background: #0d111a;
1433
1434 display: flex;
1434.preview-model-wrap {
1435 flex-direction: column;
1435 width: 100%;
1436 align-items: stretch;
1436 height: 100%;
1437 justify-content: stretch;
1437 min-height: 240px;
1438 overflow: hidden;
1438 border: 1px solid var(--border);
1439}
1439 border-radius: 8px;
1440
1440 background: #0d111a;
1441.preview-model-canvas {
1441 display: flex;
1442 flex: 1 1 auto;
1442 flex-direction: column;
1443 width: 100%;
1443 align-items: stretch;
1444 min-height: 180px;
1444 justify-content: stretch;
1445 display: block;
1445 overflow: hidden;
1446 cursor: grab;
1446}
1447}
1447
1448
1448.preview-model-canvas {
1449.preview-model-canvas:active {
1449 flex: 1 1 auto;
1450 cursor: grabbing;
1450 width: 100%;
1451}
1451 min-height: 180px;
1452
1452 display: block;
1453.preview-model-hint {
1453 cursor: grab;
1454 margin: 0;
1454}
1455 padding: 0.45rem 0.7rem;
1455
1456 border-top: 1px solid rgba(120, 128, 160, 0.35);
1456.preview-model-canvas:active {
1457 color: #b8c4e8;
1457 cursor: grabbing;
1458 font-size: 0.78rem;
1458}
1459 text-align: center;
1459
1460}
1460.preview-model-hint {
1461
1461 margin: 0;
1462.preview-text {
1462 padding: 0.45rem 0.7rem;
1463 width: 100%;
1463 border-top: 1px solid rgba(120, 128, 160, 0.35);
1464 min-height: 100%;
1464 color: #b8c4e8;
1465 color: #dce4ff;
1465 font-size: 0.78rem;
1466 background: #0d111a;
1466 text-align: center;
1467 border: 1px solid var(--border);
1467}
1468 border-radius: 8px;
1468
1469 padding: 0.9rem;
1469.preview-text {
1470 font: 0.85rem/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
1470 width: 100%;
1471 overflow: auto;
1471 min-height: 100%;
1472 white-space: pre;
1472 color: #dce4ff;
1473 text-align: left;
1473 background: #0d111a;
1474}
1474 border: 1px solid var(--border);
1475
1475 border-radius: 8px;
1476.preview-code .tok-comment {
1476 padding: 0.9rem;
1477 color: #6f7f9a;
1477 font: 0.85rem/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
1478}
1478 overflow: auto;
1479
1479 white-space: pre;
1480.preview-code .tok-string {
1480 text-align: left;
1481 color: #9ee37d;
1481}
1482}
1482
1483
1483.preview-code .tok-comment {
1484.preview-code .tok-number {
1484 color: #6f7f9a;
1485 color: #f8c46a;
1485}
1486}
1486
1487
1487.preview-code .tok-string {
1488.preview-code .tok-keyword {
1488 color: #9ee37d;
1489 color: #8bb4ff;
1489}
1490 font-weight: 600;
1490
1491}
1491.preview-code .tok-number {
1492
1492 color: #f8c46a;
1493.preview-code .tok-key {
1493}
1494 color: #59c8ff;
1494
1495}
1495.preview-code .tok-keyword {
1496
1496 color: #8bb4ff;
1497.preview-unsupported {
1497 font-weight: 600;
1498 color: var(--text-muted);
1498}
1499 font-size: 0.95rem;
1499
1500 max-width: 56ch;
1500.preview-code .tok-key {
1501 text-align: center;
1501 color: #59c8ff;
1502}
1502}
1503
1503
1504.preview-footer {
1504.preview-unsupported {
1505 border-top: 1px solid var(--border);
1505 color: var(--text-muted);
1506 padding: 0.8rem 1rem;
1506 font-size: 0.95rem;
1507 display: flex;
1507 max-width: 56ch;
1508 justify-content: flex-end;
1508 text-align: center;
1509}
1509}
1510
1510
1511.preview-footer .primary {
1511.preview-footer {
1512 width: auto;
1512 border-top: 1px solid var(--border);
1513 margin-top: 0;
1513 padding: 0.8rem 1rem;
1514 min-width: 8rem;
1514 display: flex;
1515}
1515 justify-content: flex-end;
1516
1516}
1517
1517
1518
1518.preview-footer .primary {
1519/* =========================================================
1519 width: auto;
1520
1520 margin-top: 0;
1521.toast-msg {
1521 min-width: 8rem;
1522 background: var(--surface2);
1522}
1523 border: 1px solid var(--border);
1523
1524 border-radius: 8px;
1524
1525 padding: 0.6rem 1.25rem;
1525
1526 font-size: 0.9rem;
1526/* =========================================================
1527 animation: slideup 0.25s ease;
1527
1528}
1528.toast-msg {
1529
1529 background: var(--surface2);
1530.toast-msg.err {
1530 border: 1px solid var(--border);
1531 border-color: var(--danger);
1531 border-radius: 8px;
1532 color: var(--danger);
1532 padding: 0.6rem 1.25rem;
1533}
1533 font-size: 0.9rem;
1534
1534 animation: slideup 0.25s ease;
1535.toast-msg.ok {
1535}
1536 border-color: var(--success);
1536
1537 color: var(--success);
1537.toast-msg.err {
1538}
1538 border-color: var(--danger);
1539
1539 color: var(--danger);
1540@keyframes slideup {
1540}
1541 from {
1541
1542 opacity: 0;
1542.toast-msg.ok {
1543 transform: translateY(12px);
1543 border-color: var(--success);
1544 }
1544 color: var(--success);
1545
1545}
1546 to {
1546
1547 opacity: 1;
1547@keyframes slideup {
1548 transform: translateY(0);
1548 from {
1549 }
1549 opacity: 0;
1550}
1550 transform: translateY(12px);
1551
1551 }
1552/* =========================================================
1552
1553 UPLOAD PROGRESS
1553 to {
1554 ========================================================= */
1554 opacity: 1;
1555 transform: translateY(0);
1556 }
1557}
1558
1559/* =========================================================
1560 UPLOAD PROGRESS
1561 ========================================================= */
1555.upload-bar-wrap {
1562.upload-bar-wrap {
1556 position: fixed;
1563 position: fixed;
1557 bottom: 0;
1564 bottom: 0;
1558 left: 0;
1565 left: 0;
1559 right: 0;
1566 right: 0;
1560 background: var(--surface);
1567 background: var(--surface);
1561 border-top: 1px solid var(--border);
1568 border-top: 1px solid var(--border);
1562 padding: 0.5rem 1rem;
1569 padding: 0.5rem 1rem;
1563 z-index: 80;
1570 z-index: 80;
1564 font-size: 0.85rem;
1571 font-size: 0.85rem;
1565}
1572}
1566
1573
@@ -1598,180 +1605,180 @@ button.danger.admin-update-highlight {
1598 background: var(--border);
1605 background: var(--border);
1599 border-radius: 3px;
1606 border-radius: 3px;
1600 margin-top: 0.3rem;
1607 margin-top: 0.3rem;
1601}
1608}
1602
1609
1603.upload-bar-fill {
1610.upload-bar-fill {
1604 height: 100%;
1611 height: 100%;
1605 background: var(--accent);
1612 background: var(--accent);
1606 border-radius: 3px;
1613 border-radius: 3px;
1607 transition: width 0.2s linear;
1614 transition: width 0.2s linear;
1608}
1615}
1609
1616
1610/* =========================================================
1617/* =========================================================
1611 RESPONSIVE — narrow screens
1618 RESPONSIVE — narrow screens
1612 ========================================================= */
1619 ========================================================= */
1613@media (max-width: 600px) {
1620@media (max-width: 600px) {
1614 #topbar {
1621 #topbar {
1615 height: auto;
1622 height: auto;
1616 min-height: var(--topbar-h);
1623 min-height: var(--topbar-h);
1617 padding: 0.5rem 0.6rem;
1624 padding: 0.5rem 0.6rem;
1618 align-items: flex-start;
1625 align-items: flex-start;
1619 flex-direction: column;
1626 flex-direction: column;
1620 }
1627 }
1621
1628
1622 #topbar>#btn-refresh {
1629 #topbar>#btn-refresh {
1623 align-self: flex-start;
1630 align-self: flex-start;
1624 }
1631 }
1625
1632
1626 #breadcrumb-wrap {
1633 #breadcrumb-wrap {
1627 width: 100%;
1634 width: 100%;
1628 }
1635 }
1629
1636
1630 #topbar-actions {
1637 #topbar-actions {
1631 width: 100%;
1638 width: 100%;
1632 flex-wrap: wrap;
1639 flex-wrap: wrap;
1633 gap: 0.15rem;
1640 gap: 0.15rem;
1634 }
1641 }
1635
1642
1636 .top-search {
1643 .top-search {
1637 order: -1;
1644 order: -1;
1638 width: 100%;
1645 width: 100%;
1639 margin-right: 0;
1646 margin-right: 0;
1640 }
1647 }
1641
1648
1642 .top-search input {
1649 .top-search input {
1643 flex: 1;
1650 flex: 1;
1644 min-width: 0;
1651 min-width: 0;
1645 width: auto;
1652 width: auto;
1646 }
1653 }
1647
1654
1648 .topbar-dropdown-menu {
1655 .topbar-dropdown-menu {
1649 position: fixed;
1656 position: fixed;
1650 top: calc(var(--topbar-h) + 0.35rem);
1657 top: calc(var(--topbar-h) + 0.35rem);
1651 left: 0.6rem;
1658 left: 0.6rem;
1652 right: 0.6rem;
1659 right: 0.6rem;
1653 min-width: 0;
1660 min-width: 0;
1654 }
1661 }
1655
1662
1656 .topbar-dropdown-menu--right {
1663 .topbar-dropdown-menu--right {
1657 left: 0.6rem;
1664 left: 0.6rem;
1658 right: 0.6rem;
1665 right: 0.6rem;
1659 }
1666 }
1660
1667
1661 .icon-btn {
1668 .icon-btn {
1662 padding: 0.4rem 0.55rem;
1669 padding: 0.4rem 0.55rem;
1663 font-size: 0.82rem;
1670 font-size: 0.82rem;
1664 }
1671 }
1665
1672
1666 #main-content {
1673 #main-content {
1667 padding: 0.9rem;
1674 padding: 0.9rem;
1668 }
1675 }
1669
1676
1670 #file-grid {
1677 #file-grid {
1671 grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
1678 grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
1672 }
1679 }
1673
1680
1674 #app.sidebar-open #main-content {
1681 #app.sidebar-open #main-content {
1675 margin-right: 0;
1682 margin-right: 0;
1676 }
1683 }
1677
1684
1678 #sidebar {
1685 #sidebar {
1679 top: auto;
1686 top: auto;
1680 right: 0;
1687 right: 0;
1681 bottom: 0;
1688 bottom: 0;
1682 left: 0;
1689 left: 0;
1683 height: auto;
1690 height: auto;
1684 max-height: min(68vh, calc(100vh - 0.5rem));
1691 max-height: min(68vh, calc(100vh - 0.5rem));
1685 padding: 0.9rem 0.9rem 1rem;
1692 padding: 0.9rem 0.9rem 1rem;
1686 border-left: none;
1693 border-left: none;
1687 border-top: 1px solid var(--border);
1694 border-top: 1px solid var(--border);
1688 width: 100%;
1695 width: 100%;
1689 border-radius: 14px 14px 0 0;
1696 border-radius: 14px 14px 0 0;
1690 box-shadow: 0 -12px 26px rgba(0, 0, 0, 0.34);
1697 box-shadow: 0 -12px 26px rgba(0, 0, 0, 0.34);
1691 gap: 0.55rem;
1698 gap: 0.55rem;
1692 }
1699 }
1693
1700
1694 #sidebar-close {
1701 #sidebar-close {
1695 display: inline-flex;
1702 display: inline-flex;
1696 position: absolute;
1703 position: absolute;
1697 top: 0.45rem;
1704 top: 0.45rem;
1698 right: 0.45rem;
1705 right: 0.45rem;
1699 border-color: var(--border);
1706 border-color: var(--border);
1700 background: var(--surface2);
1707 background: var(--surface2);
1701 }
1708 }
1702
1709
1703 #sidebar-name {
1710 #sidebar-name {
1704 padding-right: 2rem;
1711 padding-right: 2rem;
1705 }
1712 }
1706
1713
1707 #sidebar-icon svg {
1714 #sidebar-icon svg {
1708 width: 54px;
1715 width: 54px;
1709 height: 54px;
1716 height: 54px;
1710 }
1717 }
1711
1718
1712 #sidebar-actions {
1719 #sidebar-actions {
1713 margin-top: 0.2rem;
1720 margin-top: 0.2rem;
1714 }
1721 }
1715
1722
1716 .modal {
1723 .modal {
1717 padding: 1.25rem;
1724 padding: 1.25rem;
1718 }
1725 }
1719
1726
1720 .preview-overlay {
1727 .preview-overlay {
1721 padding: 0.8rem;
1728 padding: 0.8rem;
1722 }
1729 }
1723
1730
1724 .preview-sheet {
1731 .preview-sheet {
1725 width: 100%;
1732 width: 100%;
1726 height: 92vh;
1733 height: 92vh;
1727 }
1734 }
1728
1735
1729 .preview-fold {
1736 .preview-fold {
1730 width: 54px;
1737 width: 54px;
1731 height: 54px;
1738 height: 54px;
1732 }
1739 }
1733
1740
1734 .preview-close {
1741 .preview-close {
1735 top: 5px;
1742 top: 5px;
1736 right: 5px;
1743 right: 5px;
1737 }
1744 }
1738}
1745}
1739
1746
1740/* =========================================================
1747/* =========================================================
1741 DIALOG MODALS (confirm / prompt / overwrite)
1748 DIALOG MODALS (confirm / prompt / overwrite)
1742 ========================================================= */
1749 ========================================================= */
1743.dialog-message {
1750.dialog-message {
1744 color: var(--text-muted);
1751 color: var(--text-muted);
1745 font-size: 0.93rem;
1752 font-size: 0.93rem;
1746 margin: 0 0 1.5rem;
1753 margin: 0 0 1.5rem;
1747 line-height: 1.5;
1754 line-height: 1.5;
1748 word-break: break-word;
1755 word-break: break-word;
1749}
1756}
1750
1757
1751.dialog-actions {
1758.dialog-actions {
1752 display: flex;
1759 display: flex;
1753 gap: 0.6rem;
1760 gap: 0.6rem;
1754 justify-content: flex-end;
1761 justify-content: flex-end;
1755 flex-wrap: wrap;
1762 flex-wrap: wrap;
1756}
1763}
1757
1764
1758.dialog-actions--overwrite {
1765.dialog-actions--overwrite {
1759 justify-content: space-between;
1766 justify-content: space-between;
1760}
1767}
1761
1768
1762.dialog-actions button {
1769.dialog-actions button {
1763 min-width: 5rem;
1770 min-width: 5rem;
1764 background: var(--surface2);
1771 background: var(--surface2);
1765 color: var(--text);
1772 color: var(--text);
1766 padding: 0.5rem 1rem;
1773 padding: 0.5rem 1rem;
1767}
1774}
1768
1775
1769.dialog-actions button:hover {
1776.dialog-actions button:hover {
1770 background: var(--border);
1777 background: var(--border);
1771}
1778}
1772
1779
1773/* Override .primary full-width inside dialog rows */
1780/* Override .primary full-width inside dialog rows */
1774.dialog-actions button.primary {
1781.dialog-actions button.primary {
1775 width: auto;
1782 width: auto;
1776 margin-top: 0;
1783 margin-top: 0;
1777}
1784}
server/api/oauth.js +8 −7
@@ -10,6 +10,7 @@ const bcrypt = require('bcrypt');
10 10 const store = require('./store');
11 11 const { getDb } = require('../db');
12 12 const { getClientIp } = require('../auth');
13 const { publicBaseUrl, publicPathPrefix } = require('../public-url');
13 14
14 15 const router = express.Router();
15 16 const formParser = express.urlencoded({ extended: false, limit: '32kb' });
@@ -21,7 +22,7 @@ const loginFailures = new Map();
21 22
22 23 function issuer (req)
23 24 {
24 return `${req.protocol}://${req.get('host')}`;
25 return publicBaseUrl(req);
25 26 }
26 27
27 28 function esc (v)
@@ -113,7 +114,7 @@ function renderError (res, status, message)
113 114 <body style="font-family:system-ui,sans-serif;max-width:32rem;margin:3rem auto;padding:0 1rem"><h1>Authorization error</h1><p>${esc(message)}</p></body></html>`);
114 115 }
115 116
116 function renderConsent (res, r, errorMessage, username)
117 function renderConsent (req, res, r, errorMessage, username)
117 118 {
118 119 pageHeaders(res);
119 120 const hidden = {
@@ -147,9 +148,9 @@ small{color:#555}
147 148 <h1 style="font-size:1.3rem">Allow <em>${esc(r.client.name)}</em> to access your files?</h1>
148 149 <p>Device: <strong>${esc(r.deviceName)}</strong><br><small>After approval you will be sent back to ${esc(host)}.</small></p>
149 150 <p>This app asks for:</p><ul>${scopeHtml}</ul>
150 <p><small>The app can never see more than you can. You can revoke access at any time on the <em>Connected apps</em> page (/apps.html).</small></p>
151 <p><small>The app can never see more than you can. You can revoke access at any time on the <em>Connected apps</em> page (${esc(publicBaseUrl(req))}/apps.html).</small></p>
151 152 ${errorMessage ? `<p class="err">${esc(errorMessage)}</p>` : ''}
152 <form method="post" action="/oauth/authorize" autocomplete="on">
153 <form method="post" action="${esc(publicPathPrefix(req))}/oauth/authorize" autocomplete="on">
153 154 ${hiddenHtml}
154 155 <label for="u">Username</label><input id="u" type="text" name="username" autocomplete="username" value="${esc(username || '')}">
155 156 <label for="p">Password</label><input id="p" type="password" name="password" autocomplete="current-password">
@@ -184,7 +185,7 @@ router.get('/oauth/authorize', (req, res) =>
184 185 const e = parsed.redirectError;
185 186 return redirectWith(res, req, e.redirectUri, { error: e.error, error_description: e.description, state: e.state });
186 187 }
187 return renderConsent(res, parsed.request, null, '');
188 return renderConsent(req, res, parsed.request, null, '');
188 189 });
189 190
190 191 router.post('/oauth/authorize', formParser, async (req, res, next) =>
@@ -211,7 +212,7 @@ router.post('/oauth/authorize', formParser, async (req, res, next) =>
211 212 const failKey = `${ip}|${username.toLowerCase()}`;
212 213 if (tooManyFailures(failKey) || tooManyFailures(ip))
213 214 {
214 return renderConsent(res, r, 'Too many failed attempts. Try again later.', username);
215 return renderConsent(req, res, r, 'Too many failed attempts. Try again later.', username);
215 216 }
216 217
217 218 const row = username ? getDb().prepare('SELECT username, password_hash FROM users WHERE username = ?').get([username]) : null;
@@ -220,7 +221,7 @@ router.post('/oauth/authorize', formParser, async (req, res, next) =>
220 221 {
221 222 recordFailure(failKey);
222 223 recordFailure(ip);
223 return renderConsent(res, r, 'Invalid username or password.', username);
224 return renderConsent(req, res, r, 'Invalid username or password.', username);
224 225 }
225 226
226 227 const code = store.createAuthCode({
@@ -10,6 +10,7 @@ const bcrypt = require('bcrypt');
10const store = require('./store');
10const store = require('./store');
11const { getDb } = require('../db');
11const { getDb } = require('../db');
12const { getClientIp } = require('../auth');
12const { getClientIp } = require('../auth');
13const { publicBaseUrl, publicPathPrefix } = require('../public-url');
13
14
14const router = express.Router();
15const router = express.Router();
15const formParser = express.urlencoded({ extended: false, limit: '32kb' });
16const formParser = express.urlencoded({ extended: false, limit: '32kb' });
@@ -21,7 +22,7 @@ const loginFailures = new Map();
21
22
22function issuer (req)
23function issuer (req)
23{
24{
24 return `${req.protocol}://${req.get('host')}`;
25 return publicBaseUrl(req);
25}
26}
26
27
27function esc (v)
28function esc (v)
@@ -113,7 +114,7 @@ function renderError (res, status, message)
113<body style="font-family:system-ui,sans-serif;max-width:32rem;margin:3rem auto;padding:0 1rem"><h1>Authorization error</h1><p>${esc(message)}</p></body></html>`);
114<body style="font-family:system-ui,sans-serif;max-width:32rem;margin:3rem auto;padding:0 1rem"><h1>Authorization error</h1><p>${esc(message)}</p></body></html>`);
114}
115}
115
116
116function renderConsent (res, r, errorMessage, username)
117function renderConsent (req, res, r, errorMessage, username)
117{
118{
118 pageHeaders(res);
119 pageHeaders(res);
119 const hidden = {
120 const hidden = {
@@ -147,9 +148,9 @@ small{color:#555}
147<h1 style="font-size:1.3rem">Allow <em>${esc(r.client.name)}</em> to access your files?</h1>
148<h1 style="font-size:1.3rem">Allow <em>${esc(r.client.name)}</em> to access your files?</h1>
148<p>Device: <strong>${esc(r.deviceName)}</strong><br><small>After approval you will be sent back to ${esc(host)}.</small></p>
149<p>Device: <strong>${esc(r.deviceName)}</strong><br><small>After approval you will be sent back to ${esc(host)}.</small></p>
149<p>This app asks for:</p><ul>${scopeHtml}</ul>
150<p>This app asks for:</p><ul>${scopeHtml}</ul>
150<p><small>The app can never see more than you can. You can revoke access at any time on the <em>Connected apps</em> page (/apps.html).</small></p>
151<p><small>The app can never see more than you can. You can revoke access at any time on the <em>Connected apps</em> page (${esc(publicBaseUrl(req))}/apps.html).</small></p>
151${errorMessage ? `<p class="err">${esc(errorMessage)}</p>` : ''}
152${errorMessage ? `<p class="err">${esc(errorMessage)}</p>` : ''}
152<form method="post" action="/oauth/authorize" autocomplete="on">
153<form method="post" action="${esc(publicPathPrefix(req))}/oauth/authorize" autocomplete="on">
153${hiddenHtml}
154${hiddenHtml}
154<label for="u">Username</label><input id="u" type="text" name="username" autocomplete="username" value="${esc(username || '')}">
155<label for="u">Username</label><input id="u" type="text" name="username" autocomplete="username" value="${esc(username || '')}">
155<label for="p">Password</label><input id="p" type="password" name="password" autocomplete="current-password">
156<label for="p">Password</label><input id="p" type="password" name="password" autocomplete="current-password">
@@ -184,7 +185,7 @@ router.get('/oauth/authorize', (req, res) =>
184 const e = parsed.redirectError;
185 const e = parsed.redirectError;
185 return redirectWith(res, req, e.redirectUri, { error: e.error, error_description: e.description, state: e.state });
186 return redirectWith(res, req, e.redirectUri, { error: e.error, error_description: e.description, state: e.state });
186 }
187 }
187 return renderConsent(res, parsed.request, null, '');
188 return renderConsent(req, res, parsed.request, null, '');
188});
189});
189
190
190router.post('/oauth/authorize', formParser, async (req, res, next) =>
191router.post('/oauth/authorize', formParser, async (req, res, next) =>
@@ -211,7 +212,7 @@ router.post('/oauth/authorize', formParser, async (req, res, next) =>
211 const failKey = `${ip}|${username.toLowerCase()}`;
212 const failKey = `${ip}|${username.toLowerCase()}`;
212 if (tooManyFailures(failKey) || tooManyFailures(ip))
213 if (tooManyFailures(failKey) || tooManyFailures(ip))
213 {
214 {
214 return renderConsent(res, r, 'Too many failed attempts. Try again later.', username);
215 return renderConsent(req, res, r, 'Too many failed attempts. Try again later.', username);
215 }
216 }
216
217
217 const row = username ? getDb().prepare('SELECT username, password_hash FROM users WHERE username = ?').get([username]) : null;
218 const row = username ? getDb().prepare('SELECT username, password_hash FROM users WHERE username = ?').get([username]) : null;
@@ -220,7 +221,7 @@ router.post('/oauth/authorize', formParser, async (req, res, next) =>
220 {
221 {
221 recordFailure(failKey);
222 recordFailure(failKey);
222 recordFailure(ip);
223 recordFailure(ip);
223 return renderConsent(res, r, 'Invalid username or password.', username);
224 return renderConsent(req, res, r, 'Invalid username or password.', username);
224 }
225 }
225
226
226 const code = store.createAuthCode({
227 const code = store.createAuthCode({
server/api/v1.js +11 −2
@@ -17,6 +17,7 @@ const syncIndex = require('./sync-index');
17 17 const { getDb } = require('../db');
18 18 const { getClientIp } = require('../auth');
19 19 const { logError } = require('../logger');
20 const { publicBaseUrl } = require('../public-url');
20 21 const filesRouter = require('../routes/files');
21 22 const { deleteIndexUnder, rewriteIndexPaths, reindexDirectoryTree } = require('../search-index');
22 23 const { enqueueFileHash } = require('../file-hash-queue');
@@ -361,12 +362,20 @@ router.use((req, res, next) =>
361 362
362 363 router.get('/', (req, res) =>
363 364 {
364 res.json({ name: 'filemanager', api: 'v1', openapi: '/api/v1/openapi.json', oauth: '/.well-known/oauth-authorization-server' });
365 const base = publicBaseUrl(req);
366 res.json({ name: 'filemanager', api: 'v1', openapi: `${base}/api/v1/openapi.json`, oauth: `${base}/.well-known/oauth-authorization-server` });
365 367 });
366 368
367 369 router.get('/openapi.json', (req, res) =>
368 370 {
369 res.sendFile(path.join(__dirname, '../../docs/openapi.json'));
371 const spec = JSON.parse(fs.readFileSync(path.join(__dirname, '../../docs/openapi.json'), 'utf8'));
372 const base = publicBaseUrl(req);
373 spec.servers = [{ url: `${base}/api/v1` }];
374 const flow = spec.components.securitySchemes.oauth2.flows.authorizationCode;
375 flow.authorizationUrl = `${base}/oauth/authorize`;
376 flow.tokenUrl = `${base}/oauth/token`;
377 flow.refreshUrl = `${base}/oauth/token`;
378 res.json(spec);
370 379 });
371 380
372 381 router.use(authenticate);
@@ -17,6 +17,7 @@ const syncIndex = require('./sync-index');
17const { getDb } = require('../db');
17const { getDb } = require('../db');
18const { getClientIp } = require('../auth');
18const { getClientIp } = require('../auth');
19const { logError } = require('../logger');
19const { logError } = require('../logger');
20const { publicBaseUrl } = require('../public-url');
20const filesRouter = require('../routes/files');
21const filesRouter = require('../routes/files');
21const { deleteIndexUnder, rewriteIndexPaths, reindexDirectoryTree } = require('../search-index');
22const { deleteIndexUnder, rewriteIndexPaths, reindexDirectoryTree } = require('../search-index');
22const { enqueueFileHash } = require('../file-hash-queue');
23const { enqueueFileHash } = require('../file-hash-queue');
@@ -361,12 +362,20 @@ router.use((req, res, next) =>
361
362
362router.get('/', (req, res) =>
363router.get('/', (req, res) =>
363{
364{
364 res.json({ name: 'filemanager', api: 'v1', openapi: '/api/v1/openapi.json', oauth: '/.well-known/oauth-authorization-server' });
365 const base = publicBaseUrl(req);
366 res.json({ name: 'filemanager', api: 'v1', openapi: `${base}/api/v1/openapi.json`, oauth: `${base}/.well-known/oauth-authorization-server` });
365});
367});
366
368
367router.get('/openapi.json', (req, res) =>
369router.get('/openapi.json', (req, res) =>
368{
370{
369 res.sendFile(path.join(__dirname, '../../docs/openapi.json'));
371 const spec = JSON.parse(fs.readFileSync(path.join(__dirname, '../../docs/openapi.json'), 'utf8'));
372 const base = publicBaseUrl(req);
373 spec.servers = [{ url: `${base}/api/v1` }];
374 const flow = spec.components.securitySchemes.oauth2.flows.authorizationCode;
375 flow.authorizationUrl = `${base}/oauth/authorize`;
376 flow.tokenUrl = `${base}/oauth/token`;
377 flow.refreshUrl = `${base}/oauth/token`;
378 res.json(spec);
370});
379});
371
380
372router.use(authenticate);
381router.use(authenticate);
server/index.js +4 −0
@@ -9,6 +9,7 @@ const { initDb, closeDb } = require('./db');
9 9 const { ensureServerKeys } = require('./crypto');
10 10 const { startAuthSessionCleanupLoop, stopAuthSessionCleanupLoop } = require('./auth');
11 11 const { loadConfig } = require('./config');
12 const { trustProxySetting } = require('./public-url');
12 13 const { startThumbnailCacheLoop, stopThumbnailCacheLoop } = require('./thumbnail-cache');
13 14 const { startSearchIndexLoop, stopSearchIndexLoop } = require('./search-index');
14 15 const { startFileHashQueue, stopFileHashQueue } = require('./file-hash-queue');
@@ -106,6 +107,9 @@ function start ()
106 107 ensureServerKeys();
107 108
108 109 const config = loadConfig();
110 // Behind a reverse proxy: trust X-Forwarded-* only from configured proxies
111 // (default: loopback), so req.ip / req.protocol reflect the real client.
112 app.set('trust proxy', trustProxySetting(config));
109 113 const port = config.port || 3000;
110 114
111 115 const httpServer = http.createServer(app);
@@ -9,6 +9,7 @@ const { initDb, closeDb } = require('./db');
9const { ensureServerKeys } = require('./crypto');
9const { ensureServerKeys } = require('./crypto');
10const { startAuthSessionCleanupLoop, stopAuthSessionCleanupLoop } = require('./auth');
10const { startAuthSessionCleanupLoop, stopAuthSessionCleanupLoop } = require('./auth');
11const { loadConfig } = require('./config');
11const { loadConfig } = require('./config');
12const { trustProxySetting } = require('./public-url');
12const { startThumbnailCacheLoop, stopThumbnailCacheLoop } = require('./thumbnail-cache');
13const { startThumbnailCacheLoop, stopThumbnailCacheLoop } = require('./thumbnail-cache');
13const { startSearchIndexLoop, stopSearchIndexLoop } = require('./search-index');
14const { startSearchIndexLoop, stopSearchIndexLoop } = require('./search-index');
14const { startFileHashQueue, stopFileHashQueue } = require('./file-hash-queue');
15const { startFileHashQueue, stopFileHashQueue } = require('./file-hash-queue');
@@ -106,6 +107,9 @@ function start ()
106 ensureServerKeys();
107 ensureServerKeys();
107
108
108 const config = loadConfig();
109 const config = loadConfig();
110 // Behind a reverse proxy: trust X-Forwarded-* only from configured proxies
111 // (default: loopback), so req.ip / req.protocol reflect the real client.
112 app.set('trust proxy', trustProxySetting(config));
109 const port = config.port || 3000;
113 const port = config.port || 3000;
110
114
111 const httpServer = http.createServer(app);
115 const httpServer = http.createServer(app);
server/public-url.js added +69 −0
@@ -0,0 +1,69 @@
1 'use strict';
2
3 // Public base URL of this server, as seen by clients. Used for OAuth
4 // metadata, the `iss` parameter, and links in the OpenAPI spec.
5 //
6 // config.json:
7 // "publicUrl": "https://files.example.com" (optional, wins when set)
8 // "trustProxy": "loopback" (Express "trust proxy"; default
9 // trusts only a proxy on the same
10 // machine; false disables)
11
12 const { loadConfig } = require('./config');
13
14 const DEFAULT_TRUST_PROXY = 'loopback';
15
16 function normalizePublicUrl (raw)
17 {
18 if (typeof raw !== 'string' || !raw.trim()) return null;
19 let u;
20 try { u = new URL(raw.trim()); } catch { return null; }
21 if (u.protocol !== 'https:' && u.protocol !== 'http:') return null;
22 if (u.username || u.password || u.search || u.hash) return null;
23 return `${u.protocol}//${u.host}${u.pathname.replace(/\/+$/, '')}`;
24 }
25
26 /**
27 * Value for app.set('trust proxy', ...). Accepts what Express accepts:
28 * boolean, hop count, or (comma separated / array of) addresses, subnets
29 * and the names loopback, linklocal, uniquelocal.
30 */
31 function trustProxySetting (config)
32 {
33 const v = config ? config.trustProxy : undefined;
34 if (v === undefined || v === null || v === '') return DEFAULT_TRUST_PROXY;
35 if (typeof v === 'boolean') return v;
36 if (typeof v === 'number' && Number.isInteger(v) && v >= 0) return v;
37 if (typeof v === 'string') return v.trim();
38 if (Array.isArray(v) && v.every((x) => typeof x === 'string')) return v;
39 return DEFAULT_TRUST_PROXY;
40 }
41
42 function publicBaseUrl (req)
43 {
44 const configured = normalizePublicUrl(loadConfig().publicUrl);
45 if (configured) return configured;
46 return `${req.protocol}://${requestHost(req)}`;
47 }
48
49 /** Host header, or X-Forwarded-Host when the direct peer is a trusted proxy. */
50 function requestHost (req)
51 {
52 const fwd = req.get('x-forwarded-host');
53 const trust = req.app && req.app.get('trust proxy fn');
54 const peer = req.socket && req.socket.remoteAddress;
55 if (fwd && typeof trust === 'function' && trust(peer, 0))
56 {
57 const first = fwd.split(',')[0].trim();
58 if (/^[A-Za-z0-9.\-:[\]]+$/.test(first)) return first;
59 }
60 return req.get('host');
61 }
62
63 /** Path prefix of the public URL ('' when served at the root). */
64 function publicPathPrefix (req)
65 {
66 try { return new URL(publicBaseUrl(req)).pathname.replace(/\/+$/, ''); } catch { return ''; }
67 }
68
69 module.exports = { normalizePublicUrl, trustProxySetting, publicBaseUrl, publicPathPrefix, DEFAULT_TRUST_PROXY };
@@ -0,0 +1,69 @@
1'use strict';
2
3// Public base URL of this server, as seen by clients. Used for OAuth
4// metadata, the `iss` parameter, and links in the OpenAPI spec.
5//
6// config.json:
7// "publicUrl": "https://files.example.com" (optional, wins when set)
8// "trustProxy": "loopback" (Express "trust proxy"; default
9// trusts only a proxy on the same
10// machine; false disables)
11
12const { loadConfig } = require('./config');
13
14const DEFAULT_TRUST_PROXY = 'loopback';
15
16function normalizePublicUrl (raw)
17{
18 if (typeof raw !== 'string' || !raw.trim()) return null;
19 let u;
20 try { u = new URL(raw.trim()); } catch { return null; }
21 if (u.protocol !== 'https:' && u.protocol !== 'http:') return null;
22 if (u.username || u.password || u.search || u.hash) return null;
23 return `${u.protocol}//${u.host}${u.pathname.replace(/\/+$/, '')}`;
24}
25
26/**
27 * Value for app.set('trust proxy', ...). Accepts what Express accepts:
28 * boolean, hop count, or (comma separated / array of) addresses, subnets
29 * and the names loopback, linklocal, uniquelocal.
30 */
31function trustProxySetting (config)
32{
33 const v = config ? config.trustProxy : undefined;
34 if (v === undefined || v === null || v === '') return DEFAULT_TRUST_PROXY;
35 if (typeof v === 'boolean') return v;
36 if (typeof v === 'number' && Number.isInteger(v) && v >= 0) return v;
37 if (typeof v === 'string') return v.trim();
38 if (Array.isArray(v) && v.every((x) => typeof x === 'string')) return v;
39 return DEFAULT_TRUST_PROXY;
40}
41
42function publicBaseUrl (req)
43{
44 const configured = normalizePublicUrl(loadConfig().publicUrl);
45 if (configured) return configured;
46 return `${req.protocol}://${requestHost(req)}`;
47}
48
49/** Host header, or X-Forwarded-Host when the direct peer is a trusted proxy. */
50function requestHost (req)
51{
52 const fwd = req.get('x-forwarded-host');
53 const trust = req.app && req.app.get('trust proxy fn');
54 const peer = req.socket && req.socket.remoteAddress;
55 if (fwd && typeof trust === 'function' && trust(peer, 0))
56 {
57 const first = fwd.split(',')[0].trim();
58 if (/^[A-Za-z0-9.\-:[\]]+$/.test(first)) return first;
59 }
60 return req.get('host');
61}
62
63/** Path prefix of the public URL ('' when served at the root). */
64function publicPathPrefix (req)
65{
66 try { return new URL(publicBaseUrl(req)).pathname.replace(/\/+$/, ''); } catch { return ''; }
67}
68
69module.exports = { normalizePublicUrl, trustProxySetting, publicBaseUrl, publicPathPrefix, DEFAULT_TRUST_PROXY };
tests/public-url.test.js added +178 −0
@@ -0,0 +1,178 @@
1 'use strict';
2
3 // Public URL behind a reverse proxy: publicUrl in config wins, otherwise
4 // Express "trust proxy" (default loopback) decides the scheme/host.
5
6 const fs = require('fs');
7 const path = require('path');
8 const http = require('http');
9 const express = require('express');
10 const { once } = require('events');
11
12 const mockConfig = { port: 3000, paths: [], rootAliases: {} };
13
14 jest.mock('../server/db', () =>
15 {
16 const { Database } = require('node-sqlite3-wasm');
17 let db;
18 return {
19 getDb: () => { if (!db) db = new Database(':memory:'); return db; },
20 initDb: () => {},
21 closeDb: () => {},
22 };
23 });
24 jest.mock('../server/config', () =>
25 {
26 const actual = jest.requireActual('../server/config');
27 return { ...actual, loadConfig: () => mockConfig, saveConfig: () => {} };
28 });
29 jest.mock('../server/search-index', () => ({
30 searchFiles: async () => [], deleteIndexPath: () => {}, deleteIndexUnder: () => {}, rewriteIndexPaths: () => {}, reindexDirectoryTree: async () => {},
31 }));
32 jest.mock('../server/file-hash-queue', () => ({ enqueueFileHash: () => {} }));
33 jest.mock('../server/thumbnail-cache', () => ({
34 getCachedThumbnailInfo: async () => null, getFilesWithThumbnailsInDir: async () => [], getFolderIconSourceFile: async () => null,
35 setFolderIconAssignment: () => {}, getThumbnailManifestSourcePathSet: async () => new Set(), needsPreviewImageConversion: () => false,
36 streamPreviewImage: async () => {}, MAX_PREVIEW_IMAGE_BYTES: 1, THUMB_HTTP_MAX_AGE_SEC: 1,
37 }));
38
39 const { normalizePublicUrl, trustProxySetting } = require('../server/public-url');
40 const { getDb } = require('../server/db');
41 const store = require('../server/api/store');
42 const oauthRoutes = require('../server/api/oauth');
43 const apiV1Routes = require('../server/api/v1');
44
45 describe('normalizePublicUrl', () =>
46 {
47 test.each([
48 ['https://files.example.com', 'https://files.example.com'],
49 ['https://files.example.com/', 'https://files.example.com'],
50 [' https://example.com/files/ ', 'https://example.com/files'],
51 ['http://127.0.0.1:3000', 'http://127.0.0.1:3000'],
52 ])('%s -> %s', (raw, out) => expect(normalizePublicUrl(raw)).toBe(out));
53
54 test.each([[''], [null], ['files.example.com'], ['ftp://x'], ['https://u:p@x.com'], ['https://x.com/?a=1'], ['https://x.com/#a']])(
55 'rejects %p', (raw) => expect(normalizePublicUrl(raw)).toBeNull());
56 });
57
58 describe('trustProxySetting', () =>
59 {
60 test('defaults to loopback only', () =>
61 {
62 expect(trustProxySetting({})).toBe('loopback');
63 expect(trustProxySetting({ trustProxy: { weird: 1 } })).toBe('loopback');
64 });
65 test('passes through valid Express values', () =>
66 {
67 expect(trustProxySetting({ trustProxy: false })).toBe(false);
68 expect(trustProxySetting({ trustProxy: 1 })).toBe(1);
69 expect(trustProxySetting({ trustProxy: '10.0.0.0/8, loopback' })).toBe('10.0.0.0/8, loopback');
70 expect(trustProxySetting({ trustProxy: ['loopback', '192.168.1.2'] })).toEqual(['loopback', '192.168.1.2']);
71 });
72 });
73
74 describe('URLs in OAuth metadata, redirects and OpenAPI', () =>
75 {
76 let server;
77 let base;
78 let app;
79 let client;
80
81 beforeAll(async () =>
82 {
83 getDb().exec("CREATE TABLE users (id INTEGER PRIMARY KEY AUTOINCREMENT, username TEXT UNIQUE NOT NULL, password_hash TEXT NOT NULL, is_admin INTEGER NOT NULL DEFAULT 0, permissions TEXT NOT NULL DEFAULT '{}')");
84 store.initApiSchema(getDb());
85 client = store.createClient({ name: 'App', redirectUris: ['https://app.example/cb'], createdBy: 'admin' });
86 app = express();
87 app.use(oauthRoutes);
88 app.use('/api/v1', apiV1Routes);
89 server = http.createServer(app).listen(0, '127.0.0.1');
90 await once(server, 'listening');
91 base = `http://127.0.0.1:${server.address().port}`;
92 });
93
94 afterAll(() => server.close());
95
96 beforeEach(() =>
97 {
98 delete mockConfig.publicUrl;
99 app.set('trust proxy', trustProxySetting(mockConfig));
100 });
101
102 const proxied = { 'X-Forwarded-Proto': 'https', 'X-Forwarded-Host': 'files.example.com' };
103 const meta = async (headers) => (await fetch(`${base}/.well-known/oauth-authorization-server`, { headers })).json();
104
105 test('without proxy headers the direct URL is used', async () =>
106 {
107 expect((await meta({})).issuer).toBe(base);
108 });
109
110 test('trusted loopback proxy: X-Forwarded-Proto/Host give https', async () =>
111 {
112 const m = await meta(proxied);
113 expect(m.issuer).toBe('https://files.example.com');
114 expect(m.token_endpoint).toBe('https://files.example.com/oauth/token');
115 });
116
117 test('forwarded headers are ignored when the proxy is not trusted', async () =>
118 {
119 app.set('trust proxy', trustProxySetting({ trustProxy: false }));
120 expect((await meta(proxied)).issuer).toBe(base);
121 app.set('trust proxy', trustProxySetting({ trustProxy: '10.1.2.3' }));
122 expect((await meta(proxied)).issuer).toBe(base);
123 });
124
125 test('publicUrl wins over everything, including a path prefix', async () =>
126 {
127 mockConfig.publicUrl = 'https://example.org/files/';
128 const m = await meta({ 'X-Forwarded-Proto': 'http', 'X-Forwarded-Host': 'evil.example' });
129 expect(m.issuer).toBe('https://example.org/files');
130 expect(m.authorization_endpoint).toBe('https://example.org/files/oauth/authorize');
131 expect(m.service_documentation).toBe('https://example.org/files/api/v1/openapi.json');
132 });
133
134 test('invalid publicUrl falls back to the request', async () =>
135 {
136 mockConfig.publicUrl = 'not a url';
137 expect((await meta(proxied)).issuer).toBe('https://files.example.com');
138 });
139
140 test('OpenAPI spec uses absolute https links', async () =>
141 {
142 const spec = await (await fetch(`${base}/api/v1/openapi.json`, { headers: proxied })).json();
143 expect(spec.servers).toEqual([{ url: 'https://files.example.com/api/v1' }]);
144 const flow = spec.components.securitySchemes.oauth2.flows.authorizationCode;
145 expect(flow.authorizationUrl).toBe('https://files.example.com/oauth/authorize');
146 expect(flow.tokenUrl).toBe('https://files.example.com/oauth/token');
147 const index = await (await fetch(`${base}/api/v1`, { headers: proxied })).json();
148 expect(index.openapi).toBe('https://files.example.com/api/v1/openapi.json');
149 });
150
151 test('redirect iss and consent form action follow the public URL', async () =>
152 {
153 mockConfig.publicUrl = 'https://example.org/files';
154 const q = new URLSearchParams({ response_type: 'code', client_id: client.clientId, redirect_uri: 'https://app.example/cb', state: 's' });
155 const r = await fetch(`${base}/oauth/authorize?${q}`, { redirect: 'manual' });
156 expect(new URL(r.headers.get('location')).searchParams.get('iss')).toBe('https://example.org/files');
157
158 q.set('code_challenge', 'a'.repeat(43));
159 q.set('code_challenge_method', 'S256');
160 const page = await (await fetch(`${base}/oauth/authorize?${q}`)).text();
161 expect(page).toContain('action="/files/oauth/authorize"');
162 expect(page).toContain('https://example.org/files/apps.html');
163 });
164 });
165
166 describe('Main UI links to the connected apps page', () =>
167 {
168 test('user menu has a Connected apps link to /apps.html', () =>
169 {
170 const html = fs.readFileSync(path.join(__dirname, '../public/index.html'), 'utf8');
171 const m = html.match(/<a id="btn-connected-apps"[^>]*>/);
172 expect(m).toBeTruthy();
173 expect(m[0]).toContain('href="/apps.html"');
174 expect(m[0]).toContain('role="menuitem"');
175 const menu = html.slice(html.indexOf('aria-label="User actions"'), html.indexOf('id="btn-logout"'));
176 expect(menu).toContain('btn-connected-apps');
177 });
178 });
@@ -0,0 +1,178 @@
1'use strict';
2
3// Public URL behind a reverse proxy: publicUrl in config wins, otherwise
4// Express "trust proxy" (default loopback) decides the scheme/host.
5
6const fs = require('fs');
7const path = require('path');
8const http = require('http');
9const express = require('express');
10const { once } = require('events');
11
12const mockConfig = { port: 3000, paths: [], rootAliases: {} };
13
14jest.mock('../server/db', () =>
15{
16 const { Database } = require('node-sqlite3-wasm');
17 let db;
18 return {
19 getDb: () => { if (!db) db = new Database(':memory:'); return db; },
20 initDb: () => {},
21 closeDb: () => {},
22 };
23});
24jest.mock('../server/config', () =>
25{
26 const actual = jest.requireActual('../server/config');
27 return { ...actual, loadConfig: () => mockConfig, saveConfig: () => {} };
28});
29jest.mock('../server/search-index', () => ({
30 searchFiles: async () => [], deleteIndexPath: () => {}, deleteIndexUnder: () => {}, rewriteIndexPaths: () => {}, reindexDirectoryTree: async () => {},
31}));
32jest.mock('../server/file-hash-queue', () => ({ enqueueFileHash: () => {} }));
33jest.mock('../server/thumbnail-cache', () => ({
34 getCachedThumbnailInfo: async () => null, getFilesWithThumbnailsInDir: async () => [], getFolderIconSourceFile: async () => null,
35 setFolderIconAssignment: () => {}, getThumbnailManifestSourcePathSet: async () => new Set(), needsPreviewImageConversion: () => false,
36 streamPreviewImage: async () => {}, MAX_PREVIEW_IMAGE_BYTES: 1, THUMB_HTTP_MAX_AGE_SEC: 1,
37}));
38
39const { normalizePublicUrl, trustProxySetting } = require('../server/public-url');
40const { getDb } = require('../server/db');
41const store = require('../server/api/store');
42const oauthRoutes = require('../server/api/oauth');
43const apiV1Routes = require('../server/api/v1');
44
45describe('normalizePublicUrl', () =>
46{
47 test.each([
48 ['https://files.example.com', 'https://files.example.com'],
49 ['https://files.example.com/', 'https://files.example.com'],
50 [' https://example.com/files/ ', 'https://example.com/files'],
51 ['http://127.0.0.1:3000', 'http://127.0.0.1:3000'],
52 ])('%s -> %s', (raw, out) => expect(normalizePublicUrl(raw)).toBe(out));
53
54 test.each([[''], [null], ['files.example.com'], ['ftp://x'], ['https://u:p@x.com'], ['https://x.com/?a=1'], ['https://x.com/#a']])(
55 'rejects %p', (raw) => expect(normalizePublicUrl(raw)).toBeNull());
56});
57
58describe('trustProxySetting', () =>
59{
60 test('defaults to loopback only', () =>
61 {
62 expect(trustProxySetting({})).toBe('loopback');
63 expect(trustProxySetting({ trustProxy: { weird: 1 } })).toBe('loopback');
64 });
65 test('passes through valid Express values', () =>
66 {
67 expect(trustProxySetting({ trustProxy: false })).toBe(false);
68 expect(trustProxySetting({ trustProxy: 1 })).toBe(1);
69 expect(trustProxySetting({ trustProxy: '10.0.0.0/8, loopback' })).toBe('10.0.0.0/8, loopback');
70 expect(trustProxySetting({ trustProxy: ['loopback', '192.168.1.2'] })).toEqual(['loopback', '192.168.1.2']);
71 });
72});
73
74describe('URLs in OAuth metadata, redirects and OpenAPI', () =>
75{
76 let server;
77 let base;
78 let app;
79 let client;
80
81 beforeAll(async () =>
82 {
83 getDb().exec("CREATE TABLE users (id INTEGER PRIMARY KEY AUTOINCREMENT, username TEXT UNIQUE NOT NULL, password_hash TEXT NOT NULL, is_admin INTEGER NOT NULL DEFAULT 0, permissions TEXT NOT NULL DEFAULT '{}')");
84 store.initApiSchema(getDb());
85 client = store.createClient({ name: 'App', redirectUris: ['https://app.example/cb'], createdBy: 'admin' });
86 app = express();
87 app.use(oauthRoutes);
88 app.use('/api/v1', apiV1Routes);
89 server = http.createServer(app).listen(0, '127.0.0.1');
90 await once(server, 'listening');
91 base = `http://127.0.0.1:${server.address().port}`;
92 });
93
94 afterAll(() => server.close());
95
96 beforeEach(() =>
97 {
98 delete mockConfig.publicUrl;
99 app.set('trust proxy', trustProxySetting(mockConfig));
100 });
101
102 const proxied = { 'X-Forwarded-Proto': 'https', 'X-Forwarded-Host': 'files.example.com' };
103 const meta = async (headers) => (await fetch(`${base}/.well-known/oauth-authorization-server`, { headers })).json();
104
105 test('without proxy headers the direct URL is used', async () =>
106 {
107 expect((await meta({})).issuer).toBe(base);
108 });
109
110 test('trusted loopback proxy: X-Forwarded-Proto/Host give https', async () =>
111 {
112 const m = await meta(proxied);
113 expect(m.issuer).toBe('https://files.example.com');
114 expect(m.token_endpoint).toBe('https://files.example.com/oauth/token');
115 });
116
117 test('forwarded headers are ignored when the proxy is not trusted', async () =>
118 {
119 app.set('trust proxy', trustProxySetting({ trustProxy: false }));
120 expect((await meta(proxied)).issuer).toBe(base);
121 app.set('trust proxy', trustProxySetting({ trustProxy: '10.1.2.3' }));
122 expect((await meta(proxied)).issuer).toBe(base);
123 });
124
125 test('publicUrl wins over everything, including a path prefix', async () =>
126 {
127 mockConfig.publicUrl = 'https://example.org/files/';
128 const m = await meta({ 'X-Forwarded-Proto': 'http', 'X-Forwarded-Host': 'evil.example' });
129 expect(m.issuer).toBe('https://example.org/files');
130 expect(m.authorization_endpoint).toBe('https://example.org/files/oauth/authorize');
131 expect(m.service_documentation).toBe('https://example.org/files/api/v1/openapi.json');
132 });
133
134 test('invalid publicUrl falls back to the request', async () =>
135 {
136 mockConfig.publicUrl = 'not a url';
137 expect((await meta(proxied)).issuer).toBe('https://files.example.com');
138 });
139
140 test('OpenAPI spec uses absolute https links', async () =>
141 {
142 const spec = await (await fetch(`${base}/api/v1/openapi.json`, { headers: proxied })).json();
143 expect(spec.servers).toEqual([{ url: 'https://files.example.com/api/v1' }]);
144 const flow = spec.components.securitySchemes.oauth2.flows.authorizationCode;
145 expect(flow.authorizationUrl).toBe('https://files.example.com/oauth/authorize');
146 expect(flow.tokenUrl).toBe('https://files.example.com/oauth/token');
147 const index = await (await fetch(`${base}/api/v1`, { headers: proxied })).json();
148 expect(index.openapi).toBe('https://files.example.com/api/v1/openapi.json');
149 });
150
151 test('redirect iss and consent form action follow the public URL', async () =>
152 {
153 mockConfig.publicUrl = 'https://example.org/files';
154 const q = new URLSearchParams({ response_type: 'code', client_id: client.clientId, redirect_uri: 'https://app.example/cb', state: 's' });
155 const r = await fetch(`${base}/oauth/authorize?${q}`, { redirect: 'manual' });
156 expect(new URL(r.headers.get('location')).searchParams.get('iss')).toBe('https://example.org/files');
157
158 q.set('code_challenge', 'a'.repeat(43));
159 q.set('code_challenge_method', 'S256');
160 const page = await (await fetch(`${base}/oauth/authorize?${q}`)).text();
161 expect(page).toContain('action="/files/oauth/authorize"');
162 expect(page).toContain('https://example.org/files/apps.html');
163 });
164});
165
166describe('Main UI links to the connected apps page', () =>
167{
168 test('user menu has a Connected apps link to /apps.html', () =>
169 {
170 const html = fs.readFileSync(path.join(__dirname, '../public/index.html'), 'utf8');
171 const m = html.match(/<a id="btn-connected-apps"[^>]*>/);
172 expect(m).toBeTruthy();
173 expect(m[0]).toContain('href="/apps.html"');
174 expect(m[0]).toContain('role="menuitem"');
175 const menu = html.slice(html.indexOf('aria-label="User actions"'), html.indexOf('id="btn-logout"'));
176 expect(menu).toContain('btn-connected-apps');
177 });
178});