1:root {
2 --bg: #16181d;
3 --bg2: #1e2128;
4 --bg3: #262a33;
5 --fg: #d8dbe2;
6 --fg2: #9aa0ad;
7 --accent: #5aa9ff;
8 --warn: #ffb454;
9 --err: #ff6b6b;
10 --ok: #7fd58a;
11 --border: #30343e;
12 --sidebar: 440px;
13 font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
14 font-size: 13px;
15 color-scheme: dark;
16}
17* { box-sizing: border-box; }
18html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); }
19a { color: var(--accent); }
20#app { display: flex; height: 100vh; overflow: hidden; }
21#sidebar { width: var(--sidebar); min-width: 280px; display: flex; flex-direction: column; background: var(--bg2); border-right: 1px solid var(--border); }
22#sidebarHead { padding: 8px 12px; border-bottom: 1px solid var(--border); }
23#sidebarHead h1 { font-size: 15px; margin: 0; font-weight: 600; letter-spacing: 0.02em; }
24#titleRow { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
25#tutorialBtn { font-size: 12px; padding: 2px 8px; }
26#tutorialBtn.active { border-color: var(--accent); color: var(--accent); }
27#sidebarBody { flex: 1; overflow-y: auto; padding: 6px 12px 24px 12px; }
28#splitter { width: 5px; cursor: col-resize; background: var(--bg); }
29#splitter:hover { background: var(--border); }
30#main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
31#viewWrap { flex: 1; position: relative; min-height: 200px; }
32#view { width: 100%; height: 100%; display: block; }
33#viewOverlay { position: absolute; left: 8px; top: 6px; color: var(--fg2); font-size: 12px; pointer-events: none; white-space: pre-line; }
34#spec { height: 220px; width: 100%; display: block; background: #000; }
35.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 5px 10px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg2); font-size: 12px; }
36.toolbar label { display: inline-flex; align-items: center; gap: 4px; color: var(--fg2); }
37.toolbar input[type=range] { width: 120px; }
38#movieToolbar input[type=range].scrub { flex: 1; min-width: 120px; }
39button, select, input { font: inherit; color: var(--fg); background: var(--bg3); border: 1px solid var(--border); border-radius: 4px; padding: 3px 8px; }
40button { cursor: pointer; }
41button:hover:not(:disabled) { border-color: var(--accent); }
42button:disabled { opacity: 0.45; cursor: default; }
43button.primary { background: #2b4a75; border-color: #3a6db0; }
44input[type=number] { width: 84px; padding: 2px 6px; text-align: right; }
45input[type=checkbox] { padding: 0; }
46details > summary { cursor: pointer; font-weight: 600; padding: 6px 0; color: var(--fg); user-select: none; }
47details { border-bottom: 1px solid var(--border); padding-bottom: 6px; margin-bottom: 4px; }
48#about p { color: var(--fg2); margin: 4px 0; line-height: 1.4; }
49#controls { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
50#controls .grow { flex: 1; }
51.info { color: var(--fg2); font-size: 12px; line-height: 1.45; white-space: pre-line; margin-top: 6px; }
52.info .warn { color: var(--warn); }
53.info .err { color: var(--err); }
54.status { font-size: 12px; margin-top: 4px; }
55/* Editor */
56.design-editor .editor-head { display: flex; gap: 6px; align-items: center; margin-bottom: 4px; }
57.design-editor .editor-head select { flex: 1; }
58.design-editor .editor-script { border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
59.design-editor .editor-status { margin-top: 4px; font-size: 12px; white-space: pre-wrap; }
60.design-editor .editor-status-error { color: var(--err); }
61.design-editor .editor-status-ok { color: var(--ok); }
62.design-editor .editor-status-info { color: var(--fg2); }
63/* Form */
64.pform-group summary { font-weight: 600; }
65.pform-rows { display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; align-items: center; }
66.pform-row { display: contents; }
67.pform-row label { color: var(--fg2); }
68.pform-control { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
69.pform-unit { color: var(--fg2); min-width: 28px; font-size: 12px; }
70.pform-notes { border: none; margin: 4px 0 0 0; padding: 0; }
71.pform-notes summary { font-weight: normal; color: var(--fg2); padding: 2px 0; font-size: 12px; }
72.pform-notes p { color: var(--fg2); font-size: 12px; margin: 2px 0; line-height: 1.45; white-space: pre-line; }
73/* Mode browser */
74.modes-head { display: flex; gap: 6px; align-items: center; margin-bottom: 4px; flex-wrap: wrap; }
75.modes-head input { width: 70px; }
76.modes-info { color: var(--fg2); font-size: 12px; margin-bottom: 4px; white-space: pre-line; }
77.modes-table { max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: 4px; }
78.modes-table table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
79.modes-table th { position: sticky; top: 0; background: var(--bg3); text-align: right; padding: 3px 6px; font-weight: 600; }
80.modes-table th:first-child, .modes-table td:first-child { text-align: left; }
81.modes-table td { text-align: right; padding: 2px 6px; cursor: pointer; }
82.modes-table tr:hover td { background: var(--bg3); }
83.modes-table tr.selected td { background: #2b4a75; }
84.progress { height: 6px; background: var(--bg3); border-radius: 3px; overflow: hidden; margin: 4px 0; }
85.progress > div { height: 100%; background: var(--accent); width: 0; transition: width 0.15s; }
86.badge { display: inline-block; padding: 1px 6px; border-radius: 3px; background: var(--bg3); color: var(--fg2); font-size: 11px; }
87.badge.warn { color: var(--warn); }
88#nogpu { color: var(--warn); }
89/* Tutorial */
90#tutorial { width: 440px; min-width: 320px; display: flex; flex-direction: column; background: var(--bg2); border-left: 1px solid var(--border); font-size: 13.5px; }
91.tut-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
92.tut-title { font-weight: 600; }
93.tut-head select { flex: 1; min-width: 0; }
94.tut-close { padding: 1px 8px; font-size: 15px; line-height: 1.2; }
95.tut-body { flex: 1; overflow-y: auto; padding: 8px 14px 16px 14px; line-height: 1.5; }
96.tut-body h2 { font-size: 16px; margin: 2px 0 10px 0; font-weight: 600; }
97.tut-chapter { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg2); }
98.tut-body p { margin: 8px 0; }
99.tut-body i { color: #e8eaf0; }
100.tut-body .katex-display { margin: 8px 0; overflow-x: auto; overflow-y: hidden; }
101.tut-body .katex { font-size: 1.05em; }
102.tut-live { background: var(--bg3); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 4px; padding: 8px 10px; margin: 10px 0; font-size: 12.5px; line-height: 1.5; }
103.tut-need { color: var(--fg2); font-style: italic; border: 1px dashed var(--border); border-radius: 4px; padding: 6px 10px; margin: 10px 0; font-size: 12.5px; }
104.tut-table { border-collapse: collapse; margin: 6px 0 2px 0; font-size: 12px; font-variant-numeric: tabular-nums; }
105.tut-table th { text-align: right; padding: 2px 8px 2px 0; font-weight: 600; border-bottom: 1px solid var(--border); }
106.tut-table td { text-align: right; padding: 2px 8px 2px 0; }
107.tut-table th:first-child, .tut-table td:first-child { text-align: left; }
108.tut-bar { display: inline-block; width: 90px; height: 8px; background: var(--bg); border-radius: 2px; overflow: hidden; vertical-align: middle; }
109.tut-bar > span { display: block; height: 100%; background: var(--accent); }
110.tut-actions { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
111.tut-actions-label { width: 100%; font-weight: 600; color: var(--fg2); font-size: 12px; }
112.tut-actions button { font-size: 12px; }
113.tut-error { color: var(--err); padding: 4px 14px; font-size: 12px; }
114.tut-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--border); }
115.tut-counter { color: var(--fg2); font-size: 12px; }