index.html 95 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350
  1. <!doctype html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
  6. <meta name="color-scheme" content="light" />
  7. <title>fmode · 现有移动端 UI 精修对照</title>
  8. <style>
  9. * {
  10. box-sizing: border-box;
  11. }
  12. :root {
  13. font-family:
  14. Inter,
  15. -apple-system,
  16. BlinkMacSystemFont,
  17. 'Segoe UI',
  18. 'PingFang SC',
  19. 'Microsoft YaHei',
  20. sans-serif;
  21. color: #25272a;
  22. background: #f1f1f0;
  23. font-synthesis: none;
  24. }
  25. body {
  26. margin: 0;
  27. }
  28. button,
  29. input,
  30. textarea {
  31. font: inherit;
  32. }
  33. button {
  34. cursor: pointer;
  35. color: inherit;
  36. border: 0;
  37. background: none;
  38. -webkit-tap-highlight-color: transparent;
  39. }
  40. button:disabled {
  41. cursor: default;
  42. opacity: 0.4;
  43. }
  44. button:focus-visible,
  45. input:focus-visible,
  46. textarea:focus-visible,
  47. summary:focus-visible {
  48. outline: 2px solid #6386af;
  49. outline-offset: 3px;
  50. }
  51. button,
  52. input,
  53. textarea {
  54. touch-action: manipulation;
  55. }
  56. svg {
  57. width: 21px;
  58. height: 21px;
  59. fill: none;
  60. stroke: currentColor;
  61. stroke-width: 1.65;
  62. stroke-linecap: round;
  63. stroke-linejoin: round;
  64. flex: none;
  65. }
  66. h1,
  67. h2,
  68. h3,
  69. p {
  70. margin: 0;
  71. }
  72. button {
  73. transition:
  74. background 0.15s,
  75. transform 0.15s;
  76. }
  77. button:active {
  78. transform: translateY(1px);
  79. }
  80. .studio-header {
  81. height: 72px;
  82. border-bottom: 1px solid #dededb;
  83. margin: 0 48px;
  84. display: flex;
  85. align-items: center;
  86. justify-content: space-between;
  87. }
  88. .brand {
  89. display: flex;
  90. align-items: center;
  91. gap: 12px;
  92. font-size: 12px;
  93. color: #777873;
  94. }
  95. .brand strong {
  96. font-size: 23px;
  97. letter-spacing: -1.2px;
  98. color: #25272a;
  99. }
  100. .brand-mark {
  101. width: 27px;
  102. height: 27px;
  103. background: #292b2e;
  104. border-radius: 9px;
  105. color: white;
  106. font-size: 25px;
  107. line-height: 30px;
  108. font-weight: 700;
  109. text-align: center;
  110. font-style: italic;
  111. }
  112. .brand-divider {
  113. height: 17px;
  114. width: 1px;
  115. background: #cececa;
  116. margin: 0 5px;
  117. }
  118. .prototype-label {
  119. font-size: 11px;
  120. color: #81817c;
  121. }
  122. .studio {
  123. max-width: 1040px;
  124. margin: 0 auto;
  125. padding: 34px 28px 24px;
  126. }
  127. .studio-heading {
  128. display: flex;
  129. justify-content: space-between;
  130. align-items: center;
  131. gap: 24px;
  132. }
  133. .eyebrow {
  134. font-size: 10px;
  135. font-weight: 600;
  136. color: #777872;
  137. letter-spacing: 2px;
  138. margin-bottom: 9px;
  139. }
  140. h1 {
  141. font-size: 25px;
  142. font-weight: 600;
  143. letter-spacing: -0.6px;
  144. }
  145. .studio-heading p {
  146. font-size: 12px;
  147. color: #777872;
  148. margin-top: 10px;
  149. line-height: 1.8;
  150. }
  151. .view-control {
  152. display: flex;
  153. padding: 4px;
  154. border: 1px solid #d9d9d5;
  155. border-radius: 10px;
  156. flex: none;
  157. }
  158. .view-control button {
  159. font-size: 11px;
  160. padding: 8px 12px;
  161. border-radius: 7px;
  162. color: #777872;
  163. }
  164. .view-control button.selected {
  165. background: #fff;
  166. color: #26272a;
  167. box-shadow: 0 1px 4px #00000008;
  168. }
  169. .scene-nav {
  170. display: flex;
  171. gap: 6px;
  172. margin: 27px 0 22px;
  173. border-bottom: 1px solid #dededb;
  174. overflow: auto;
  175. }
  176. .scene-nav button {
  177. font-size: 12px;
  178. white-space: nowrap;
  179. padding: 13px 15px 14px;
  180. color: #83847e;
  181. border-bottom: 2px solid transparent;
  182. display: flex;
  183. align-items: center;
  184. gap: 7px;
  185. }
  186. .scene-nav svg {
  187. width: 15px;
  188. height: 15px;
  189. }
  190. .scene-nav button.selected {
  191. color: #25272a;
  192. border-bottom-color: #25272a;
  193. }
  194. .comparison {
  195. display: flex;
  196. justify-content: center;
  197. gap: 54px;
  198. align-items: flex-start;
  199. }
  200. .specimen {
  201. width: 390px;
  202. min-width: 0;
  203. }
  204. .specimen-caption {
  205. display: flex;
  206. justify-content: space-between;
  207. align-items: center;
  208. margin-bottom: 14px;
  209. gap: 8px;
  210. font-size: 10px;
  211. color: #82837c;
  212. }
  213. .specimen-caption > div {
  214. display: flex;
  215. align-items: center;
  216. gap: 8px;
  217. }
  218. .specimen-caption strong {
  219. font-size: 12px;
  220. font-weight: 600;
  221. color: #3a3b3c;
  222. }
  223. .version-number {
  224. font-size: 10px;
  225. border: 1px solid #cececa;
  226. width: 22px;
  227. height: 22px;
  228. border-radius: 6px;
  229. display: grid;
  230. place-items: center;
  231. }
  232. .live-label {
  233. display: flex;
  234. gap: 5px;
  235. align-items: center;
  236. }
  237. .live-label i {
  238. width: 5px;
  239. height: 5px;
  240. background: #4e7461;
  241. border-radius: 50%;
  242. }
  243. .phone {
  244. --canvas: #f2f3f5;
  245. --surface: #fff;
  246. --surface-2: #f7f7f8;
  247. --ink: #202124;
  248. --ink-2: #45474b;
  249. --muted: #62666d;
  250. --edge: #dfe1e4;
  251. --primary: #25272a;
  252. --primary-content: #fff;
  253. --subtle: #e8e9eb;
  254. --avatar: #e9eaec;
  255. --shadow: 0 1px 2px #17243c0a, 0 4px 12px #17243c0f;
  256. --chat-size: 14px;
  257. isolation: isolate;
  258. position: relative;
  259. background: var(--canvas);
  260. color: var(--ink);
  261. height: 792px;
  262. border-radius: 38px;
  263. overflow: hidden;
  264. box-shadow:
  265. 0 0 0 1px #d5d5d1,
  266. 0 0 0 5px #fafaf8,
  267. 0 18px 38px -15px #24262622;
  268. display: flex;
  269. flex-direction: column;
  270. font-size: 14px;
  271. }
  272. .phone.dark {
  273. --canvas: #18191b;
  274. --surface: #222426;
  275. --surface-2: #292b2e;
  276. --ink: #f2f3f4;
  277. --ink-2: #d0d2d5;
  278. --muted: #a7abb1;
  279. --edge: #383b3f;
  280. --primary: #f1f2f3;
  281. --primary-content: #202124;
  282. --subtle: #34373b;
  283. --avatar: #34383c;
  284. }
  285. .phone[data-palette='ice']:not(.dark) {
  286. --canvas: #f6f8fc;
  287. --ink: #202a3c;
  288. --primary: #4056c7;
  289. --subtle: #e8ecfb;
  290. --avatar: #e6ebf7;
  291. }
  292. .phone[data-palette='clay']:not(.dark) {
  293. --canvas: #f3f0eb;
  294. --surface: #fffdfa;
  295. --ink: #2a2623;
  296. --primary: #af482b;
  297. --subtle: #f6e8e1;
  298. --avatar: #f0e5dc;
  299. }
  300. .phone[data-palette='slate']:not(.dark) {
  301. --canvas: #f1f0f5;
  302. --ink: #282633;
  303. --primary: #6952a3;
  304. --subtle: #efebf8;
  305. --avatar: #e7e2f0;
  306. }
  307. .specimen-note {
  308. font-size: 11px;
  309. color: #82837c;
  310. margin-top: 20px;
  311. line-height: 1.8;
  312. text-align: center;
  313. }
  314. .studio-footer {
  315. display: flex;
  316. justify-content: space-between;
  317. border-top: 1px solid #dededb;
  318. margin-top: 28px;
  319. padding-top: 18px;
  320. color: #8b8c85;
  321. font-size: 10px;
  322. }
  323. .mobile-review {
  324. display: none;
  325. }
  326. body[data-view='polished'] .baseline-specimen,
  327. body[data-view='baseline'] .polished-specimen {
  328. display: none;
  329. }
  330. .statusbar {
  331. height: 40px;
  332. flex: none;
  333. display: flex;
  334. align-items: center;
  335. justify-content: space-between;
  336. padding: 11px 27px 0;
  337. font-size: 13px;
  338. font-weight: 650;
  339. letter-spacing: 0.2px;
  340. }
  341. .status-icons {
  342. display: flex;
  343. gap: 5px;
  344. align-items: center;
  345. }
  346. .status-icons svg {
  347. width: 15px;
  348. height: 15px;
  349. stroke-width: 1.9;
  350. }
  351. .status-icons svg:last-child {
  352. width: 23px;
  353. }
  354. .appbar {
  355. height: 68px;
  356. flex: none;
  357. display: flex;
  358. align-items: center;
  359. gap: 10px;
  360. padding: 0 16px;
  361. }
  362. .round-button {
  363. width: 44px;
  364. height: 44px;
  365. display: grid;
  366. place-items: center;
  367. border-radius: 50%;
  368. background: var(--surface);
  369. box-shadow: var(--shadow);
  370. flex: none;
  371. }
  372. .appbar-title {
  373. flex: 1;
  374. min-width: 0;
  375. text-align: center;
  376. }
  377. .appbar-title h2 {
  378. font-size: 16px;
  379. font-weight: 600;
  380. overflow: hidden;
  381. text-overflow: ellipsis;
  382. white-space: nowrap;
  383. line-height: 24px;
  384. }
  385. .appbar-title p {
  386. font-size: 11px;
  387. color: var(--muted);
  388. line-height: 19px;
  389. }
  390. .appbar-title button {
  391. max-width: 100%;
  392. padding: 0;
  393. display: block;
  394. width: 100%;
  395. }
  396. .appbar-title button h2 {
  397. padding: 0 3px;
  398. }
  399. .appbar-right {
  400. display: flex;
  401. gap: 8px;
  402. }
  403. .header-spacer {
  404. width: 44px;
  405. flex: none;
  406. }
  407. .page-content {
  408. flex: 1;
  409. min-height: 0;
  410. overflow-y: auto;
  411. overscroll-behavior: contain;
  412. scrollbar-width: none;
  413. padding-bottom: 20px;
  414. }
  415. .page-content::-webkit-scrollbar {
  416. display: none;
  417. }
  418. .filter-area {
  419. padding: 0 20px 0;
  420. flex: none;
  421. }
  422. .segmented {
  423. display: flex;
  424. background: var(--surface-2);
  425. border: 1px solid var(--edge);
  426. border-radius: 99px;
  427. padding: 4px;
  428. max-width: 300px;
  429. margin: 0 auto 14px;
  430. }
  431. .segmented button {
  432. flex: 1;
  433. min-height: 36px;
  434. font-size: 13px;
  435. border-radius: 99px;
  436. color: var(--muted);
  437. }
  438. .segmented button.selected {
  439. background: var(--surface);
  440. box-shadow: var(--shadow);
  441. color: var(--ink);
  442. font-weight: 550;
  443. }
  444. .search {
  445. display: flex;
  446. align-items: center;
  447. gap: 9px;
  448. height: 44px;
  449. background: var(--surface);
  450. border: 1px solid var(--edge);
  451. border-radius: 10px;
  452. padding: 0 12px;
  453. color: var(--muted);
  454. }
  455. .search svg {
  456. width: 18px;
  457. height: 18px;
  458. }
  459. .search input {
  460. background: none;
  461. border: 0;
  462. outline: none;
  463. min-width: 0;
  464. width: 100%;
  465. color: var(--ink);
  466. font-size: 13px;
  467. height: 100%;
  468. }
  469. .search input::placeholder {
  470. color: var(--muted);
  471. opacity: 0.8;
  472. }
  473. .list {
  474. margin: 12px 20px 0;
  475. background: var(--surface);
  476. border: 1px solid var(--edge);
  477. border-radius: 16px;
  478. overflow: hidden;
  479. }
  480. .conversation {
  481. position: relative;
  482. display: flex;
  483. align-items: center;
  484. gap: 12px;
  485. padding: 14px 16px;
  486. min-height: 76px;
  487. width: 100%;
  488. text-align: left;
  489. }
  490. .conversation + .conversation {
  491. border-top: 1px solid var(--edge);
  492. }
  493. .conversation:hover {
  494. background: var(--surface-2);
  495. }
  496. .avatar {
  497. width: 40px;
  498. height: 40px;
  499. border-radius: 50%;
  500. flex: none;
  501. display: grid;
  502. place-items: center;
  503. background: var(--avatar);
  504. color: var(--muted);
  505. font-size: 16px;
  506. font-weight: 550;
  507. position: relative;
  508. }
  509. .presence {
  510. position: absolute;
  511. right: 0;
  512. bottom: 0;
  513. width: 9px;
  514. height: 9px;
  515. border: 2px solid var(--surface);
  516. border-radius: 50%;
  517. background: #4d8c6b;
  518. }
  519. .presence.off {
  520. background: #b4b7bb;
  521. }
  522. .row-body {
  523. min-width: 0;
  524. flex: 1;
  525. }
  526. .row-title {
  527. display: block;
  528. white-space: nowrap;
  529. overflow: hidden;
  530. text-overflow: ellipsis;
  531. font-size: 14px;
  532. font-weight: 550;
  533. line-height: 22px;
  534. }
  535. .row-preview {
  536. display: block;
  537. white-space: nowrap;
  538. overflow: hidden;
  539. text-overflow: ellipsis;
  540. font-size: 12px;
  541. line-height: 20px;
  542. color: var(--muted);
  543. }
  544. .row-tail {
  545. align-self: stretch;
  546. display: flex;
  547. flex-direction: column;
  548. align-items: flex-end;
  549. justify-content: center;
  550. gap: 8px;
  551. flex: none;
  552. font-size: 10px;
  553. color: var(--muted);
  554. }
  555. .unread {
  556. background: #c33f42;
  557. color: #fff;
  558. border-radius: 99px;
  559. min-width: 17px;
  560. height: 17px;
  561. display: grid;
  562. place-items: center;
  563. font-size: 10px;
  564. padding: 0 5px;
  565. }
  566. .row-meta {
  567. display: none;
  568. }
  569. .list-footer {
  570. text-align: center;
  571. color: var(--muted);
  572. opacity: 0.7;
  573. font-size: 10px;
  574. padding: 20px;
  575. }
  576. .tabbar {
  577. height: 70px;
  578. flex: none;
  579. display: flex;
  580. align-items: center;
  581. background: color-mix(in srgb, var(--surface) 88%, transparent);
  582. border-top: 1px solid var(--edge);
  583. backdrop-filter: blur(16px);
  584. padding: 5px 10px 2px;
  585. position: relative;
  586. }
  587. .tabbar button {
  588. display: flex;
  589. align-items: center;
  590. justify-content: center;
  591. flex-direction: column;
  592. gap: 4px;
  593. flex: 1;
  594. font-size: 10px;
  595. color: var(--muted);
  596. min-height: 48px;
  597. position: relative;
  598. }
  599. .tab-icon {
  600. display: grid;
  601. place-items: center;
  602. height: 28px;
  603. width: 48px;
  604. border-radius: 12px;
  605. position: relative;
  606. }
  607. .tabbar button.selected {
  608. color: var(--primary);
  609. font-weight: 650;
  610. }
  611. .tabbar .unread {
  612. position: absolute;
  613. top: -3px;
  614. right: 2px;
  615. min-width: 15px;
  616. height: 15px;
  617. font-size: 9px;
  618. }
  619. .home-indicator {
  620. height: 18px;
  621. background: var(--surface);
  622. display: flex;
  623. justify-content: center;
  624. align-items: center;
  625. flex: none;
  626. }
  627. .home-indicator:after {
  628. content: '';
  629. height: 4px;
  630. width: 116px;
  631. background: var(--ink);
  632. border-radius: 9px;
  633. opacity: 0.8;
  634. }
  635. .group-toggle {
  636. display: flex;
  637. align-items: center;
  638. gap: 9px;
  639. width: 100%;
  640. min-height: 58px;
  641. padding: 12px 16px;
  642. text-align: left;
  643. }
  644. .group-toggle strong {
  645. font-size: 13px;
  646. flex: 1;
  647. font-weight: 550;
  648. }
  649. .group-toggle span {
  650. font-size: 11px;
  651. color: var(--muted);
  652. }
  653. .group-toggle svg {
  654. width: 18px;
  655. height: 18px;
  656. }
  657. .group-actions {
  658. display: flex;
  659. padding: 0 12px 12px;
  660. gap: 6px;
  661. }
  662. .group-actions button {
  663. font-size: 11px;
  664. color: var(--muted);
  665. padding: 8px;
  666. min-height: 36px;
  667. }
  668. .section-label {
  669. display: flex;
  670. align-items: center;
  671. justify-content: space-between;
  672. margin: 21px 22px 10px;
  673. font-size: 12px;
  674. color: var(--muted);
  675. font-weight: 500;
  676. }
  677. .text-button {
  678. color: var(--muted);
  679. font-size: 12px;
  680. padding: 10px 0;
  681. min-height: 40px;
  682. display: inline-flex;
  683. align-items: center;
  684. gap: 5px;
  685. }
  686. .text-button svg {
  687. width: 15px;
  688. height: 15px;
  689. }
  690. .empty {
  691. padding: 50px 24px;
  692. text-align: center;
  693. color: var(--muted);
  694. }
  695. .empty svg {
  696. width: 30px;
  697. height: 30px;
  698. margin-bottom: 14px;
  699. }
  700. .empty h3 {
  701. font-size: 15px;
  702. color: var(--ink);
  703. margin-bottom: 8px;
  704. }
  705. .empty p {
  706. font-size: 12px;
  707. line-height: 1.8;
  708. }
  709. .empty button {
  710. margin-top: 18px;
  711. }
  712. .primary-button {
  713. background: var(--primary);
  714. color: var(--primary-content);
  715. border-radius: 10px;
  716. min-height: 44px;
  717. padding: 10px 17px;
  718. font-size: 13px;
  719. font-weight: 550;
  720. }
  721. .secondary-button {
  722. background: var(--surface-2);
  723. border: 1px solid var(--edge);
  724. border-radius: 10px;
  725. min-height: 44px;
  726. padding: 10px 16px;
  727. font-size: 13px;
  728. }
  729. .chat-scroll {
  730. padding: 8px 16px 22px;
  731. scroll-behavior: smooth;
  732. }
  733. .chat-date {
  734. text-align: center;
  735. color: var(--muted);
  736. font-size: 10px;
  737. margin: 8px 0 21px;
  738. }
  739. .user-message {
  740. background: var(--subtle);
  741. border-radius: 16px 16px 4px 16px;
  742. margin-left: 35px;
  743. padding: 12px 15px;
  744. line-height: 1.75;
  745. font-size: var(--chat-size);
  746. white-space: pre-wrap;
  747. overflow-wrap: anywhere;
  748. }
  749. .agent-line {
  750. display: flex;
  751. align-items: center;
  752. gap: 8px;
  753. margin: 20px 0 10px;
  754. font-size: 12px;
  755. font-weight: 600;
  756. }
  757. .agent-line .avatar {
  758. width: 26px;
  759. height: 26px;
  760. font-size: 11px;
  761. }
  762. .agent-line .agent-status {
  763. margin-left: auto;
  764. color: var(--muted);
  765. font-size: 10px;
  766. font-weight: 400;
  767. }
  768. .process {
  769. margin-bottom: 8px;
  770. }
  771. .process summary {
  772. cursor: pointer;
  773. list-style: none;
  774. min-height: 32px;
  775. padding: 6px 10px;
  776. display: flex;
  777. align-items: center;
  778. gap: 6px;
  779. font-size: 10px;
  780. color: var(--muted);
  781. background: var(--surface-2);
  782. border: 1px solid var(--edge);
  783. border-radius: 99px;
  784. width: fit-content;
  785. max-width: 100%;
  786. }
  787. .process summary::-webkit-details-marker {
  788. display: none;
  789. }
  790. .process summary svg {
  791. width: 13px;
  792. height: 13px;
  793. }
  794. .process summary span {
  795. margin-left: 4px;
  796. }
  797. .process[open] summary svg:last-child {
  798. transform: rotate(180deg);
  799. }
  800. .process ol {
  801. font-size: 11px;
  802. color: var(--muted);
  803. line-height: 2.1;
  804. padding-left: 30px;
  805. margin: 10px 0;
  806. }
  807. .assistant-card {
  808. background: var(--surface);
  809. border: 1px solid var(--edge);
  810. border-radius: 16px;
  811. padding: 16px;
  812. font-size: var(--chat-size);
  813. line-height: 1.85;
  814. overflow-wrap: anywhere;
  815. }
  816. .assistant-card h3 {
  817. font-size: 16px;
  818. font-weight: 650;
  819. margin-bottom: 7px;
  820. line-height: 1.65;
  821. }
  822. .assistant-card p {
  823. color: var(--ink-2);
  824. margin: 0 0 12px;
  825. }
  826. .assistant-card p:last-child {
  827. margin-bottom: 0;
  828. }
  829. .insight {
  830. border-left: 2px solid var(--edge);
  831. padding: 0 0 0 11px;
  832. margin: 14px 0;
  833. }
  834. .insight p {
  835. margin: 0 0 6px;
  836. font-size: 13px;
  837. }
  838. .insight b {
  839. color: var(--ink);
  840. font-weight: 600;
  841. }
  842. .files {
  843. display: grid;
  844. grid-template-columns: 1fr 1fr;
  845. gap: 8px;
  846. margin-top: 15px;
  847. }
  848. .file-card {
  849. background: var(--surface-2);
  850. border: 1px solid var(--edge);
  851. border-radius: 10px;
  852. padding: 11px;
  853. text-align: left;
  854. min-width: 0;
  855. display: flex;
  856. flex-direction: column;
  857. gap: 6px;
  858. }
  859. .file-type {
  860. display: grid;
  861. place-items: center;
  862. width: 29px;
  863. height: 34px;
  864. border: 1px solid #e2c2b7;
  865. background: #fff0e9;
  866. color: #ae5737;
  867. border-radius: 5px;
  868. font-size: 8px;
  869. font-weight: 700;
  870. letter-spacing: 0.3px;
  871. }
  872. .file-type.sheet {
  873. background: #eef5ee;
  874. color: #487556;
  875. border-color: #c8dccb;
  876. }
  877. .file-card strong {
  878. font-size: 11px;
  879. white-space: nowrap;
  880. overflow: hidden;
  881. text-overflow: ellipsis;
  882. max-width: 100%;
  883. font-weight: 550;
  884. }
  885. .file-card small {
  886. font-size: 9px;
  887. color: var(--muted);
  888. }
  889. .response-actions {
  890. display: flex;
  891. gap: 2px;
  892. margin-top: 5px;
  893. }
  894. .response-actions button {
  895. min-width: 38px;
  896. min-height: 36px;
  897. display: grid;
  898. place-items: center;
  899. color: var(--muted);
  900. }
  901. .response-actions svg {
  902. width: 15px;
  903. height: 15px;
  904. }
  905. .composer-wrap {
  906. padding: 6px 16px 9px;
  907. flex: none;
  908. background: var(--canvas);
  909. }
  910. .activity-entry {
  911. display: none;
  912. align-items: center;
  913. gap: 7px;
  914. font-size: 11px;
  915. min-height: 35px;
  916. color: var(--muted);
  917. padding: 0 5px;
  918. margin-bottom: 3px;
  919. }
  920. .activity-entry span {
  921. flex: 1;
  922. text-align: left;
  923. }
  924. .activity-entry svg {
  925. width: 15px;
  926. height: 15px;
  927. }
  928. .activity-entry .activity-dot {
  929. width: 6px;
  930. height: 6px;
  931. background: #b78332;
  932. border-radius: 50%;
  933. }
  934. .composer {
  935. background: var(--surface);
  936. border: 1px solid var(--edge);
  937. border-radius: 16px;
  938. padding: 12px 14px;
  939. box-shadow:
  940. 0 4px 8px #17243c14,
  941. 0 16px 32px #17243c1f;
  942. }
  943. .composer textarea {
  944. resize: none;
  945. border: 0;
  946. outline: none !important;
  947. background: none;
  948. color: var(--ink);
  949. font-size: 16px;
  950. width: 100%;
  951. height: 48px;
  952. min-height: 48px;
  953. max-height: 112px;
  954. line-height: 1.6;
  955. display: block;
  956. padding: 0;
  957. }
  958. .composer textarea::placeholder {
  959. color: var(--muted);
  960. opacity: 0.75;
  961. }
  962. .composer-tools {
  963. display: flex;
  964. align-items: center;
  965. gap: 2px;
  966. min-height: 40px;
  967. }
  968. .tool-button {
  969. width: 40px;
  970. height: 40px;
  971. display: grid;
  972. place-items: center;
  973. color: var(--muted);
  974. border-radius: 50%;
  975. }
  976. .agent-tool {
  977. display: flex;
  978. align-items: center;
  979. gap: 5px;
  980. font-size: 11px;
  981. color: var(--muted);
  982. min-height: 40px;
  983. padding: 0 8px;
  984. }
  985. .agent-tool svg {
  986. width: 14px;
  987. height: 14px;
  988. }
  989. .send-button {
  990. margin-left: auto;
  991. background: var(--primary);
  992. color: var(--primary-content);
  993. width: 36px;
  994. height: 36px;
  995. border-radius: 50%;
  996. display: grid;
  997. place-items: center;
  998. }
  999. .input-hint {
  1000. display: none;
  1001. text-align: center;
  1002. font-size: 9px;
  1003. color: var(--muted);
  1004. margin-top: 8px;
  1005. opacity: 0.85;
  1006. }
  1007. .attachment-chip {
  1008. background: var(--surface-2);
  1009. font-size: 11px;
  1010. display: flex;
  1011. align-items: center;
  1012. gap: 6px;
  1013. padding: 6px 9px;
  1014. border-radius: 7px;
  1015. margin-bottom: 8px;
  1016. overflow: hidden;
  1017. }
  1018. .attachment-chip span {
  1019. overflow: hidden;
  1020. text-overflow: ellipsis;
  1021. white-space: nowrap;
  1022. }
  1023. .attachment-chip button {
  1024. margin-left: auto;
  1025. flex: none;
  1026. min-width: 32px;
  1027. min-height: 32px;
  1028. }
  1029. .attachment-chip svg {
  1030. width: 15px;
  1031. height: 15px;
  1032. }
  1033. .home-hero {
  1034. text-align: center;
  1035. padding: 60px 20px 35px;
  1036. }
  1037. .home-logo {
  1038. font-size: 49px;
  1039. font-weight: 650;
  1040. letter-spacing: -3px;
  1041. }
  1042. .home-hero h3 {
  1043. font-weight: 500;
  1044. font-size: 18px;
  1045. margin: 15px 0 10px;
  1046. }
  1047. .home-hero p {
  1048. font-size: 11px;
  1049. color: var(--muted);
  1050. }
  1051. .overview {
  1052. display: flex;
  1053. margin: 8px 20px 18px;
  1054. background: var(--surface);
  1055. border: 1px solid var(--edge);
  1056. border-radius: 16px;
  1057. padding: 19px 8px;
  1058. }
  1059. .overview > div {
  1060. flex: 1;
  1061. text-align: center;
  1062. border-right: 1px solid var(--edge);
  1063. }
  1064. .overview > div:last-child {
  1065. border: 0;
  1066. }
  1067. .overview strong {
  1068. font-size: 25px;
  1069. font-weight: 600;
  1070. display: block;
  1071. line-height: 1.3;
  1072. }
  1073. .overview span {
  1074. font-size: 10px;
  1075. color: var(--muted);
  1076. display: block;
  1077. margin-top: 5px;
  1078. }
  1079. .life-card {
  1080. margin: 12px 20px 0;
  1081. background: var(--surface);
  1082. border: 1px solid var(--edge);
  1083. border-radius: 16px;
  1084. padding: 14px 16px;
  1085. box-shadow: var(--shadow);
  1086. }
  1087. .life-head {
  1088. display: flex;
  1089. align-items: center;
  1090. gap: 10px;
  1091. }
  1092. .life-head .row-body strong {
  1093. font-size: 14px;
  1094. display: block;
  1095. }
  1096. .life-head small {
  1097. font-size: 11px;
  1098. color: var(--muted);
  1099. display: block;
  1100. margin-top: 4px;
  1101. }
  1102. .state-tag {
  1103. font-size: 10px;
  1104. border-radius: 5px;
  1105. padding: 4px 6px;
  1106. background: #edf7f1;
  1107. color: #207550;
  1108. white-space: nowrap;
  1109. }
  1110. .state-tag.busy {
  1111. background: #fff7e8;
  1112. color: #91600e;
  1113. }
  1114. .state-tag.offline {
  1115. background: var(--surface-2);
  1116. color: var(--muted);
  1117. }
  1118. .task-line {
  1119. font-size: 11px;
  1120. background: var(--surface-2);
  1121. padding: 10px;
  1122. border-radius: 7px;
  1123. display: flex;
  1124. align-items: center;
  1125. gap: 7px;
  1126. margin: 13px 0;
  1127. }
  1128. .task-line svg {
  1129. width: 14px;
  1130. height: 14px;
  1131. color: var(--muted);
  1132. }
  1133. .task-line span {
  1134. overflow: hidden;
  1135. white-space: nowrap;
  1136. text-overflow: ellipsis;
  1137. }
  1138. .metrics {
  1139. display: flex;
  1140. gap: 18px;
  1141. margin: 13px 0 15px;
  1142. }
  1143. .metric {
  1144. flex: 1;
  1145. font-size: 10px;
  1146. color: var(--muted);
  1147. }
  1148. .metric > div {
  1149. display: flex;
  1150. justify-content: space-between;
  1151. }
  1152. .metric-track {
  1153. height: 5px;
  1154. border-radius: 5px;
  1155. background: var(--subtle);
  1156. margin-top: 7px;
  1157. overflow: hidden;
  1158. }
  1159. .metric-track i {
  1160. height: 100%;
  1161. display: block;
  1162. border-radius: 5px;
  1163. background: var(--primary);
  1164. opacity: 0.55;
  1165. }
  1166. .life-actions {
  1167. display: flex;
  1168. gap: 8px;
  1169. border-top: 1px solid var(--edge);
  1170. padding-top: 12px;
  1171. }
  1172. .life-actions button {
  1173. flex: 1;
  1174. min-height: 34px;
  1175. font-size: 11px;
  1176. border-radius: 7px;
  1177. background: var(--surface-2);
  1178. }
  1179. .life-actions button:first-child {
  1180. background: var(--primary);
  1181. color: var(--primary-content);
  1182. }
  1183. .profile-card {
  1184. margin: 8px 20px 0;
  1185. padding: 20px 16px;
  1186. border: 1px solid var(--edge);
  1187. border-radius: 16px;
  1188. background: var(--surface);
  1189. display: flex;
  1190. gap: 13px;
  1191. align-items: center;
  1192. }
  1193. .profile-card .avatar {
  1194. width: 54px;
  1195. height: 54px;
  1196. font-size: 21px;
  1197. }
  1198. .profile-card h3 {
  1199. font-size: 17px;
  1200. font-weight: 600;
  1201. }
  1202. .profile-card p {
  1203. font-size: 11px;
  1204. color: var(--muted);
  1205. margin-top: 7px;
  1206. }
  1207. .settings-card {
  1208. margin: 0 20px;
  1209. background: var(--surface);
  1210. border: 1px solid var(--edge);
  1211. border-radius: 16px;
  1212. overflow: hidden;
  1213. }
  1214. .setting-row {
  1215. display: flex;
  1216. align-items: center;
  1217. gap: 10px;
  1218. padding: 13px 16px;
  1219. min-height: 58px;
  1220. width: 100%;
  1221. text-align: left;
  1222. font-size: 13px;
  1223. }
  1224. .setting-row + .setting-row {
  1225. border-top: 1px solid var(--edge);
  1226. }
  1227. .setting-row > svg {
  1228. width: 17px;
  1229. height: 17px;
  1230. color: var(--muted);
  1231. }
  1232. .setting-row .row-body {
  1233. display: block;
  1234. }
  1235. .setting-row small {
  1236. display: block;
  1237. color: var(--muted);
  1238. font-size: 10px;
  1239. margin-top: 4px;
  1240. }
  1241. .setting-row > span:last-child {
  1242. font-size: 11px;
  1243. color: var(--muted);
  1244. }
  1245. .setting-row .tool-button {
  1246. width: 34px;
  1247. height: 34px;
  1248. }
  1249. .setting-row .tool-button svg {
  1250. width: 17px;
  1251. height: 17px;
  1252. }
  1253. .danger {
  1254. color: #c33f42;
  1255. }
  1256. .palette-label {
  1257. padding: 16px 16px 10px;
  1258. font-size: 12px;
  1259. }
  1260. .palette-grid {
  1261. display: grid;
  1262. grid-template-columns: 1fr 1fr;
  1263. gap: 8px;
  1264. padding: 0 16px 15px;
  1265. }
  1266. .palette-grid button {
  1267. border: 1px solid var(--edge);
  1268. border-radius: 9px;
  1269. text-align: left;
  1270. min-height: 45px;
  1271. padding: 8px;
  1272. display: flex;
  1273. gap: 7px;
  1274. align-items: center;
  1275. font-size: 10px;
  1276. }
  1277. .palette-grid button.selected {
  1278. border-color: var(--primary);
  1279. background: var(--surface-2);
  1280. }
  1281. .palette-swatch {
  1282. width: 17px;
  1283. height: 24px;
  1284. border-radius: 5px;
  1285. box-shadow: inset -6px 0 #ffffffaa;
  1286. flex: none;
  1287. }
  1288. .switch {
  1289. height: 25px;
  1290. width: 43px;
  1291. border-radius: 99px;
  1292. background: var(--edge);
  1293. position: relative;
  1294. flex: none;
  1295. }
  1296. .switch:after {
  1297. content: '';
  1298. position: absolute;
  1299. left: 3px;
  1300. top: 3px;
  1301. width: 19px;
  1302. height: 19px;
  1303. border-radius: 50%;
  1304. background: white;
  1305. box-shadow: 0 1px 3px #0002;
  1306. }
  1307. .switch[aria-checked='true'] {
  1308. background: var(--primary);
  1309. }
  1310. .switch[aria-checked='true']:after {
  1311. left: 21px;
  1312. background: var(--primary-content);
  1313. }
  1314. .font-slider {
  1315. padding: 15px 16px;
  1316. border-top: 1px solid var(--edge);
  1317. font-size: 12px;
  1318. }
  1319. .font-slider label {
  1320. display: flex;
  1321. justify-content: space-between;
  1322. }
  1323. .font-slider input {
  1324. width: 100%;
  1325. accent-color: var(--primary);
  1326. margin-top: 17px;
  1327. }
  1328. .overlay {
  1329. position: absolute;
  1330. inset: 40px 0 0;
  1331. background: #11121465;
  1332. z-index: 20;
  1333. display: flex;
  1334. align-items: flex-end;
  1335. backdrop-filter: blur(2px);
  1336. }
  1337. .sheet {
  1338. background: var(--surface);
  1339. border-radius: 24px 24px 0 0;
  1340. width: 100%;
  1341. max-height: 90%;
  1342. overflow: auto;
  1343. overscroll-behavior: contain;
  1344. padding: 9px 20px 26px;
  1345. box-shadow: 0 -5px 35px #0000000b;
  1346. animation: sheet-in 0.2s ease-out;
  1347. }
  1348. .sheet-handle {
  1349. width: 34px;
  1350. height: 4px;
  1351. background: var(--edge);
  1352. border-radius: 4px;
  1353. margin: 0 auto 14px;
  1354. }
  1355. .sheet-heading {
  1356. display: flex;
  1357. align-items: center;
  1358. gap: 10px;
  1359. margin-bottom: 8px;
  1360. }
  1361. .sheet-heading h3 {
  1362. flex: 1;
  1363. font-size: 17px;
  1364. font-weight: 600;
  1365. }
  1366. .close-button {
  1367. width: 36px;
  1368. height: 36px;
  1369. border-radius: 50%;
  1370. background: var(--surface-2);
  1371. display: grid;
  1372. place-items: center;
  1373. flex: none;
  1374. }
  1375. .close-button svg {
  1376. width: 18px;
  1377. height: 18px;
  1378. }
  1379. .sheet-description {
  1380. font-size: 12px;
  1381. color: var(--muted);
  1382. line-height: 1.8;
  1383. margin-bottom: 20px;
  1384. }
  1385. .sheet .list {
  1386. margin: 10px 0 0;
  1387. }
  1388. .sheet .conversation {
  1389. padding: 13px 12px;
  1390. }
  1391. .sheet .row-meta {
  1392. display: flex;
  1393. font-size: 10px;
  1394. gap: 4px;
  1395. color: var(--muted);
  1396. }
  1397. .sheet .row-meta.running {
  1398. color: #91600e;
  1399. }
  1400. .sheet .row-meta.done {
  1401. color: #207550;
  1402. }
  1403. .sheet .row-meta.error {
  1404. color: #c33f42;
  1405. }
  1406. .sheet .primary-button {
  1407. width: 100%;
  1408. margin-top: 20px;
  1409. }
  1410. .field-label {
  1411. display: block;
  1412. font-size: 12px;
  1413. color: var(--muted);
  1414. margin-bottom: 8px;
  1415. }
  1416. .form-field {
  1417. min-height: 46px;
  1418. border: 1px solid var(--edge);
  1419. border-radius: 10px;
  1420. padding: 12px;
  1421. background: var(--surface-2);
  1422. color: var(--ink);
  1423. width: 100%;
  1424. font-size: 14px;
  1425. }
  1426. .form-error {
  1427. min-height: 24px;
  1428. font-size: 11px;
  1429. color: #c33f42;
  1430. line-height: 24px;
  1431. }
  1432. .candidate {
  1433. border: 1px solid var(--edge);
  1434. border-radius: 9px;
  1435. padding: 12px;
  1436. text-align: left;
  1437. font-size: 12px;
  1438. display: block;
  1439. width: 100%;
  1440. margin-top: 8px;
  1441. }
  1442. .drawer-overlay {
  1443. align-items: stretch;
  1444. }
  1445. .drawer {
  1446. width: 84%;
  1447. max-width: 330px;
  1448. background: var(--surface);
  1449. padding: 22px 16px 20px;
  1450. overflow: auto;
  1451. display: flex;
  1452. flex-direction: column;
  1453. animation: drawer-in 0.2s ease-out;
  1454. }
  1455. .drawer-head {
  1456. display: flex;
  1457. align-items: center;
  1458. justify-content: space-between;
  1459. margin-bottom: 22px;
  1460. padding: 0 5px;
  1461. }
  1462. .drawer-head strong {
  1463. font-size: 25px;
  1464. letter-spacing: -1.5px;
  1465. }
  1466. .drawer-new {
  1467. display: flex;
  1468. align-items: center;
  1469. gap: 12px;
  1470. background: var(--primary);
  1471. color: var(--primary-content);
  1472. padding: 13px;
  1473. border-radius: 12px;
  1474. text-align: left;
  1475. }
  1476. .drawer-new strong {
  1477. display: block;
  1478. font-size: 13px;
  1479. }
  1480. .drawer-new small {
  1481. display: block;
  1482. opacity: 0.7;
  1483. font-size: 10px;
  1484. margin-top: 4px;
  1485. }
  1486. .drawer-quick {
  1487. margin: 8px 0;
  1488. padding: 12px 9px;
  1489. background: var(--surface-2);
  1490. border-radius: 10px;
  1491. text-align: left;
  1492. display: flex;
  1493. align-items: center;
  1494. gap: 10px;
  1495. font-size: 12px;
  1496. }
  1497. .drawer-nav {
  1498. padding: 15px 0;
  1499. border-bottom: 1px solid var(--edge);
  1500. }
  1501. .drawer-nav button {
  1502. display: flex;
  1503. align-items: center;
  1504. gap: 11px;
  1505. width: 100%;
  1506. text-align: left;
  1507. min-height: 44px;
  1508. padding: 9px 12px;
  1509. font-size: 13px;
  1510. border-radius: 9px;
  1511. }
  1512. .drawer-nav button.selected {
  1513. background: var(--subtle);
  1514. }
  1515. .drawer-section {
  1516. font-size: 10px;
  1517. color: var(--muted);
  1518. display: flex;
  1519. justify-content: space-between;
  1520. align-items: center;
  1521. margin: 15px 9px 5px;
  1522. }
  1523. .drawer-section button {
  1524. min-width: 32px;
  1525. min-height: 32px;
  1526. }
  1527. .drawer-item {
  1528. display: flex;
  1529. align-items: center;
  1530. gap: 9px;
  1531. text-align: left;
  1532. width: 100%;
  1533. min-height: 42px;
  1534. font-size: 12px;
  1535. padding: 8px 11px;
  1536. border-radius: 8px;
  1537. }
  1538. .drawer-item svg {
  1539. width: 16px;
  1540. height: 16px;
  1541. color: var(--muted);
  1542. }
  1543. .drawer-item span {
  1544. overflow: hidden;
  1545. text-overflow: ellipsis;
  1546. white-space: nowrap;
  1547. }
  1548. .drawer-footer {
  1549. margin-top: auto;
  1550. border-top: 1px solid var(--edge);
  1551. padding-top: 15px;
  1552. display: flex;
  1553. align-items: center;
  1554. gap: 10px;
  1555. font-size: 12px;
  1556. }
  1557. .drawer-footer small {
  1558. display: block;
  1559. color: var(--muted);
  1560. font-size: 10px;
  1561. margin-top: 4px;
  1562. }
  1563. .toast {
  1564. position: absolute;
  1565. left: 16px;
  1566. right: 16px;
  1567. top: 110px;
  1568. z-index: 40;
  1569. background: var(--ink);
  1570. color: var(--surface);
  1571. border-radius: 12px;
  1572. padding: 13px 15px;
  1573. box-shadow: 0 8px 25px #0002;
  1574. font-size: 12px;
  1575. line-height: 1.6;
  1576. display: flex;
  1577. align-items: center;
  1578. gap: 8px;
  1579. animation: sheet-in 0.2s ease-out;
  1580. }
  1581. .toast span {
  1582. flex: 1;
  1583. }
  1584. .toast button {
  1585. font-size: 11px;
  1586. border: 1px solid currentColor;
  1587. border-radius: 7px;
  1588. padding: 5px 8px;
  1589. }
  1590. .preview-document {
  1591. aspect-ratio: 1.42;
  1592. background: #eeeee9;
  1593. color: #262926;
  1594. border-radius: 10px;
  1595. padding: 24px 22px;
  1596. margin: 18px 0;
  1597. display: flex;
  1598. flex-direction: column;
  1599. border: 1px solid #deded6;
  1600. }
  1601. .preview-document .doc-brand {
  1602. font-size: 9px;
  1603. letter-spacing: 2px;
  1604. color: #7b7d74;
  1605. }
  1606. .preview-document h2 {
  1607. font-size: 28px;
  1608. font-weight: 500;
  1609. line-height: 1.5;
  1610. margin: 22px 0 10px;
  1611. letter-spacing: -1px;
  1612. }
  1613. .preview-document p {
  1614. font-size: 11px;
  1615. color: #777a71;
  1616. }
  1617. .preview-document footer {
  1618. font-size: 8px;
  1619. border-top: 1px solid #cecec5;
  1620. padding-top: 10px;
  1621. margin-top: auto;
  1622. }
  1623. .preview-table {
  1624. border-collapse: collapse;
  1625. width: 100%;
  1626. font-size: 12px;
  1627. margin: 24px 0;
  1628. }
  1629. .preview-table td,
  1630. .preview-table th {
  1631. text-align: left;
  1632. border-bottom: 1px solid var(--edge);
  1633. padding: 13px 8px;
  1634. }
  1635. .preview-table th {
  1636. background: var(--surface-2);
  1637. font-size: 11px;
  1638. color: var(--muted);
  1639. }
  1640. .loading-dots {
  1641. display: flex;
  1642. gap: 5px;
  1643. padding: 12px 0;
  1644. }
  1645. .loading-dots i {
  1646. width: 5px;
  1647. height: 5px;
  1648. border-radius: 50%;
  1649. background: var(--muted);
  1650. animation: pulse 1s infinite alternate;
  1651. }
  1652. .loading-dots i:nth-child(2) {
  1653. animation-delay: 0.2s;
  1654. }
  1655. .loading-dots i:nth-child(3) {
  1656. animation-delay: 0.4s;
  1657. }
  1658. .skeleton {
  1659. height: 10px;
  1660. border-radius: 5px;
  1661. background: var(--subtle);
  1662. margin: 13px 0;
  1663. animation: pulse 1s infinite alternate;
  1664. }
  1665. .skeleton.short {
  1666. width: 65%;
  1667. }
  1668. .notification-option {
  1669. display: flex;
  1670. align-items: center;
  1671. gap: 10px;
  1672. font-size: 12px;
  1673. min-height: 44px;
  1674. margin-top: 12px;
  1675. }
  1676. .notification-option input {
  1677. accent-color: var(--primary);
  1678. width: 16px;
  1679. height: 16px;
  1680. }
  1681. .polished {
  1682. --canvas: #f5f5f7;
  1683. --edge: #e8e9ec;
  1684. --shadow: 0 2px 5px #17243c04;
  1685. --muted: #7a7d84;
  1686. }
  1687. .polished .appbar {
  1688. height: 70px;
  1689. padding: 0 20px;
  1690. }
  1691. .polished .round-button {
  1692. border: 1px solid color-mix(in srgb, var(--edge) 65%, transparent);
  1693. box-shadow: 0 2px 3px #20212403;
  1694. }
  1695. .polished .appbar-title h2 {
  1696. font-size: 17px;
  1697. font-weight: 650;
  1698. letter-spacing: 0.2px;
  1699. }
  1700. .polished .appbar-title p {
  1701. font-size: 10px;
  1702. }
  1703. .polished .segmented {
  1704. background: var(--subtle);
  1705. border: 0;
  1706. padding: 3px;
  1707. max-width: none;
  1708. margin: 3px 0 14px;
  1709. }
  1710. .polished .segmented button {
  1711. min-height: 34px;
  1712. font-size: 12px;
  1713. }
  1714. .polished .segmented button.selected {
  1715. box-shadow: 0 1px 4px #17243c0c;
  1716. font-weight: 600;
  1717. }
  1718. .polished .search {
  1719. border: 1px solid var(--edge);
  1720. border-radius: 13px;
  1721. height: 44px;
  1722. }
  1723. .polished .list {
  1724. border-color: color-mix(in srgb, var(--edge) 65%, transparent);
  1725. border-radius: 19px;
  1726. margin-top: 16px;
  1727. box-shadow: 0 3px 10px #20212402;
  1728. }
  1729. .polished .conversation {
  1730. padding: 16px 14px;
  1731. gap: 12px;
  1732. min-height: 81px;
  1733. }
  1734. .polished .conversation + .conversation {
  1735. border-top: 0;
  1736. }
  1737. .polished .conversation + .conversation:before {
  1738. content: '';
  1739. position: absolute;
  1740. left: 68px;
  1741. right: 14px;
  1742. height: 1px;
  1743. top: 0;
  1744. background: var(--edge);
  1745. opacity: 0.75;
  1746. }
  1747. .polished .avatar {
  1748. background: linear-gradient(145deg, var(--surface-2), var(--avatar));
  1749. color: var(--ink-2);
  1750. border: 1px solid color-mix(in srgb, var(--edge) 80%, transparent);
  1751. font-size: 16px;
  1752. font-weight: 500;
  1753. width: 42px;
  1754. height: 42px;
  1755. }
  1756. .polished .presence {
  1757. width: 8px;
  1758. height: 8px;
  1759. right: 1px;
  1760. bottom: 1px;
  1761. }
  1762. .polished .row-title {
  1763. font-size: 14px;
  1764. font-weight: 600;
  1765. line-height: 23px;
  1766. letter-spacing: 0.05px;
  1767. }
  1768. .polished .row-preview {
  1769. font-size: 11px;
  1770. line-height: 20px;
  1771. }
  1772. .polished .row-tail {
  1773. font-size: 9px;
  1774. gap: 9px;
  1775. }
  1776. .polished .unread {
  1777. background: #bc555a;
  1778. min-width: 16px;
  1779. height: 16px;
  1780. font-size: 9px;
  1781. }
  1782. .polished .row-meta {
  1783. display: flex;
  1784. align-items: center;
  1785. gap: 4px;
  1786. font-size: 9px;
  1787. color: #987128;
  1788. margin-top: 3px;
  1789. line-height: 15px;
  1790. }
  1791. .polished .row-meta svg {
  1792. width: 11px;
  1793. height: 11px;
  1794. }
  1795. .polished .row-meta.done {
  1796. color: #487c5e;
  1797. }
  1798. .polished .row-meta.error {
  1799. color: #b35858;
  1800. }
  1801. .polished .tabbar {
  1802. height: 72px;
  1803. border-top-color: color-mix(in srgb, var(--edge) 85%, transparent);
  1804. padding-top: 7px;
  1805. }
  1806. .polished .tabbar .tab-icon {
  1807. height: 29px;
  1808. transition: background 0.2s;
  1809. }
  1810. .polished .tabbar .selected .tab-icon {
  1811. background: var(--subtle);
  1812. }
  1813. .polished .tabbar button {
  1814. font-size: 10px;
  1815. gap: 4px;
  1816. }
  1817. .polished .tabbar svg {
  1818. width: 21px;
  1819. height: 21px;
  1820. }
  1821. .polished .chat-scroll {
  1822. padding: 6px 20px 14px;
  1823. }
  1824. .polished .chat-date {
  1825. margin: 5px 0 20px;
  1826. }
  1827. .polished .user-message {
  1828. font-size: 13px;
  1829. padding: 11px 14px;
  1830. border-radius: 16px 16px 5px 16px;
  1831. background: var(--subtle);
  1832. }
  1833. .polished .agent-line {
  1834. margin: 18px 0 10px;
  1835. gap: 7px;
  1836. font-size: 11px;
  1837. }
  1838. .polished .agent-line .avatar {
  1839. height: 25px;
  1840. width: 25px;
  1841. font-size: 10px;
  1842. }
  1843. .polished .process summary {
  1844. font-size: 9px;
  1845. min-height: 30px;
  1846. background: transparent;
  1847. border-color: var(--edge);
  1848. }
  1849. .polished .assistant-card {
  1850. padding: 16px;
  1851. border-radius: 17px;
  1852. border-color: var(--edge);
  1853. box-shadow: 0 2px 5px #20212402;
  1854. font-size: 13px;
  1855. line-height: 1.9;
  1856. }
  1857. .polished .assistant-card h3 {
  1858. font-size: 16px;
  1859. letter-spacing: -0.1px;
  1860. margin-bottom: 8px;
  1861. }
  1862. .polished .assistant-card p {
  1863. margin-bottom: 11px;
  1864. }
  1865. .polished .insight {
  1866. margin: 14px 0;
  1867. }
  1868. .polished .insight p {
  1869. font-size: 12px;
  1870. margin-bottom: 7px;
  1871. }
  1872. .polished .file-card {
  1873. background: var(--surface-2);
  1874. border-color: var(--edge);
  1875. padding: 10px;
  1876. border-radius: 11px;
  1877. }
  1878. .polished .file-card strong {
  1879. font-size: 10px;
  1880. }
  1881. .polished .composer-wrap {
  1882. padding: 0 16px 7px;
  1883. }
  1884. .polished .activity-entry {
  1885. display: flex;
  1886. width: 100%;
  1887. padding: 0 6px;
  1888. }
  1889. .polished .composer {
  1890. border-radius: 20px;
  1891. padding: 12px 12px 8px;
  1892. box-shadow: 0 3px 12px #20212405;
  1893. border: 1px solid var(--edge);
  1894. }
  1895. .polished .composer textarea {
  1896. padding: 1px 3px;
  1897. min-height: 42px;
  1898. height: 42px;
  1899. font-size: 14px;
  1900. }
  1901. .polished .input-hint {
  1902. display: block;
  1903. }
  1904. .polished .send-button {
  1905. width: 36px;
  1906. height: 36px;
  1907. }
  1908. .polished .agent-tool {
  1909. border-radius: 99px;
  1910. background: var(--surface-2);
  1911. min-height: 29px;
  1912. padding: 0 9px;
  1913. font-size: 10px;
  1914. }
  1915. .polished .tool-button {
  1916. width: 36px;
  1917. height: 36px;
  1918. }
  1919. .polished .overview {
  1920. border-radius: 18px;
  1921. padding: 19px 8px;
  1922. margin-top: 10px;
  1923. border-color: var(--edge);
  1924. }
  1925. .polished .overview strong {
  1926. font-size: 26px;
  1927. letter-spacing: -0.5px;
  1928. font-weight: 550;
  1929. }
  1930. .polished .life-card {
  1931. box-shadow: none;
  1932. padding: 16px;
  1933. border-radius: 18px;
  1934. }
  1935. .polished .life-head .avatar {
  1936. width: 40px;
  1937. height: 40px;
  1938. }
  1939. .polished .life-actions button {
  1940. min-height: 38px;
  1941. border-radius: 9px;
  1942. }
  1943. .polished .task-line {
  1944. padding: 11px 10px;
  1945. border-radius: 9px;
  1946. margin-top: 16px;
  1947. }
  1948. .polished .profile-card {
  1949. border-radius: 20px;
  1950. padding: 22px 18px;
  1951. }
  1952. .polished .profile-card .avatar {
  1953. width: 54px;
  1954. height: 54px;
  1955. font-size: 21px;
  1956. }
  1957. .polished .settings-card {
  1958. border-radius: 18px;
  1959. }
  1960. .polished .setting-row {
  1961. min-height: 62px;
  1962. }
  1963. .polished .setting-row + .setting-row {
  1964. border-top-color: var(--edge);
  1965. }
  1966. .polished .home-hero {
  1967. padding-top: 54px;
  1968. }
  1969. .polished .home-logo {
  1970. font-size: 55px;
  1971. }
  1972. .polished .sheet .list {
  1973. margin: 10px 0 0;
  1974. }
  1975. .polished .sheet .conversation {
  1976. padding: 14px 11px;
  1977. }
  1978. .polished .sheet .row-meta {
  1979. display: flex;
  1980. }
  1981. .polished .chat-scroll .assistant-card {
  1982. font-size: var(--chat-size);
  1983. }
  1984. .baseline .row-meta {
  1985. display: none;
  1986. }
  1987. .baseline .sheet .row-meta {
  1988. display: flex;
  1989. }
  1990. .baseline .agent-tool {
  1991. padding-left: 4px;
  1992. }
  1993. .baseline .agent-tool span {
  1994. display: none;
  1995. }
  1996. .baseline .input-hint {
  1997. display: none;
  1998. }
  1999. .baseline .life-actions button {
  2000. min-height: 34px;
  2001. }
  2002. .baseline .chat-scroll .assistant-card {
  2003. font-size: var(--chat-size);
  2004. }
  2005. :root {
  2006. font-family:
  2007. -apple-system, BlinkMacSystemFont, 'Noto Sans SC', 'Segoe UI', 'Microsoft YaHei', sans-serif;
  2008. }
  2009. .app-shell {
  2010. display: flex;
  2011. flex-direction: column;
  2012. flex: 1;
  2013. min-height: 0;
  2014. }
  2015. .file-card small {
  2016. display: flex;
  2017. align-items: center;
  2018. justify-content: space-between;
  2019. gap: 3px;
  2020. }
  2021. .file-card small svg {
  2022. width: 10px;
  2023. height: 10px;
  2024. }
  2025. .empty > .avatar {
  2026. margin: 0 auto 17px;
  2027. }
  2028. .person-children {
  2029. background: var(--surface-2);
  2030. padding-left: 24px;
  2031. }
  2032. .person-children .conversation {
  2033. min-height: 65px;
  2034. padding-top: 10px;
  2035. padding-bottom: 10px;
  2036. }
  2037. .person-children .avatar {
  2038. width: 32px;
  2039. height: 32px;
  2040. font-size: 13px;
  2041. }
  2042. .sheet .profile-card p {
  2043. line-height: 1.8;
  2044. }
  2045. .polished .conversation {
  2046. padding-top: 11px;
  2047. padding-bottom: 11px;
  2048. min-height: 76px;
  2049. }
  2050. .polished .row-title {
  2051. font-size: 15px;
  2052. font-weight: 550;
  2053. }
  2054. .polished .row-preview {
  2055. font-size: 12px;
  2056. }
  2057. .overview strong {
  2058. margin-top: 5px;
  2059. }
  2060. .overview span {
  2061. margin-top: 0;
  2062. }
  2063. @keyframes sheet-in {
  2064. from {
  2065. transform: translateY(16px);
  2066. opacity: 0;
  2067. }
  2068. to {
  2069. transform: translateY(0);
  2070. opacity: 1;
  2071. }
  2072. }
  2073. .activity-entry .activity-dot.idle {
  2074. background: var(--muted);
  2075. }
  2076. .send-button,
  2077. .close-button {
  2078. position: relative;
  2079. }
  2080. .send-button:before,
  2081. .close-button:before {
  2082. content: '';
  2083. position: absolute;
  2084. inset: -4px;
  2085. }
  2086. @keyframes drawer-in {
  2087. from {
  2088. transform: translateX(-20px);
  2089. opacity: 0;
  2090. }
  2091. to {
  2092. transform: translateX(0);
  2093. opacity: 1;
  2094. }
  2095. }
  2096. @keyframes pulse {
  2097. from {
  2098. opacity: 0.35;
  2099. }
  2100. to {
  2101. opacity: 1;
  2102. }
  2103. }
  2104. @media (min-width: 1500px) {
  2105. .studio {
  2106. padding-top: 42px;
  2107. }
  2108. .comparison {
  2109. gap: 70px;
  2110. }
  2111. .phone {
  2112. height: 820px;
  2113. }
  2114. }
  2115. @media (max-width: 1000px) and (min-width: 701px) {
  2116. .studio {
  2117. padding: 25px 25px;
  2118. }
  2119. .comparison {
  2120. gap: 28px;
  2121. }
  2122. .specimen {
  2123. width: min(390px, calc((100vw - 78px) / 2));
  2124. }
  2125. .phone {
  2126. height: 780px;
  2127. }
  2128. .studio-header {
  2129. margin: 0 25px;
  2130. }
  2131. .studio-heading {
  2132. align-items: flex-start;
  2133. }
  2134. .studio-heading p {
  2135. max-width: 360px;
  2136. }
  2137. .view-control button {
  2138. padding: 8px;
  2139. }
  2140. .specimen-caption > span {
  2141. display: none;
  2142. }
  2143. }
  2144. @media (max-width: 700px) {
  2145. html,
  2146. body {
  2147. height: 100%;
  2148. overflow: hidden;
  2149. background: #f5f5f7;
  2150. }
  2151. .studio-header,
  2152. .studio-heading,
  2153. .scene-nav,
  2154. .studio-footer,
  2155. .specimen-caption,
  2156. .specimen-note {
  2157. display: none;
  2158. }
  2159. .studio {
  2160. padding: 0;
  2161. height: 100dvh;
  2162. width: 100%;
  2163. max-width: none;
  2164. display: flex;
  2165. flex-direction: column;
  2166. }
  2167. .mobile-review {
  2168. height: 35px;
  2169. flex: none;
  2170. display: flex;
  2171. align-items: center;
  2172. gap: 3px;
  2173. padding: 0 12px;
  2174. background: #e9eaed;
  2175. color: #777c83;
  2176. font-size: 10px;
  2177. border-bottom: 1px solid #dfe1e4;
  2178. }
  2179. .mobile-review > span {
  2180. margin-right: auto;
  2181. letter-spacing: 0.3px;
  2182. }
  2183. .mobile-review button {
  2184. padding: 4px 11px;
  2185. border-radius: 5px;
  2186. font-size: 10px;
  2187. }
  2188. .mobile-review button.selected {
  2189. background: white;
  2190. color: #25272a;
  2191. box-shadow: 0 1px 2px #00000008;
  2192. }
  2193. .comparison {
  2194. display: block;
  2195. min-height: 0;
  2196. flex: 1;
  2197. }
  2198. .specimen {
  2199. width: 100%;
  2200. height: 100%;
  2201. }
  2202. .baseline-specimen {
  2203. display: none;
  2204. }
  2205. .phone {
  2206. height: 100%;
  2207. border-radius: 0;
  2208. box-shadow: none;
  2209. padding-top: env(safe-area-inset-top);
  2210. }
  2211. .statusbar {
  2212. display: none;
  2213. }
  2214. .home-indicator {
  2215. height: env(safe-area-inset-bottom);
  2216. min-height: 8px;
  2217. }
  2218. .home-indicator:after {
  2219. display: none;
  2220. }
  2221. .overlay {
  2222. top: 0;
  2223. }
  2224. .sheet {
  2225. padding-bottom: max(24px, env(safe-area-inset-bottom));
  2226. }
  2227. .toast {
  2228. top: 74px;
  2229. }
  2230. body[data-view='baseline'] .baseline-specimen {
  2231. display: block;
  2232. }
  2233. body[data-view='compare'] .polished-specimen {
  2234. display: block;
  2235. }
  2236. .polished .appbar-title h2 {
  2237. font-size: 16px;
  2238. }
  2239. .studio .specimen {
  2240. margin: 0;
  2241. }
  2242. .polished .appbar {
  2243. padding: 0 16px;
  2244. }
  2245. }
  2246. @media (max-width: 350px) {
  2247. .filter-area {
  2248. padding: 0 14px;
  2249. }
  2250. .list,
  2251. .life-card,
  2252. .overview,
  2253. .settings-card,
  2254. .profile-card {
  2255. margin-left: 14px;
  2256. margin-right: 14px;
  2257. }
  2258. .appbar,
  2259. .polished .appbar {
  2260. padding: 0 12px;
  2261. gap: 6px;
  2262. }
  2263. .appbar-right {
  2264. gap: 5px;
  2265. }
  2266. .round-button {
  2267. width: 40px;
  2268. height: 40px;
  2269. }
  2270. .polished .conversation,
  2271. .conversation {
  2272. padding-left: 12px;
  2273. padding-right: 12px;
  2274. gap: 9px;
  2275. }
  2276. .row-title,
  2277. .polished .row-title {
  2278. font-size: 13px;
  2279. }
  2280. .row-preview,
  2281. .polished .row-preview {
  2282. font-size: 10px;
  2283. }
  2284. .chat-scroll,
  2285. .polished .chat-scroll {
  2286. padding-left: 14px;
  2287. padding-right: 14px;
  2288. }
  2289. .sheet {
  2290. padding-left: 16px;
  2291. padding-right: 16px;
  2292. }
  2293. .appbar-title h2,
  2294. .polished .appbar-title h2 {
  2295. font-size: 14px;
  2296. }
  2297. .polished .avatar {
  2298. width: 38px;
  2299. height: 38px;
  2300. }
  2301. }
  2302. @media (prefers-reduced-motion: reduce) {
  2303. *,
  2304. *:before,
  2305. *:after {
  2306. animation: none !important;
  2307. transition: none !important;
  2308. scroll-behavior: auto !important;
  2309. }
  2310. }
  2311. </style>
  2312. </head>
  2313. <body>
  2314. <header class="studio-header">
  2315. <div class="brand">
  2316. <span class="brand-mark">f</span><strong>fmode</strong><span class="brand-divider"></span
  2317. ><span>Mobile UI refinement</span>
  2318. </div>
  2319. <span class="prototype-label">独立 HTML 原型 · 未接入业务</span>
  2320. </header>
  2321. <main class="studio">
  2322. <section class="studio-heading">
  2323. <div>
  2324. <div class="eyebrow">保留熟悉感,只打磨细节</div>
  2325. <h1>现有界面,轻一点。清楚一点。</h1>
  2326. <p>不换产品语言,不改业务流程。以项目现有移动端为底稿精修。</p>
  2327. </div>
  2328. <div class="view-control" aria-label="对照模式">
  2329. <button data-view="compare" class="selected">前后对照</button
  2330. ><button data-view="polished">只看精修</button
  2331. ><button data-view="baseline">只看原版</button>
  2332. </div>
  2333. </section>
  2334. <nav class="scene-nav" aria-label="预览页面"></nav>
  2335. <div class="mobile-review">
  2336. <span>fmode · UI 预览</span><button data-view="polished" class="selected">精修</button
  2337. ><button data-view="baseline">原版</button>
  2338. </div>
  2339. <section class="comparison" aria-label="移动端界面对照">
  2340. <article class="specimen baseline-specimen">
  2341. <header class="specimen-caption">
  2342. <div><span class="version-number">01</span><strong>现有 UI · HTML 复刻</strong></div>
  2343. <span>按当前源码还原</span>
  2344. </header>
  2345. <div class="phone baseline" id="baseline"></div>
  2346. <p class="specimen-note">保留当前配色、尺寸与布局;非生产页面截图。</p>
  2347. </article>
  2348. <article class="specimen polished-specimen">
  2349. <header class="specimen-caption">
  2350. <div><span class="version-number">02</span><strong>同一套 UI · 细节精修</strong></div>
  2351. <span class="live-label"><i></i> 可交互</span>
  2352. </header>
  2353. <div class="phone polished" id="polished"></div>
  2354. <p class="specimen-note" id="design-note"></p>
  2355. </article>
  2356. </section>
  2357. <footer class="studio-footer">
  2358. <span>同一份演示数据 · 页面切换同步对照</span
  2359. ><span>点击会话进入聊天,体验输入、切换与文件预览</span>
  2360. </footer>
  2361. </main>
  2362. <script>
  2363. (() => {
  2364. 'use strict';
  2365. const paths = {
  2366. menu: 'M4 6h16M4 12h12M4 18h16',
  2367. edit: 'M14 4l6 6M4 20l4-1L20 7a2.1 2.1 0 0 0-3-3L5 16zM13 4H5a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h13a2 2 0 0 0 2-2v-7',
  2368. chat: 'M21 11.5a8.5 8.5 0 0 1-8.5 8.5H5l-3 2 1.5-5A8.5 8.5 0 1 1 21 11.5zM7 10h10M7 14h6',
  2369. people:
  2370. 'M15 20H3v-2a5 5 0 0 1 10 0v2M21 20v-2a5 5 0 0 0-4-4M17 3a4 4 0 0 1 0 8M12 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0',
  2371. grid: 'M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h6v6h-6z',
  2372. user: 'M16 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0M4 21v-2a8 8 0 0 1 16 0v2',
  2373. search: 'M16.5 16.5L21 21M18 10.5a7.5 7.5 0 1 1-15 0 7.5 7.5 0 0 1 15 0',
  2374. plus: 'M12 5v14M5 12h14',
  2375. back: 'M15 5l-7 7 7 7',
  2376. chevron: 'M9 5l7 7-7 7',
  2377. down: 'M6 9l6 6 6-6',
  2378. close: 'M6 6l12 12M6 18L18 6',
  2379. folder: 'M3 7V5a2 2 0 0 1 2-2h5l2 3h7a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2zM3 9h18',
  2380. switch: 'M4 5h12M8 12h12M4 19h12M20 3v4M4 10v4M20 17v4',
  2381. arrow: 'M12 19V5M6 11l6-6 6 6',
  2382. attach: 'M8 13l7-7a3 3 0 0 1 4 4l-9 9a5 5 0 0 1-7-7l9-9M7 14l7-7',
  2383. target:
  2384. 'M12 3v4M12 17v4M3 12h4M17 12h4M19 12a7 7 0 1 1-14 0 7 7 0 0 1 14 0M14 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0',
  2385. check: 'M5 12l4 4L19 6',
  2386. clock: 'M12 7v5l3 2M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0',
  2387. copy: 'M8 8h12v13H8zM16 8V3H3v13h5',
  2388. refresh: 'M20 7a9 9 0 1 0 1 8M20 3v5h-5',
  2389. eye: 'M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0',
  2390. bell: 'M18 8a6 6 0 0 0-12 0c0 9-3 9-3 10h18c0-1-3-1-3-10M9 21h6',
  2391. archive: 'M3 3h18v5H3zM5 8v13h14V8M9 12h6',
  2392. file: 'M14 2H5v20h14V7zM14 2v5h5M8 12h8M8 16h6',
  2393. signal: 'M4 18v-3M9 18v-6M14 18V9M19 18V5',
  2394. wifi: 'M3 8a15 15 0 0 1 18 0M6 12a10 10 0 0 1 12 0M9 16a5 5 0 0 1 6 0M12 20h.01',
  2395. battery: 'M2 6h17v12H2zM22 10v4M5 9h11v6H5z',
  2396. moon: 'M20 14a8 8 0 0 1-10-10 9 9 0 1 0 10 10',
  2397. logout: 'M10 3H3v18h7M8 12h13M17 8l4 4-4 4',
  2398. home: 'M3 10l9-7 9 7v11h-7v-7h-4v7H3z',
  2399. info: 'M12 11v6M12 7h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0',
  2400. };
  2401. const icon = (name) =>
  2402. `<svg viewBox="0 0 24 24" aria-hidden="true"><path d="${paths[name] || paths.chat}"/></svg>`;
  2403. const escape = (value) =>
  2404. String(value ?? '').replace(
  2405. /[&<>"']/g,
  2406. (char) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[char],
  2407. );
  2408. const tabs = [
  2409. ['messages', '会话', 'chat'],
  2410. ['contacts', '通讯录', 'people'],
  2411. ['workbench', '工作台', 'grid'],
  2412. ['mine', '我的', 'user'],
  2413. ];
  2414. const scenes = [
  2415. ...tabs.slice(0, 1),
  2416. ['chat/c1', '会话详情', 'edit'],
  2417. ...tabs.slice(1),
  2418. ['home', '新建会话', 'plus'],
  2419. ];
  2420. const agents = [
  2421. { id: 'nova', name: 'Nova', job: '数据分析 · 商业洞察', state: '在线', cpu: 24, memory: 38 },
  2422. {
  2423. id: 'orbit',
  2424. name: 'Orbit',
  2425. job: '产品设计 · 前端开发',
  2426. state: '运行中',
  2427. cpu: 68,
  2428. memory: 52,
  2429. },
  2430. { id: 'atlas', name: 'Atlas', job: '项目管理 · 进度协同', state: '在线', cpu: 12, memory: 26 },
  2431. { id: 'echo', name: 'Echo', job: '内容创作 · 品牌文案', state: '在线', cpu: 8, memory: 21 },
  2432. {
  2433. id: 'pilot',
  2434. name: 'Pilot',
  2435. job: '工程开发 · 自动化',
  2436. state: '离线',
  2437. cpu: null,
  2438. memory: null,
  2439. },
  2440. ];
  2441. const sessions = [
  2442. {
  2443. id: 'c1',
  2444. title: '季度经营复盘报告',
  2445. agent: 'nova',
  2446. preview: '已生成 12 页 PPT 与数据附录',
  2447. time: '09:42',
  2448. unread: 3,
  2449. status: 'done',
  2450. workspace: 'w1',
  2451. },
  2452. {
  2453. id: 'c2',
  2454. title: '移动端首页改版',
  2455. agent: 'orbit',
  2456. preview: '首页骨架已完成,正在调整细节',
  2457. time: '09:15',
  2458. unread: 2,
  2459. status: 'running',
  2460. workspace: 'w2',
  2461. },
  2462. {
  2463. id: 'c3',
  2464. title: 'Q3 里程碑对齐',
  2465. agent: 'atlas',
  2466. preview: '本周 3 个阻塞项需要人工确认',
  2467. time: '昨天',
  2468. unread: 0,
  2469. status: 'waiting',
  2470. workspace: 'w1',
  2471. },
  2472. {
  2473. id: 'c4',
  2474. title: '产品发布会通稿润色',
  2475. agent: 'echo',
  2476. preview: '第二版已整理,等待你的反馈',
  2477. time: '昨天',
  2478. unread: 0,
  2479. status: 'idle',
  2480. workspace: null,
  2481. },
  2482. {
  2483. id: 'c5',
  2484. title: '构建流水线排障',
  2485. agent: 'pilot',
  2486. preview: '构建中断,需要检查环境配置',
  2487. time: '周五',
  2488. unread: 0,
  2489. status: 'error',
  2490. workspace: 'w2',
  2491. },
  2492. {
  2493. id: 'c6',
  2494. title: '上半年客户满意度分析',
  2495. agent: 'nova',
  2496. preview: '分析结果已保存至文件夹',
  2497. time: '周四',
  2498. unread: 0,
  2499. status: 'idle',
  2500. workspace: null,
  2501. },
  2502. ];
  2503. const workspaces = [
  2504. { id: 'w1', name: '经营与增长' },
  2505. { id: 'w2', name: '产品与研发' },
  2506. ];
  2507. const colleagues = [
  2508. { id: 'p1', name: '陈晓', mobile: '138****2608', agents: ['nova', 'atlas'] },
  2509. { id: 'p2', name: '林悦', mobile: '139****5316', agents: ['orbit', 'echo', 'pilot'] },
  2510. ];
  2511. const openPeople = new Set();
  2512. const storageKey = 'fmode-current-polish-v1';
  2513. let saved = {};
  2514. try {
  2515. saved = JSON.parse(localStorage.getItem(storageKey) || '{}');
  2516. } catch {}
  2517. const state = {
  2518. route: 'messages',
  2519. filter: 'all',
  2520. query: '',
  2521. contactFilter: 'all',
  2522. workFilter: 'all',
  2523. openGroups: new Set(),
  2524. overlay: null,
  2525. overlayData: null,
  2526. toast: null,
  2527. drafts: saved.drafts && typeof saved.drafts === 'object' ? saved.drafts : {},
  2528. palette: ['platinum', 'ice', 'clay', 'slate'].includes(saved.palette)
  2529. ? saved.palette
  2530. : 'platinum',
  2531. dark: !!saved.dark,
  2532. font: Math.max(12, Math.min(20, Number(saved.font) || 14)),
  2533. notify: saved.notify !== false,
  2534. tokenShown: false,
  2535. view: 'compare',
  2536. turns: {},
  2537. attachments: {},
  2538. returnRoute: 'messages',
  2539. };
  2540. let toastTimer;
  2541. let sourcePanel = 'polished';
  2542. let restoreAction = null;
  2543. const phones = [...document.querySelectorAll('.phone')];
  2544. const getAgent = (id) => agents.find((agent) => agent.id === id) || agents[0];
  2545. const current = () => sessions.find((session) => session.id === state.route.split('/')[1]);
  2546. const persist = () => {
  2547. try {
  2548. localStorage.setItem(
  2549. storageKey,
  2550. JSON.stringify({
  2551. drafts: state.drafts,
  2552. palette: state.palette,
  2553. dark: state.dark,
  2554. font: state.font,
  2555. notify: state.notify,
  2556. }),
  2557. );
  2558. } catch {}
  2559. };
  2560. const button = (name, label, action, extra = '') =>
  2561. `<button class="round-button" aria-label="${escape(label)}" title="${escape(label)}" data-action="${action}" ${extra}>${icon(name)}</button>`;
  2562. const avatar = (agent, online = true) =>
  2563. `<span class="avatar" aria-hidden="true">${escape(agent.name[0])}${online ? `<i class="presence ${agent.state === '离线' ? 'off' : ''}"></i>` : ''}</span>`;
  2564. const stateLabel = (session) =>
  2565. ({ running: '正在处理', done: '已完成', waiting: '待你确认', error: '需要处理' })[
  2566. session.status
  2567. ] || '';
  2568. const row = (session, activity = false) => {
  2569. const agent = getAgent(session.agent);
  2570. return `<button class="conversation" data-action="chat" data-id="${session.id}">${avatar(agent)}<span class="row-body"><span class="row-title">${escape(session.title)}</span><span class="row-preview">${escape(agent.name)} · ${escape(session.preview)}</span>${activity || ['running', 'waiting', 'error'].includes(session.status) ? `<span class="row-meta ${session.status}">${icon(session.status === 'done' ? 'check' : session.status === 'error' ? 'info' : 'clock')}${stateLabel(session) || '随时继续'}${activity && state.drafts[session.id] ? ' · 有草稿' : ''}</span>` : ''}</span><span class="row-tail"><time>${escape(session.time)}</time>${session.unread ? `<span class="unread">${session.unread}</span>` : ''}</span></button>`;
  2571. };
  2572. const statusbar = () =>
  2573. `<div class="statusbar" aria-hidden="true"><span>9:41</span><span class="status-icons">${icon('signal')}${icon('wifi')}${icon('battery')}</span></div>`;
  2574. function appbar() {
  2575. if (state.route.startsWith('agent/'))
  2576. return `<header class="appbar">${button('back', '返回通讯录', 'contacts')}<div class="appbar-title"><h2>容器设置</h2></div><span class="header-spacer"></span></header>`;
  2577. const session = current();
  2578. if (session)
  2579. return `<header class="appbar">${button('back', '返回会话', 'back')}<div class="appbar-title"><button data-action="title" aria-label="编辑会话标题"><h2>${escape(session.title)}</h2><p>${escape(getAgent(session.agent).name)} · ${session.status === 'running' ? '正在处理' : '会话可追踪'}</p></button></div><div class="appbar-right">${button('switch', '切换会话', 'activity')}${button('folder', '会话文件', 'files')}</div></header>`;
  2580. const title = tabs.find((tab) => tab[0] === state.route)?.[1] || '';
  2581. return `<header class="appbar">${button('menu', '打开导航', 'drawer')}<div class="appbar-title"><h2>${title}</h2></div>${state.route === 'messages' ? button('edit', '新建对话', 'new') : state.route === 'home' ? button('chat', '查看会话', 'messages') : '<span class="header-spacer"></span>'}</header>`;
  2582. }
  2583. const tabbar = () =>
  2584. `<nav class="tabbar" aria-label="主导航">${tabs.map(([route, label, name]) => `<button class="${state.route === route ? 'selected' : ''}" data-action="route" data-route="${route}" ${state.route === route ? 'aria-current="page"' : ''}><span class="tab-icon">${icon(name)}${route === 'messages' && sessions.some((session) => session.unread) ? `<span class="unread">${sessions.reduce((total, session) => total + session.unread, 0)}</span>` : ''}</span>${label}</button>`).join('')}</nav>`;
  2585. const segmented = (options, value, action) =>
  2586. `<div class="segmented" aria-label="筛选">${options.map(([key, label]) => `<button class="${value === key ? 'selected' : ''}" data-action="${action}" data-value="${key}" aria-pressed="${value === key}">${label}</button>`).join('')}</div>`;
  2587. const search = (placeholder) =>
  2588. `<label class="search">${icon('search')}<input data-field="search" aria-label="${placeholder}" type="search" value="${escape(state.query)}" placeholder="${placeholder}" autocomplete="off" /></label>`;
  2589. const empty = (title, description) =>
  2590. `<div class="empty">${icon('search')}<h3>${title}</h3><p>${description}</p></div>`;
  2591. function messages() {
  2592. const filtered = sessions.filter(
  2593. (session) =>
  2594. !session.archived &&
  2595. `${session.title} ${getAgent(session.agent).name} ${session.preview}`
  2596. .toLowerCase()
  2597. .includes(state.query.toLowerCase()),
  2598. );
  2599. let body;
  2600. if (state.filter === 'workspace') {
  2601. body =
  2602. `<div class="section-label"><span>工作区</span><button class="text-button" data-action="workspace-new">${icon('plus')}新建</button></div>` +
  2603. workspaces
  2604. .map((workspace) => {
  2605. const items = filtered.filter((session) => session.workspace === workspace.id);
  2606. return `<div class="list"><button class="group-toggle" data-action="group" data-id="${workspace.id}" aria-expanded="${state.openGroups.has(workspace.id)}">${icon('folder')}<strong>${escape(workspace.name)}</strong><span>${items.length} 个会话</span>${icon(state.openGroups.has(workspace.id) ? 'down' : 'chevron')}</button>${state.openGroups.has(workspace.id) ? items.map((session) => row(session)).join('') + `<div class="group-actions"><button data-action="workspace-rename" data-id="${workspace.id}">重命名</button><button data-action="workspace-delete" data-id="${workspace.id}">删除工作区</button></div>` : ''}</div>`;
  2607. })
  2608. .join('');
  2609. const daily = filtered.filter((session) => !session.workspace);
  2610. body += `<h3 class="section-label">日常会话</h3>${daily.length ? `<div class="list">${daily.map((session) => row(session)).join('')}</div>` : empty('暂无日常会话', '未归入工作区的会话将显示在这里')}`;
  2611. } else
  2612. body = filtered.length
  2613. ? `<div class="list">${filtered.map((session) => row(session)).join('')}</div><p class="list-footer">所有会话均已同步</p>`
  2614. : empty('没有找到相关会话', '试试会话标题或数字生命的名字');
  2615. return `<div class="filter-area">${segmented(
  2616. [
  2617. ['all', '全部'],
  2618. ['workspace', '工作区'],
  2619. ],
  2620. state.filter,
  2621. 'filter',
  2622. )}${search('搜索会话')}</div><main class="page-content">${body}</main>`;
  2623. }
  2624. const fileCards = () =>
  2625. `<div class="files"><button class="file-card" data-action="preview" data-id="ppt"><span class="file-type">PPT</span><strong>季度经营复盘.pptx</strong><small>12 页 · 2.4 MB ${icon('chevron')}</small></button><button class="file-card" data-action="preview" data-id="xlsx"><span class="file-type sheet">XLS</span><strong>经营数据附录.xlsx</strong><small>3 个工作表 · 128 KB ${icon('chevron')}</small></button></div>`;
  2626. const process = () =>
  2627. `<details class="process"><summary>${icon('check')}运行了 3 步 · terminal · 4s<span>已完成</span>${icon('down')}</summary><ol><li>读取并核对季度经营数据</li><li>整理核心指标与趋势</li><li>生成报告与数据附录</li></ol></details>`;
  2628. function initialTurn(session) {
  2629. const agent = getAgent(session.agent);
  2630. if (session.fresh)
  2631. return `<div class="empty">${avatar(agent, false)}<h3>和 ${escape(agent.name)} 开始新对话</h3><p>告诉我你想完成什么。<br>这条会话的过程与结果都会留在这里。</p></div>`;
  2632. if (session.id !== 'c1')
  2633. return `<p class="chat-date">今天 · ${escape(session.time)}</p><div class="user-message">${escape(session.title)},请帮我继续推进。</div><div class="agent-line">${avatar(agent, false)}${escape(agent.name)}<span class="agent-status">${stateLabel(session)}</span></div><div class="assistant-card"><h3>${escape(session.title)}</h3><p>${escape(session.preview)}</p><p>这是用于预览当前移动端布局的演示内容。</p>${session.status === 'running' ? '<div class="skeleton"></div><div class="skeleton short"></div>' : ''}</div>`;
  2634. return `<p class="chat-date">今天 · 09:41</p><div class="user-message">帮我整理本季度的经营数据,做一份复盘报告,重点看收入增长和客户留存。</div><div class="agent-line">${avatar(agent, false)}${escape(agent.name)}<span class="agent-status">09:42</span></div>${process()}<section class="assistant-card"><h3>季度复盘,已经整理好了。</h3><p>我梳理了本季度的经营表现,三个值得关注的变化:</p><div class="insight"><p><b>收入稳步增长</b><br>环比增长 18.6%,核心产品持续拉动。</p><p><b>客户留存改善</b><br>续费率达到 92%,较上季度提升 4 个百分点。</p><p><b>下一步的重点</b><br>优化新客转化,持续跟进高价值客户。</p></div><p>完整结论和数据已放进报告,可以直接预览。</p>${fileCards()}</section><div class="response-actions"><button aria-label="复制回复" data-action="copy">${icon('copy')}</button><button aria-label="会话更多操作" data-action="chat-menu">${icon('switch')}</button></div>`;
  2635. }
  2636. function composer(session) {
  2637. const key = session?.id || 'home';
  2638. const attachment = state.attachments[key];
  2639. const busy = session?.sending;
  2640. const count = sessions.filter((item) => item.status === 'running').length;
  2641. return `<footer class="composer-wrap">${session ? `<button class="activity-entry" data-action="activity"><i class="activity-dot ${count ? '' : 'idle'}"></i><span>${count ? `${count} 个会话进行中` : '暂无运行中的会话'} · 随时切换,不丢草稿</span>${icon('chevron')}</button>` : ''}<div class="composer">${attachment ? `<div class="attachment-chip">${icon('file')}<span>${escape(attachment)}</span><button data-action="remove-attachment" aria-label="移除附件">${icon('close')}</button></div>` : ''}<textarea data-field="draft" aria-label="消息输入框" rows="2" placeholder="${session ? '发送消息,继续一起推进…' : '想做什么?从这里开始…'}">${escape(state.drafts[key] || '')}</textarea><div class="composer-tools"><button class="tool-button" data-action="attach" aria-label="添加附件">${icon('attach')}</button><button class="agent-tool" data-action="${session ? 'chat-menu' : 'new'}" aria-label="${session ? '当前数字生命操作' : '选择数字生命'}">${icon('target')}<span>${session ? escape(getAgent(session.agent).name) : '选择数字生命'}</span>${session ? icon('down') : ''}</button><button class="send-button" aria-label="发送消息" data-action="send" ${busy || (!state.drafts[key]?.trim() && !attachment) ? 'disabled' : ''}>${icon('arrow')}</button></div><input type="file" data-field="attachment" hidden /></div><p class="input-hint">Enter 换行 · 点击箭头发送</p></footer>`;
  2642. }
  2643. function chat() {
  2644. const session = current();
  2645. if (!session)
  2646. return `<main class="page-content">${empty('会话不存在', '请返回会话列表重新选择。')}<button class="primary-button" data-action="messages">返回会话</button></main>`;
  2647. const turns = state.turns[session.id] || [];
  2648. return `<main class="page-content chat-scroll">${initialTurn(session)}${turns.map((turn) => `<div class="user-message">${escape(turn.text)}${turn.attachment ? `<br>附件:${escape(turn.attachment)}` : ''}</div><div class="agent-line">${avatar(getAgent(session.agent), false)}${escape(getAgent(session.agent).name)}</div><div class="assistant-card">${turn.done ? '<p>收到,已记录这次补充。实际项目中会继续调用原有会话流程。</p><p>这是本地原型的演示回复,未请求 AI 或业务接口。</p>' : '<div class="loading-dots" aria-label="处理中"><i></i><i></i><i></i></div>'}</div>`).join('')}</main>${composer(session)}`;
  2649. }
  2650. function contacts() {
  2651. const filtered = agents.filter((agent) =>
  2652. `${agent.name} ${agent.job}`.toLowerCase().includes(state.query.toLowerCase()),
  2653. );
  2654. const people = colleagues.filter((person) =>
  2655. `${person.name} ${person.mobile} ${person.agents.map((id) => getAgent(id).name).join(' ')}`
  2656. .toLowerCase()
  2657. .includes(state.query.toLowerCase()),
  2658. );
  2659. const agentRow = (agent) =>
  2660. `<button class="conversation" data-action="agent" data-id="${agent.id}">${avatar(agent)}<span class="row-body"><strong class="row-title">${escape(agent.name)}</strong><span class="row-preview">${escape(agent.job)}</span></span><span class="row-tail">${icon('chevron')}</span></button>`;
  2661. let body = '';
  2662. if (state.contactFilter !== 'agents' && people.length)
  2663. body += `<h3 class="section-label">同事 · ${people.length}</h3><div class="list">${people.map((person) => `<button class="conversation" data-action="person" data-id="${person.id}" aria-expanded="${openPeople.has(person.id)}">${avatar(person, false)}<span class="row-body"><span class="row-title">${person.name}</span><span class="row-preview">${person.mobile} · ${person.agents.length} 个容器</span></span>${icon(openPeople.has(person.id) ? 'down' : 'chevron')}</button>${openPeople.has(person.id) ? `<div class="person-children">${person.agents.map((id) => agentRow(getAgent(id))).join('')}</div>` : ''}`).join('')}</div>`;
  2664. if (state.contactFilter !== 'people' && filtered.length)
  2665. body += `<h3 class="section-label">数字生命 · ${filtered.length}</h3><div class="list">${filtered.map(agentRow).join('')}</div>`;
  2666. return `<div class="filter-area">${segmented(
  2667. [
  2668. ['all', '全部'],
  2669. ['agents', '数字生命'],
  2670. ['people', '同事'],
  2671. ],
  2672. state.contactFilter,
  2673. 'contact-filter',
  2674. )}${search('搜索名称或专长')}</div><main class="page-content">${body || empty('没有匹配的联系人', '试试名称或专长')}</main>`;
  2675. }
  2676. function agentPage() {
  2677. const agent = getAgent(state.route.split('/')[1]);
  2678. return `<main class="page-content"><section class="settings-card" style="margin-top:16px"><div class="setting-row"><span class="row-body">当前名称</span><strong>${escape(agent.name)}</strong></div><button class="setting-row" data-action="rename-agent" data-id="${agent.id}">${icon('edit')}<span class="row-body">重命名</span>${icon('chevron')}</button><button class="setting-row" data-action="create-chat" data-id="${agent.id}">${icon('chat')}<span class="row-body">进入会话</span>${icon('chevron')}</button></section><p class="list-footer">演示管理员操作 · 仅修改本地示例</p></main>`;
  2679. }
  2680. function lifeCard(agent) {
  2681. const session = sessions.find((item) => item.agent === agent.id);
  2682. return `<article class="life-card"><div class="life-head">${avatar(agent)}<div class="row-body"><strong>${escape(agent.name)}</strong><small>${escape(agent.job)}</small></div><span class="state-tag ${agent.state === '运行中' ? 'busy' : agent.state === '离线' ? 'offline' : ''}">${agent.state}</span></div><div class="task-line">${icon('chat')}<span>${session ? escape(session.title) : '暂无进行中的会话'}</span></div>${
  2683. agent.cpu === null
  2684. ? '<p class="task-line">指标未上报</p>'
  2685. : `<div class="metrics">${[
  2686. ['CPU', agent.cpu],
  2687. ['内存', agent.memory],
  2688. ]
  2689. .map(
  2690. ([label, value]) =>
  2691. `<div class="metric"><div><span>${label}</span><span>${value}%</span></div><div class="metric-track"><i style="width:${value}%"></i></div></div>`,
  2692. )
  2693. .join('')}</div>`
  2694. }<div class="life-actions"><button data-action="enter-agent" data-id="${agent.id}">进入</button><button data-action="channel" data-id="${agent.id}">通道</button><button data-action="recharge" data-id="${agent.id}">充值</button></div></article>`;
  2695. }
  2696. function workbench() {
  2697. const filtered = agents.filter(
  2698. (agent) =>
  2699. (state.workFilter === 'all' ||
  2700. (state.workFilter === 'online' ? agent.state !== '离线' : agent.state === '离线')) &&
  2701. `${agent.name} ${agent.job}`.toLowerCase().includes(state.query.toLowerCase()),
  2702. );
  2703. return `<div class="filter-area">${segmented(
  2704. [
  2705. ['all', '全部'],
  2706. ['online', '在线'],
  2707. ['offline', '离线'],
  2708. ],
  2709. state.workFilter,
  2710. 'work-filter',
  2711. )}${search('搜索数字生命')}</div><main class="page-content"><div class="overview"><div><span>数字生命</span><strong>5</strong></div><div><span>在线</span><strong>4</strong></div><div><span>离线</span><strong>1</strong></div></div>${filtered.length ? filtered.map(lifeCard).join('') : empty('暂无匹配的数字生命', '切换筛选或试试其他关键词')}</main>`;
  2712. }
  2713. function mine() {
  2714. return `<main class="page-content"><section class="profile-card"><span class="avatar">F</span><div><h3>fmode 体验账号</h3><p>演示资料 · 人机共生中枢</p></div></section><h3 class="section-label">账号</h3><section class="settings-card"><div class="setting-row"><span class="row-body">访问 Token<small>${state.tokenShown ? 'DEMO-TOKEN-NOT-A-REAL-CREDENTIAL' : '•••• •••• •••• ••••'}</small></span><button class="tool-button" data-action="token" aria-label="${state.tokenShown ? '隐藏' : '显示'} Token">${icon('eye')}</button><button class="tool-button" data-action="copy-token" aria-label="复制 Token" ${state.tokenShown ? '' : 'disabled'}>${icon('copy')}</button></div><button class="setting-row" data-action="logout"><span class="row-body danger">退出登录</span>${icon('chevron')}</button></section><h3 class="section-label">通知</h3><section class="settings-card"><button class="setting-row" data-action="notifications">${icon('bell')}<span class="row-body">消息与任务通知<small>原生端入口 · 此处仅演示提醒</small></span>${icon('chevron')}</button></section><h3 class="section-label">外观</h3><section class="settings-card"><p class="palette-label">整体配色</p><div class="palette-grid">${[
  2715. ['platinum', '铂金曜黑', '#25272a'],
  2716. ['ice', '冰白靛蓝', '#4056c7'],
  2717. ['clay', '暖瓷陶橘', '#af482b'],
  2718. ['slate', '岩灰鸢紫', '#6952a3'],
  2719. ]
  2720. .map(
  2721. ([id, name, color]) =>
  2722. `<button data-action="palette" data-id="${id}" aria-pressed="${state.palette === id}" class="${state.palette === id ? 'selected' : ''}"><span class="palette-swatch" style="background:${color}"></span>${name}</button>`,
  2723. )
  2724. .join(
  2725. '',
  2726. )}</div><div class="setting-row"><span class="row-body">深色模式<small>跟随手动切换</small></span><button class="switch" role="switch" aria-checked="${state.dark}" aria-label="深色模式" data-action="dark"></button></div><div class="font-slider"><label>正文字号<span>${state.font}px</span></label><input data-field="font" type="range" min="12" max="20" value="${state.font}" aria-label="正文字号" /></div></section></main>`;
  2727. }
  2728. function home() {
  2729. return `<main class="page-content"><section class="home-hero"><div class="home-logo">fmode</div><h3>人机共生中枢</h3><p>和数字生命一起干活 · 每条会话都可追踪</p></section><div class="section-label"><span>最近会话</span><button class="text-button" data-action="messages">全部${icon('chevron')}</button></div><div class="list">${sessions
  2730. .filter((session) => !session.archived)
  2731. .slice(0, 2)
  2732. .map((session) => row(session))
  2733. .join('')}</div></main>${composer(null)}`;
  2734. }
  2735. function drawer() {
  2736. return `<div class="overlay drawer-overlay" data-action="dismiss"><aside class="drawer" role="dialog" aria-modal="true" aria-label="导航菜单"><div class="drawer-head"><strong>fmode</strong><button class="close-button" data-action="close" aria-label="关闭导航">${icon('close')}</button></div><button class="drawer-new" data-action="new">${icon('plus')}<span><strong>新建对话</strong><small>选择数字生命</small></span></button>${current() ? `<button class="drawer-quick" data-action="quick-new">${icon('edit')}在本容器新建 · ${escape(getAgent(current().agent).name)}</button>` : ''}<nav class="drawer-nav">${tabs.map(([route, label, name]) => `<button data-action="route" data-route="${route}" class="${state.route === route ? 'selected' : ''}">${icon(name)}${label}</button>`).join('')}</nav><div class="drawer-section">工作区<button data-action="workspace-new" aria-label="新建工作区">${icon('plus')}</button></div>${workspaces.map((workspace) => `<button class="drawer-item" data-action="workspace-open" data-id="${workspace.id}">${icon('folder')}<span>${escape(workspace.name)}</span></button>`).join('')}<div class="drawer-section">日常会话</div>${sessions
  2737. .filter((session) => !session.archived)
  2738. .slice(0, 4)
  2739. .map(
  2740. (session) =>
  2741. `<button class="drawer-item" data-action="chat" data-id="${session.id}">${icon('chat')}<span>${escape(session.title)}</span></button>`,
  2742. )
  2743. .join(
  2744. '',
  2745. )}<button class="drawer-item" data-action="archived">${icon('archive')}已归档会话</button><div class="drawer-footer"><span class="avatar">F</span><span>fmode 体验账号<small>独立预览 · 不影响真实数据</small></span></div></aside></div>`;
  2746. }
  2747. function sheet(title, content) {
  2748. return `<div class="overlay" data-action="dismiss"><section class="sheet" role="dialog" aria-modal="true" aria-label="${escape(title)}"><div class="sheet-handle"></div><header class="sheet-heading"><h3>${escape(title)}</h3><button class="close-button" data-action="close" aria-label="关闭弹层">${icon('close')}</button></header>${content}</section></div>`;
  2749. }
  2750. function overlay() {
  2751. const data = state.overlayData;
  2752. switch (state.overlay) {
  2753. case 'drawer':
  2754. return drawer();
  2755. case 'activity':
  2756. return sheet(
  2757. '切换会话',
  2758. `<p class="sheet-description">任务在后台继续,输入草稿留在各自会话。</p><div class="list">${sessions
  2759. .filter((session) => !session.archived)
  2760. .map((session) => row(session, true))
  2761. .join(
  2762. '',
  2763. )}</div><button class="text-button" data-action="demo-complete">${icon('bell')}演示:让后台任务完成</button>`,
  2764. );
  2765. case 'title':
  2766. return sheet(
  2767. '会话标题',
  2768. `<p class="sheet-description">一个清楚的标题,让下次继续更容易。</p><form data-form="title"><label class="field-label">标题</label><input class="form-field" data-field="title" aria-label="会话标题" maxlength="60" value="${escape(current()?.title)}" /><p class="form-error" aria-live="polite"></p><button type="button" class="text-button" data-action="suggest-title">${icon('refresh')}看看其他标题建议</button><div class="candidates"></div><button class="primary-button" type="submit">保存标题</button></form>`,
  2769. );
  2770. case 'new':
  2771. return sheet(
  2772. '选择数字生命',
  2773. `<p class="sheet-description">开启一条新会话,原有会话和草稿不受影响。</p><div class="list">${agents.map((agent) => `<button class="conversation" data-action="create-chat" data-id="${agent.id}">${avatar(agent)}<span class="row-body"><strong class="row-title">${escape(agent.name)}</strong><span class="row-preview">${escape(agent.job)}</span></span>${icon('chevron')}</button>`).join('')}</div>`,
  2774. );
  2775. case 'chat-menu':
  2776. return sheet(
  2777. getAgent(current()?.agent).name,
  2778. `<p class="sheet-description">当前数字生命 · ${escape(getAgent(current()?.agent).job)}</p><button class="setting-row" data-action="quick-new">${icon('plus')}<span class="row-body">在本容器新建会话</span>${icon('chevron')}</button><button class="setting-row" data-action="title">${icon('edit')}<span class="row-body">编辑会话标题</span>${icon('chevron')}</button><button class="setting-row" data-action="archive">${icon('archive')}<span class="row-body">归档当前会话</span>${icon('chevron')}</button>`,
  2779. );
  2780. case 'files':
  2781. return sheet(
  2782. '会话文件',
  2783. `<p class="sheet-description">${current()?.id === 'c1' ? '本次会话生成的 2 个文件' : '当前会话暂无文件'} · 演示预览</p>${current()?.id === 'c1' ? fileCards() : empty('还没有文件', '会话生成的文件会集中保存在这里')}`,
  2784. );
  2785. case 'preview':
  2786. return sheet(
  2787. data === 'ppt' ? '季度经营复盘.pptx' : '经营数据附录.xlsx',
  2788. `<p class="sheet-description">演示文件 · ${data === 'ppt' ? '第 1 / 12 页' : '工作表 1 / 3'}</p>${data === 'ppt' ? '<div class="preview-document"><span class="doc-brand">FMODE / QUARTERLY REVIEW</span><h2>每一份增长,<br>都有迹可循。</h2><p>季度经营复盘报告</p><footer>BUSINESS INSIGHTS &nbsp; / &nbsp; 01</footer></div>' : '<table class="preview-table"><thead><tr><th>核心指标</th><th>本季度</th><th>变化</th></tr></thead><tbody><tr><td>营收增长</td><td>18.6%</td><td>↑ 6.2%</td></tr><tr><td>客户续费率</td><td>92%</td><td>↑ 4%</td></tr><tr><td>满意度</td><td>4.8 / 5</td><td>↑ 0.3</td></tr></tbody></table>'}<p class="sheet-description">仅展示文件预览的视觉样式;未生成真实 PPT / Excel 文件。</p>`,
  2789. );
  2790. case 'workspace-new':
  2791. case 'workspace-rename':
  2792. return sheet(
  2793. state.overlay === 'workspace-new' ? '新建工作区' : '重命名工作区',
  2794. `<p class="sheet-description">将同一场景的会话整理在一起。</p><form data-form="workspace"><label class="field-label">工作区名称</label><input class="form-field" data-field="workspace" aria-label="工作区名称" maxlength="30" value="${escape(data?.name || '')}"/><p class="form-error" aria-live="polite"></p><button type="submit" class="primary-button">保存工作区</button></form>`,
  2795. );
  2796. case 'workspace-delete':
  2797. return sheet(
  2798. '删除工作区',
  2799. `<p class="sheet-description">删除「${escape(data.name)}」后,里面的会话会移至日常会话,不会被删除。</p><button class="primary-button" data-action="confirm-workspace-delete" data-id="${data.id}">删除工作区,保留会话</button>`,
  2800. );
  2801. case 'agent': {
  2802. const agent = getAgent(data);
  2803. return sheet(
  2804. agent.name,
  2805. `<div class="profile-card" style="margin:12px 0 20px">${avatar(agent)}<div><h3>${escape(agent.name)}</h3><p>${escape(agent.job)}</p></div></div><button class="setting-row" data-action="rename-agent" data-id="${agent.id}">${icon('edit')}<span class="row-body">修改名称</span>${icon('chevron')}</button><button class="primary-button" data-action="create-chat" data-id="${agent.id}">开始新会话</button>`,
  2806. );
  2807. }
  2808. case 'rename-agent':
  2809. return sheet(
  2810. '修改数字生命名称',
  2811. `<form data-form="agent"><label class="field-label">名称</label><input class="form-field" aria-label="数字生命名称" data-field="agent-name" maxlength="30" value="${escape(getAgent(data).name)}"/><p class="form-error" aria-live="polite"></p><button type="submit" class="primary-button">保存名称</button></form>`,
  2812. );
  2813. case 'channel':
  2814. return sheet(
  2815. '通道',
  2816. `<p class="sheet-description">${escape(getAgent(data).name)} 的通道入口</p><div class="setting-row">${icon('chat')}<span class="row-body">fmode 应用内会话<small>演示状态 · 已连接</small></span><span class="state-tag">在线</span></div><p class="sheet-description">此稿保留原入口,不修改通道配置或接入逻辑。</p>`,
  2817. );
  2818. case 'recharge':
  2819. return sheet(
  2820. '充值',
  2821. `<p class="sheet-description">${escape(getAgent(data).name)} 的充值入口</p><div class="empty">${icon('info')}<h3>这里仅预览界面</h3><p>未创建订单,也不会产生支付。<br>迁移时继续使用项目原有充值流程。</p></div>`,
  2822. );
  2823. case 'notifications':
  2824. return sheet(
  2825. '消息与任务通知',
  2826. `<p class="sheet-description">完成提醒不会打断当前输入。真实系统权限仍由原项目负责。</p><div class="setting-row"><span class="row-body">原型内完成提醒</span><button role="switch" class="switch" aria-checked="${state.notify}" aria-label="完成提醒" data-action="notify"></button></div><button class="primary-button" data-action="demo-complete">演示一次完成提醒</button>`,
  2827. );
  2828. case 'archived': {
  2829. const archived = sessions.filter((session) => session.archived);
  2830. return sheet(
  2831. '已归档会话',
  2832. archived.length
  2833. ? `<div class="list">${archived.map((session) => `<div class="setting-row"><span class="row-body">${escape(session.title)}</span><button class="text-button" data-action="restore" data-id="${session.id}">恢复</button></div>`).join('')}</div>`
  2834. : empty('没有已归档会话', '归档的会话会保留在这里,随时可以恢复'),
  2835. );
  2836. }
  2837. case 'logout':
  2838. return sheet(
  2839. '退出登录',
  2840. `<p class="sheet-description">这是一份独立的 HTML 原型。确认后只展示未登录状态,不会退出你的真实账号。</p><button class="primary-button" data-action="confirm-logout">确认退出(演示)</button>`,
  2841. );
  2842. case 'logged-out':
  2843. return sheet(
  2844. '已退出演示账号',
  2845. `<div class="empty">${icon('user')}<h3>随时回来,继续对话。</h3><p>没有改动真实项目的登录状态。</p></div><button class="primary-button" data-action="close">返回预览</button>`,
  2846. );
  2847. default:
  2848. return '';
  2849. }
  2850. }
  2851. function render(keepScroll = true) {
  2852. const focused = document.activeElement;
  2853. const activeField = focused?.dataset?.field;
  2854. const focusedPanel = focused?.closest('.phone')?.id;
  2855. const selection = activeField && focused.type !== 'range' ? focused.selectionStart : null;
  2856. const notes = {
  2857. messages: '更柔和的边界 · 内缩分割线 · 清晰的任务状态',
  2858. chat: '保留回复卡片 · 降低输入区重量 · 草稿随会话保留',
  2859. contacts: '沿用字母头像 · 更有层次的名称与能力描述',
  2860. workbench: '保留运行指标和三个操作 · 统一卡片节奏',
  2861. mine: '保留四套配色与设置项 · 更轻的设置分组',
  2862. home: '保留 fmode 品牌和文案 · 收紧首屏节奏',
  2863. };
  2864. document.querySelector('.scene-nav').innerHTML = scenes
  2865. .map(
  2866. ([route, label, name]) =>
  2867. `<button data-action="route" data-route="${route}" class="${state.route === route || (route === 'chat/c1' && state.route.startsWith('chat/')) ? 'selected' : ''}">${icon(name)}${label}</button>`,
  2868. )
  2869. .join('');
  2870. document.querySelector('#design-note').textContent = notes[state.route.split('/')[0]] || '';
  2871. phones.forEach((phone) => {
  2872. const scroll = keepScroll ? phone.querySelector('.page-content')?.scrollTop || 0 : 0;
  2873. const sheetScroll = keepScroll ? phone.querySelector('.sheet')?.scrollTop || 0 : 0;
  2874. phone.classList.toggle('dark', state.dark);
  2875. phone.dataset.palette = state.palette;
  2876. phone.style.setProperty('--chat-size', `${state.font}px`);
  2877. const content = state.route.startsWith('chat/')
  2878. ? chat()
  2879. : state.route.startsWith('agent/')
  2880. ? agentPage()
  2881. : ({ messages, contacts, workbench, mine, home }[state.route] || messages)();
  2882. phone.innerHTML = `${statusbar()}<div class="app-shell" ${state.overlay ? 'inert' : ''}>${appbar()}${content}${tabs.some((tab) => tab[0] === state.route) ? tabbar() : ''}<div class="home-indicator" aria-hidden="true"></div></div>${overlay()}${state.toast ? `<div class="toast" role="status">${icon('check')}<span>${escape(state.toast.text)}</span>${state.toast.session ? `<button data-action="chat" data-id="${state.toast.session}">查看</button>` : ''}</div>` : ''}`;
  2883. const contentElement = phone.querySelector('.page-content');
  2884. if (contentElement) contentElement.scrollTop = scroll;
  2885. const sheetElement = phone.querySelector('.sheet');
  2886. if (sheetElement) sheetElement.scrollTop = sheetScroll;
  2887. const textarea = phone.querySelector('textarea');
  2888. if (textarea) resizeTextarea(textarea);
  2889. });
  2890. if (activeField && focusedPanel) {
  2891. const field = document.querySelector(`#${focusedPanel} [data-field="${activeField}"]`);
  2892. if (field) {
  2893. field.focus({ preventScroll: true });
  2894. if (selection !== null && field.setSelectionRange)
  2895. field.setSelectionRange(selection, selection);
  2896. }
  2897. }
  2898. }
  2899. function resizeTextarea(textarea) {
  2900. textarea.style.height = 'auto';
  2901. textarea.style.height = `${Math.min(112, Math.max(textarea.closest('.polished') ? 42 : 48, textarea.scrollHeight))}px`;
  2902. }
  2903. function go(route) {
  2904. state.query = '';
  2905. state.overlay = null;
  2906. state.overlayData = null;
  2907. state.toast = null;
  2908. if (!route.startsWith('chat/')) state.returnRoute = route;
  2909. state.route = route;
  2910. const session = current();
  2911. if (session) session.unread = 0;
  2912. if (location.hash !== `#/${route}`) history.replaceState(null, '', `#/${route}`);
  2913. render(false);
  2914. }
  2915. function showOverlay(name, data = null) {
  2916. restoreAction = document.activeElement?.dataset?.action || restoreAction;
  2917. state.overlay = name;
  2918. state.overlayData = data;
  2919. render();
  2920. const panel = document.getElementById(sourcePanel);
  2921. const field = panel.querySelector('.overlay input:not([type=checkbox])');
  2922. (field || panel.querySelector('.overlay button'))?.focus({ preventScroll: true });
  2923. if (field?.select) field.select();
  2924. }
  2925. function closeOverlay() {
  2926. state.overlay = null;
  2927. state.overlayData = null;
  2928. render();
  2929. const panel = document.getElementById(sourcePanel);
  2930. panel.querySelector(`[data-action="${restoreAction}"]`)?.focus({ preventScroll: true });
  2931. }
  2932. function toast(text, session = null) {
  2933. state.toast = { text, session };
  2934. render();
  2935. clearTimeout(toastTimer);
  2936. toastTimer = setTimeout(() => {
  2937. state.toast = null;
  2938. phones.forEach((phone) => phone.querySelector('.toast')?.remove());
  2939. }, 4200);
  2940. }
  2941. function createChat(agentId) {
  2942. if (getAgent(agentId).state === '离线') {
  2943. toast('该数字生命当前离线,请恢复在线后再开始会话');
  2944. return;
  2945. }
  2946. const id = `c${Date.now()}${sessions.length}`;
  2947. sessions.unshift({
  2948. id,
  2949. title: '新对话',
  2950. agent: agentId,
  2951. preview: '从一个想法开始',
  2952. time: '刚刚',
  2953. unread: 0,
  2954. status: 'idle',
  2955. workspace: null,
  2956. fresh: true,
  2957. });
  2958. if (state.drafts.home) {
  2959. state.drafts[id] = state.drafts.home;
  2960. delete state.drafts.home;
  2961. }
  2962. if (state.attachments.home) {
  2963. state.attachments[id] = state.attachments.home;
  2964. delete state.attachments.home;
  2965. }
  2966. persist();
  2967. go(`chat/${id}`);
  2968. }
  2969. function send() {
  2970. const session = current();
  2971. if (!session) {
  2972. showOverlay('new');
  2973. return;
  2974. }
  2975. if (getAgent(session.agent).state === '离线') {
  2976. toast('该数字生命当前离线,草稿已保留');
  2977. return;
  2978. }
  2979. const text = (state.drafts[session.id] || '').trim();
  2980. const attachment = state.attachments[session.id];
  2981. if ((!text && !attachment) || session.sending) return;
  2982. const turn = { text, attachment, done: false };
  2983. (state.turns[session.id] ||= []).push(turn);
  2984. state.drafts[session.id] = '';
  2985. delete state.attachments[session.id];
  2986. session.status = 'running';
  2987. session.sending = true;
  2988. session.preview = text || attachment;
  2989. persist();
  2990. render();
  2991. phones.forEach((phone) => {
  2992. const scroll = phone.querySelector('.chat-scroll');
  2993. if (scroll) scroll.scrollTop = scroll.scrollHeight;
  2994. });
  2995. setTimeout(() => {
  2996. turn.done = true;
  2997. session.status = 'done';
  2998. session.sending = false;
  2999. session.preview = '已完成这次补充 · 原型演示';
  3000. session.time = '刚刚';
  3001. if (current()?.id !== session.id) {
  3002. session.unread += 1;
  3003. if (state.notify)
  3004. toast(`${getAgent(session.agent).name} 已完成「${session.title}」`, session.id);
  3005. else render();
  3006. } else {
  3007. render();
  3008. phones.forEach((phone) => {
  3009. const scroll = phone.querySelector('.chat-scroll');
  3010. if (scroll) scroll.scrollTop = scroll.scrollHeight;
  3011. });
  3012. }
  3013. }, 1200);
  3014. }
  3015. async function copy(text) {
  3016. try {
  3017. await navigator.clipboard.writeText(text);
  3018. toast('已复制');
  3019. } catch {
  3020. toast('浏览器未授权复制,可在实际项目中使用原有复制功能');
  3021. }
  3022. }
  3023. document.addEventListener('click', (event) => {
  3024. const view = event.target.closest('button[data-view]');
  3025. if (view) {
  3026. state.view = view.dataset.view;
  3027. document.body.dataset.view = state.view;
  3028. document
  3029. .querySelectorAll('button[data-view]')
  3030. .forEach((control) =>
  3031. control.classList.toggle('selected', control.dataset.view === state.view),
  3032. );
  3033. return;
  3034. }
  3035. const control = event.target.closest('[data-action]');
  3036. if (!control) return;
  3037. if (control.closest('.phone')) sourcePanel = control.closest('.phone').id;
  3038. const { action, id, value, route } = control.dataset;
  3039. if (action === 'dismiss') {
  3040. if (event.target === control) closeOverlay();
  3041. return;
  3042. }
  3043. switch (action) {
  3044. case 'route':
  3045. go(route);
  3046. break;
  3047. case 'messages':
  3048. go('messages');
  3049. break;
  3050. case 'contacts':
  3051. go('contacts');
  3052. break;
  3053. case 'back':
  3054. go(tabs.some((tab) => tab[0] === state.returnRoute) ? state.returnRoute : 'messages');
  3055. break;
  3056. case 'chat':
  3057. if (sessions.some((session) => session.id === id)) go(`chat/${id}`);
  3058. break;
  3059. case 'filter':
  3060. state.filter = value;
  3061. render(false);
  3062. break;
  3063. case 'contact-filter':
  3064. state.contactFilter = value;
  3065. render(false);
  3066. break;
  3067. case 'work-filter':
  3068. state.workFilter = value;
  3069. render(false);
  3070. break;
  3071. case 'group':
  3072. state.openGroups.has(id) ? state.openGroups.delete(id) : state.openGroups.add(id);
  3073. render();
  3074. break;
  3075. case 'workspace-open':
  3076. state.filter = 'workspace';
  3077. state.openGroups.add(id);
  3078. go('messages');
  3079. break;
  3080. case 'workspace-new':
  3081. showOverlay(action);
  3082. break;
  3083. case 'workspace-rename':
  3084. case 'workspace-delete':
  3085. showOverlay(
  3086. action,
  3087. workspaces.find((workspace) => workspace.id === id),
  3088. );
  3089. break;
  3090. case 'confirm-workspace-delete':
  3091. workspaces.splice(
  3092. workspaces.findIndex((workspace) => workspace.id === id),
  3093. 1,
  3094. );
  3095. sessions.forEach((session) => {
  3096. if (session.workspace === id) session.workspace = null;
  3097. });
  3098. closeOverlay();
  3099. toast('工作区已删除,会话已保留至日常会话');
  3100. break;
  3101. case 'close':
  3102. closeOverlay();
  3103. break;
  3104. case 'drawer':
  3105. case 'title':
  3106. case 'activity':
  3107. case 'new':
  3108. case 'files':
  3109. case 'chat-menu':
  3110. case 'notifications':
  3111. case 'archived':
  3112. case 'logout':
  3113. showOverlay(action);
  3114. break;
  3115. case 'agent':
  3116. go(`agent/${id}`);
  3117. break;
  3118. case 'enter-agent': {
  3119. if (getAgent(id).state === '离线') {
  3120. toast('该数字生命当前离线,请恢复在线后再进入');
  3121. break;
  3122. }
  3123. const session = sessions.find((item) => item.agent === id && !item.archived);
  3124. if (session) go(`chat/${session.id}`);
  3125. else createChat(id);
  3126. break;
  3127. }
  3128. case 'person':
  3129. openPeople.has(id) ? openPeople.delete(id) : openPeople.add(id);
  3130. render();
  3131. break;
  3132. case 'rename-agent':
  3133. case 'channel':
  3134. case 'recharge':
  3135. case 'preview':
  3136. showOverlay(action, id);
  3137. break;
  3138. case 'create-chat':
  3139. createChat(id);
  3140. break;
  3141. case 'quick-new':
  3142. createChat(current()?.agent || 'nova');
  3143. break;
  3144. case 'send':
  3145. send();
  3146. break;
  3147. case 'attach':
  3148. document.getElementById(sourcePanel).querySelector('[data-field="attachment"]').click();
  3149. break;
  3150. case 'remove-attachment':
  3151. delete state.attachments[current()?.id || 'home'];
  3152. render();
  3153. break;
  3154. case 'copy':
  3155. copy(
  3156. '季度复盘,已经整理好了。收入环比增长 18.6%,客户续费率达到 92%。下一步优化新客转化,持续跟进高价值客户。',
  3157. );
  3158. break;
  3159. case 'token':
  3160. state.tokenShown = !state.tokenShown;
  3161. render();
  3162. break;
  3163. case 'copy-token':
  3164. copy('DEMO-TOKEN-NOT-A-REAL-CREDENTIAL');
  3165. break;
  3166. case 'palette':
  3167. state.palette = id;
  3168. persist();
  3169. render();
  3170. break;
  3171. case 'dark':
  3172. state.dark = !state.dark;
  3173. persist();
  3174. render();
  3175. break;
  3176. case 'notify':
  3177. state.notify = !state.notify;
  3178. persist();
  3179. render();
  3180. break;
  3181. case 'confirm-logout':
  3182. showOverlay('logged-out');
  3183. break;
  3184. case 'archive':
  3185. if (current()) current().archived = true;
  3186. go('messages');
  3187. toast('会话已归档,可在侧栏恢复');
  3188. break;
  3189. case 'restore': {
  3190. const session = sessions.find((item) => item.id === id);
  3191. if (session) session.archived = false;
  3192. render();
  3193. break;
  3194. }
  3195. case 'demo-complete': {
  3196. const session =
  3197. sessions.find((item) => item.status === 'running' && !item.sending) ||
  3198. sessions.find((item) => !item.sending && item.id !== current()?.id) ||
  3199. sessions[0];
  3200. session.status = 'done';
  3201. session.preview = '任务已完成,可以查看结果';
  3202. session.unread += current()?.id === session.id ? 0 : 1;
  3203. closeOverlay();
  3204. if (state.notify) toast(`${getAgent(session.agent).name} 的任务已完成(演示)`, session.id);
  3205. else toast('提醒已关闭,状态已更新');
  3206. break;
  3207. }
  3208. case 'suggest-title': {
  3209. const title = current()?.title || '新对话';
  3210. phones.forEach((phone) => {
  3211. const candidates = phone.querySelector('.candidates');
  3212. if (candidates)
  3213. candidates.innerHTML = `<p class="sheet-description">本地预设建议,不会调用 AI。</p>${[`${title.replace(/报告$/, '')} · 关键结论`, `${getAgent(current()?.agent).name} 的工作记录`].map((candidate) => `<button type="button" class="candidate" data-action="use-title" data-value="${escape(candidate)}">${escape(candidate)}</button>`).join('')}`;
  3214. });
  3215. break;
  3216. }
  3217. case 'use-title':
  3218. phones.forEach((phone) => {
  3219. const field = phone.querySelector('[data-field="title"]');
  3220. if (field) field.value = value;
  3221. });
  3222. break;
  3223. }
  3224. });
  3225. document.addEventListener('input', (event) => {
  3226. const field = event.target;
  3227. const type = field.dataset.field;
  3228. if (type === 'search') {
  3229. state.query = field.value;
  3230. render(false);
  3231. }
  3232. if (type === 'draft') {
  3233. const key = current()?.id || 'home';
  3234. state.drafts[key] = field.value;
  3235. persist();
  3236. phones.forEach((phone) => {
  3237. const textarea = phone.querySelector('[data-field="draft"]');
  3238. if (textarea) {
  3239. if (textarea !== field) textarea.value = field.value;
  3240. resizeTextarea(textarea);
  3241. }
  3242. const sendButton = phone.querySelector('[data-action="send"]');
  3243. if (sendButton)
  3244. sendButton.disabled =
  3245. !!current()?.sending || (!field.value.trim() && !state.attachments[key]);
  3246. });
  3247. }
  3248. if (type === 'font') {
  3249. state.font = Number(field.value);
  3250. persist();
  3251. phones.forEach((phone) => {
  3252. phone.style.setProperty('--chat-size', `${state.font}px`);
  3253. const range = phone.querySelector('[data-field="font"]');
  3254. if (range) range.value = state.font;
  3255. const label = phone.querySelector('.font-slider label span');
  3256. if (label) label.textContent = `${state.font}px`;
  3257. });
  3258. }
  3259. });
  3260. document.addEventListener('change', (event) => {
  3261. if (event.target.dataset.field === 'attachment' && event.target.files[0]) {
  3262. state.attachments[current()?.id || 'home'] = event.target.files[0].name;
  3263. render();
  3264. toast('附件已加入演示草稿,文件内容未上传');
  3265. }
  3266. });
  3267. document.addEventListener('submit', (event) => {
  3268. const form = event.target.closest('[data-form]');
  3269. if (!form) return;
  3270. event.preventDefault();
  3271. const field = form.querySelector('.form-field');
  3272. const value = field.value.trim();
  3273. if (!value) {
  3274. form.querySelector('.form-error').textContent = '名称不能为空';
  3275. field.focus();
  3276. return;
  3277. }
  3278. if (form.dataset.form === 'title' && current()) current().title = value;
  3279. if (form.dataset.form === 'workspace') {
  3280. if (
  3281. workspaces.some(
  3282. (workspace) => workspace.name === value && workspace.id !== state.overlayData?.id,
  3283. )
  3284. ) {
  3285. form.querySelector('.form-error').textContent = '已有同名工作区,请换一个名称';
  3286. return;
  3287. }
  3288. if (state.overlayData) state.overlayData.name = value;
  3289. else {
  3290. const workspace = { id: `w${Date.now()}`, name: value };
  3291. workspaces.push(workspace);
  3292. state.openGroups.add(workspace.id);
  3293. state.filter = 'workspace';
  3294. state.route = 'messages';
  3295. history.replaceState(null, '', '#/messages');
  3296. }
  3297. }
  3298. if (form.dataset.form === 'agent') getAgent(state.overlayData).name = value;
  3299. closeOverlay();
  3300. toast('已保存(仅此原型)');
  3301. });
  3302. document.addEventListener('keydown', (event) => {
  3303. if (event.key === 'Escape' && state.overlay) {
  3304. event.preventDefault();
  3305. closeOverlay();
  3306. return;
  3307. }
  3308. const dialog = event.target.closest('[role="dialog"]');
  3309. if (event.key === 'Tab' && dialog) {
  3310. const focusable = [
  3311. ...dialog.querySelectorAll('button:not(:disabled),input:not(:disabled),textarea,a[href]'),
  3312. ].filter((element) => element.getClientRects().length);
  3313. const first = focusable[0];
  3314. const last = focusable.at(-1);
  3315. if (event.shiftKey && document.activeElement === first) {
  3316. event.preventDefault();
  3317. last?.focus();
  3318. } else if (!event.shiftKey && document.activeElement === last) {
  3319. event.preventDefault();
  3320. first?.focus();
  3321. }
  3322. }
  3323. if (
  3324. event.target.dataset.field === 'draft' &&
  3325. event.key === 'Enter' &&
  3326. !event.shiftKey &&
  3327. !event.isComposing &&
  3328. event.target.closest('.baseline')
  3329. ) {
  3330. event.preventDefault();
  3331. send();
  3332. }
  3333. });
  3334. const readHash = () => {
  3335. let route = '';
  3336. try {
  3337. route = decodeURIComponent(location.hash.replace(/^#\/?/, ''));
  3338. } catch {}
  3339. return /^(messages|contacts|workbench|mine|home|chat\/[\w-]+|agent\/[\w-]+)$/.test(route)
  3340. ? route
  3341. : 'messages';
  3342. };
  3343. window.addEventListener('hashchange', () => go(readHash()));
  3344. go(readHash());
  3345. })();
  3346. </script>
  3347. </body>
  3348. </html>