mobile-preview.html 123 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328
  1. <!doctype html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta
  6. name="viewport"
  7. content="width=device-width, initial-scale=1, viewport-fit=cover, interactive-widget=resizes-content"
  8. />
  9. <meta name="theme-color" content="#fafbf8" />
  10. <title>fmode · 移动端体验提案</title>
  11. <style>
  12. :root {
  13. color-scheme: light;
  14. --canvas: #fafbf8;
  15. --surface: #fff;
  16. --soft: #f0f2ed;
  17. --ink: #252d28;
  18. --muted: #899183;
  19. --secondary: #697363;
  20. --line: #e7ebe2;
  21. --accent: #386b52;
  22. --tint: #eaf1e8;
  23. --danger: #ae514a;
  24. --shade: #1a221c42;
  25. font-family:
  26. Inter,
  27. 'Noto Sans SC',
  28. 'PingFang SC',
  29. 'Microsoft YaHei',
  30. -apple-system,
  31. BlinkMacSystemFont,
  32. 'Segoe UI',
  33. sans-serif;
  34. -webkit-font-smoothing: antialiased;
  35. }
  36. * {
  37. box-sizing: border-box;
  38. }
  39. body {
  40. margin: 0;
  41. background: #eef0eb;
  42. color: var(--ink);
  43. }
  44. button,
  45. input,
  46. textarea,
  47. select {
  48. font: inherit;
  49. -webkit-tap-highlight-color: transparent;
  50. }
  51. button {
  52. color: inherit;
  53. cursor: pointer;
  54. border: 0;
  55. background: none;
  56. touch-action: manipulation;
  57. }
  58. button:disabled {
  59. cursor: default;
  60. opacity: 0.4;
  61. }
  62. button:focus-visible,
  63. a:focus-visible,
  64. input:focus-visible,
  65. summary:focus-visible,
  66. textarea:focus-visible {
  67. outline: 2px solid var(--accent);
  68. outline-offset: 3px;
  69. }
  70. a {
  71. color: inherit;
  72. text-decoration: none;
  73. }
  74. svg {
  75. width: 22px;
  76. height: 22px;
  77. stroke: currentColor;
  78. stroke-width: 1.65;
  79. fill: none;
  80. stroke-linecap: round;
  81. stroke-linejoin: round;
  82. flex-shrink: 0;
  83. }
  84. button svg {
  85. pointer-events: none;
  86. }
  87. h1,
  88. h2,
  89. h3,
  90. p {
  91. margin: 0;
  92. }
  93. [hidden] {
  94. display: none !important;
  95. }
  96. .presentation {
  97. max-width: 1400px;
  98. min-height: 100dvh;
  99. margin: auto;
  100. display: grid;
  101. grid-template-columns: minmax(270px, 1fr) 424px minmax(200px, 0.74fr);
  102. gap: 65px;
  103. align-items: center;
  104. padding: 35px 60px;
  105. }
  106. .intro {
  107. align-self: stretch;
  108. display: flex;
  109. flex-direction: column;
  110. padding: 16px 0 8px;
  111. }
  112. .studio-brand {
  113. display: flex;
  114. align-items: center;
  115. gap: 9px;
  116. font-size: 25px;
  117. letter-spacing: -1px;
  118. font-weight: 650;
  119. flex-wrap: wrap;
  120. }
  121. .studio-brand svg {
  122. width: 29px;
  123. height: 29px;
  124. color: var(--accent);
  125. }
  126. .edition {
  127. width: 100%;
  128. margin-top: 9px;
  129. font-size: 9px;
  130. color: #8c948a;
  131. letter-spacing: 2px;
  132. font-weight: 500;
  133. }
  134. .intro-copy {
  135. margin-top: clamp(44px, 9vh, 100px);
  136. }
  137. .eyebrow {
  138. font-size: 11px;
  139. letter-spacing: 1.4px;
  140. color: var(--muted);
  141. }
  142. .intro h1 {
  143. font-size: clamp(31px, 3vw, 43px);
  144. font-weight: 500;
  145. letter-spacing: -1.9px;
  146. line-height: 1.65;
  147. margin: 15px 0 16px;
  148. }
  149. .intro-copy p {
  150. font-size: 13px;
  151. line-height: 2;
  152. color: var(--secondary);
  153. }
  154. .proposal-tag {
  155. display: inline-flex;
  156. gap: 7px;
  157. align-items: center;
  158. border: 1px solid #d9dfd5;
  159. border-radius: 20px;
  160. padding: 7px 11px;
  161. font-size: 10px;
  162. color: var(--secondary);
  163. margin-top: 23px;
  164. }
  165. .dot {
  166. width: 6px;
  167. height: 6px;
  168. background: #64866b;
  169. border-radius: 100%;
  170. display: inline-block;
  171. flex-shrink: 0;
  172. }
  173. .dot.offline {
  174. background: #b1b6a9;
  175. }
  176. .scene-switch {
  177. margin-top: 42px;
  178. max-width: 285px;
  179. }
  180. .scene-switch > .eyebrow {
  181. display: block;
  182. margin-bottom: 12px;
  183. }
  184. .scene-switch button {
  185. display: flex;
  186. align-items: center;
  187. gap: 15px;
  188. border-bottom: 1px solid #dde2d8;
  189. width: 100%;
  190. padding: 15px 0;
  191. font-size: 12px;
  192. text-align: left;
  193. }
  194. .scene-switch button > span:first-child {
  195. font-size: 10px;
  196. color: #9ba397;
  197. font-family: monospace;
  198. }
  199. .scene-switch button > span:last-child {
  200. margin-left: auto;
  201. }
  202. .scene-switch svg {
  203. width: 15px;
  204. height: 15px;
  205. }
  206. .scene-switch button:hover,
  207. .scene-switch button.active {
  208. color: var(--accent);
  209. }
  210. .intro-footer {
  211. margin-top: auto;
  212. padding-top: 40px;
  213. font-size: 9px;
  214. letter-spacing: 1.4px;
  215. line-height: 2;
  216. color: #677160;
  217. }
  218. .intro-footer span {
  219. font-size: 10px;
  220. letter-spacing: 0.3px;
  221. color: #92998d;
  222. }
  223. .device-wrap {
  224. width: 424px;
  225. }
  226. .device {
  227. height: min(858px, calc(100dvh - 90px));
  228. min-height: 660px;
  229. width: 424px;
  230. padding: 7px;
  231. border-radius: 46px;
  232. background: var(--canvas);
  233. border: 1px solid #cdd2c8;
  234. box-shadow:
  235. 0 30px 70px -30px #3f4b3c33,
  236. 0 0 0 5px #e5e8df,
  237. 0 0 0 6px #d9ded2;
  238. position: relative;
  239. overflow: hidden;
  240. isolation: isolate;
  241. }
  242. .statusbar {
  243. height: 40px;
  244. padding: 6px 23px;
  245. display: flex;
  246. align-items: center;
  247. justify-content: space-between;
  248. font-size: 13px;
  249. font-weight: 650;
  250. }
  251. .island {
  252. position: absolute;
  253. top: 15px;
  254. left: 50%;
  255. transform: translateX(-50%);
  256. width: 99px;
  257. height: 25px;
  258. border-radius: 25px;
  259. background: #242824;
  260. }
  261. .status-icons {
  262. display: flex;
  263. gap: 4px;
  264. align-items: center;
  265. }
  266. .status-icons svg {
  267. width: 15px;
  268. height: 15px;
  269. stroke-width: 1.9;
  270. }
  271. .status-icons > span:last-child svg {
  272. width: 22px;
  273. }
  274. .home-indicator {
  275. position: absolute;
  276. bottom: 8px;
  277. left: 50%;
  278. transform: translateX(-50%);
  279. height: 4px;
  280. width: 118px;
  281. background: var(--ink);
  282. border-radius: 8px;
  283. pointer-events: none;
  284. z-index: 30;
  285. }
  286. .device-caption {
  287. display: flex;
  288. align-items: center;
  289. justify-content: center;
  290. gap: 8px;
  291. margin-top: 18px;
  292. font-size: 10px;
  293. color: #8b9386;
  294. letter-spacing: 0.5px;
  295. }
  296. .device-caption .dot {
  297. width: 5px;
  298. height: 5px;
  299. }
  300. .design-notes {
  301. max-width: 235px;
  302. }
  303. .design-notes > .eyebrow {
  304. font-size: 10px;
  305. letter-spacing: 1px;
  306. }
  307. .note {
  308. margin-top: 37px;
  309. padding-top: 16px;
  310. border-top: 1px solid #d9dfd3;
  311. }
  312. .note > span {
  313. font-size: 9px;
  314. letter-spacing: 1.5px;
  315. color: #8b9682;
  316. }
  317. .note h2 {
  318. font-size: 14px;
  319. font-weight: 550;
  320. margin: 12px 0 10px;
  321. letter-spacing: -0.3px;
  322. }
  323. .note p {
  324. font-size: 11px;
  325. line-height: 2.1;
  326. color: #86907d;
  327. }
  328. .scope-note {
  329. display: flex;
  330. gap: 8px;
  331. margin-top: 39px;
  332. font-size: 9px;
  333. color: #91998a;
  334. line-height: 2;
  335. }
  336. .scope-note svg {
  337. width: 16px;
  338. height: 16px;
  339. margin-top: 2px;
  340. }
  341. .app {
  342. height: calc(100% - 40px);
  343. display: flex;
  344. flex-direction: column;
  345. overflow: hidden;
  346. border-radius: 0 0 35px 35px;
  347. font-size: 14px;
  348. }
  349. .app-header {
  350. height: 64px;
  351. min-height: 64px;
  352. display: flex;
  353. align-items: center;
  354. justify-content: space-between;
  355. gap: 10px;
  356. padding: 4px 17px;
  357. z-index: 2;
  358. background: var(--canvas);
  359. }
  360. .icon-button {
  361. min-width: 44px;
  362. width: 44px;
  363. height: 44px;
  364. display: inline-flex;
  365. align-items: center;
  366. justify-content: center;
  367. border-radius: 50%;
  368. flex-shrink: 0;
  369. }
  370. .icon-button:hover {
  371. background: var(--soft);
  372. }
  373. .header-center {
  374. text-align: center;
  375. min-width: 0;
  376. }
  377. .header-center strong {
  378. font-size: 15px;
  379. font-weight: 600;
  380. letter-spacing: -0.4px;
  381. }
  382. .header-center small {
  383. display: flex;
  384. justify-content: center;
  385. align-items: center;
  386. gap: 5px;
  387. color: var(--muted);
  388. font-size: 10px;
  389. margin-top: 5px;
  390. }
  391. .header-center .dot {
  392. width: 5px;
  393. height: 5px;
  394. }
  395. .header-brand {
  396. display: flex;
  397. align-items: center;
  398. gap: 6px;
  399. }
  400. .header-brand svg {
  401. width: 20px;
  402. height: 20px;
  403. color: var(--accent);
  404. }
  405. .header-brand strong {
  406. font-size: 21px;
  407. font-weight: 600;
  408. letter-spacing: -0.9px;
  409. }
  410. .profile-button {
  411. width: 34px;
  412. height: 34px;
  413. margin: 5px;
  414. border-radius: 50%;
  415. background: #e8ebdf;
  416. color: #657151;
  417. font-size: 12px;
  418. }
  419. .page-title {
  420. flex: 1;
  421. font-size: 20px;
  422. letter-spacing: -0.5px;
  423. font-weight: 600;
  424. }
  425. #main {
  426. flex: 1;
  427. min-height: 0;
  428. overflow-y: auto;
  429. overflow-x: hidden;
  430. overscroll-behavior: contain;
  431. scrollbar-width: none;
  432. outline: none;
  433. }
  434. #main::-webkit-scrollbar {
  435. display: none;
  436. }
  437. .screen {
  438. padding: 6px 23px 24px;
  439. animation: arrive 0.24s ease-out;
  440. }
  441. .home-screen {
  442. min-height: 100%;
  443. display: flex;
  444. flex-direction: column;
  445. padding-top: 31px;
  446. }
  447. .home-hero {
  448. padding: 4px 1px 10px;
  449. }
  450. .hero-art {
  451. display: grid;
  452. place-items: center;
  453. width: 65px;
  454. height: 65px;
  455. border-radius: 22px;
  456. background: #eaf0e4;
  457. color: var(--accent);
  458. margin-bottom: 25px;
  459. transform: rotate(-6deg);
  460. }
  461. .hero-art svg {
  462. width: 42px;
  463. height: 42px;
  464. transform: rotate(6deg);
  465. }
  466. .home-hero .overline {
  467. font-size: 11px;
  468. color: var(--muted);
  469. margin-bottom: 11px;
  470. letter-spacing: 1px;
  471. }
  472. .home-hero h1 {
  473. font-size: 31px;
  474. letter-spacing: -1.4px;
  475. line-height: 1.6;
  476. font-weight: 500;
  477. }
  478. .home-hero p {
  479. color: var(--muted);
  480. font-size: 12px;
  481. margin-top: 12px;
  482. line-height: 1.9;
  483. }
  484. .prompts {
  485. display: flex;
  486. gap: 8px;
  487. overflow-x: auto;
  488. scrollbar-width: none;
  489. padding: 19px 0 6px;
  490. flex-shrink: 0;
  491. }
  492. .prompt {
  493. white-space: nowrap;
  494. font-size: 11px;
  495. color: var(--secondary);
  496. border: 1px solid var(--line);
  497. padding: 10px 13px;
  498. border-radius: 12px;
  499. display: flex;
  500. align-items: center;
  501. gap: 6px;
  502. background: var(--surface);
  503. }
  504. .prompt svg {
  505. width: 14px;
  506. height: 14px;
  507. }
  508. .recent-block {
  509. margin-top: auto;
  510. padding-top: 25px;
  511. }
  512. .section-label {
  513. display: flex;
  514. align-items: center;
  515. justify-content: space-between;
  516. color: var(--muted);
  517. font-size: 10px;
  518. letter-spacing: 0.6px;
  519. margin: 0 0 10px;
  520. }
  521. .text-button {
  522. min-height: 36px;
  523. font-size: 11px;
  524. display: inline-flex;
  525. align-items: center;
  526. gap: 4px;
  527. color: var(--secondary);
  528. }
  529. .text-button svg {
  530. width: 13px;
  531. height: 13px;
  532. }
  533. .recent-row {
  534. width: 100%;
  535. display: flex;
  536. align-items: center;
  537. gap: 11px;
  538. padding: 12px 0;
  539. border-top: 1px solid var(--line);
  540. text-align: left;
  541. }
  542. .recent-row > svg {
  543. color: var(--muted);
  544. width: 16px;
  545. height: 16px;
  546. }
  547. .row-text {
  548. flex: 1;
  549. min-width: 0;
  550. }
  551. .recent-row strong {
  552. font-size: 12px;
  553. font-weight: 500;
  554. white-space: nowrap;
  555. text-overflow: ellipsis;
  556. overflow: hidden;
  557. display: block;
  558. }
  559. .recent-row small {
  560. font-size: 10px;
  561. color: var(--muted);
  562. margin-top: 5px;
  563. display: block;
  564. }
  565. .recent-row time {
  566. font-size: 10px;
  567. color: var(--muted);
  568. }
  569. #composer-area {
  570. flex-shrink: 0;
  571. padding: 6px 15px 18px;
  572. background: var(--canvas);
  573. }
  574. #composer-area:empty {
  575. display: none;
  576. }
  577. .composer {
  578. border: 1px solid #dfe4d9;
  579. background: var(--surface);
  580. border-radius: 24px;
  581. padding: 12px 12px 9px;
  582. box-shadow: 0 3px 14px #26352005;
  583. transition: border-color 0.2s;
  584. }
  585. .composer:focus-within {
  586. border-color: #9bae98;
  587. }
  588. .composer textarea {
  589. width: 100%;
  590. min-height: 46px;
  591. max-height: 116px;
  592. resize: none;
  593. display: block;
  594. border: 0;
  595. background: none;
  596. outline: none !important;
  597. color: var(--ink);
  598. font-size: 16px;
  599. line-height: 1.6;
  600. padding: 3px 4px;
  601. }
  602. .composer textarea::placeholder {
  603. color: var(--muted);
  604. font-size: 14px;
  605. }
  606. .composer-tools {
  607. display: flex;
  608. align-items: center;
  609. gap: 5px;
  610. }
  611. .composer-tools .icon-button {
  612. width: 40px;
  613. min-width: 40px;
  614. height: 40px;
  615. color: var(--secondary);
  616. }
  617. .agent-select {
  618. display: flex;
  619. gap: 6px;
  620. align-items: center;
  621. font-size: 10px;
  622. padding: 0 5px;
  623. height: 40px;
  624. color: var(--secondary);
  625. max-width: 205px;
  626. white-space: nowrap;
  627. overflow: hidden;
  628. }
  629. .agent-select svg {
  630. width: 13px;
  631. height: 13px;
  632. }
  633. .agent-select .dot {
  634. width: 5px;
  635. height: 5px;
  636. }
  637. .send-button {
  638. width: 37px;
  639. height: 37px;
  640. min-height: 37px;
  641. border-radius: 50%;
  642. display: grid;
  643. place-items: center;
  644. background: var(--accent);
  645. color: white;
  646. margin-left: auto;
  647. }
  648. .send-button:disabled {
  649. background: var(--soft);
  650. color: #a0a89a;
  651. opacity: 1;
  652. }
  653. .send-button svg {
  654. width: 20px;
  655. height: 20px;
  656. }
  657. .composer-footnote {
  658. text-align: center;
  659. color: var(--muted);
  660. font-size: 9px;
  661. margin-top: 10px;
  662. }
  663. .attachment-list {
  664. display: flex;
  665. gap: 6px;
  666. flex-wrap: wrap;
  667. }
  668. .attachment-chip {
  669. font-size: 10px;
  670. border-radius: 8px;
  671. background: var(--soft);
  672. padding: 6px 8px;
  673. display: flex;
  674. align-items: center;
  675. gap: 4px;
  676. margin-bottom: 6px;
  677. max-width: 100%;
  678. }
  679. .attachment-chip > span {
  680. max-width: 230px;
  681. overflow: hidden;
  682. text-overflow: ellipsis;
  683. white-space: nowrap;
  684. }
  685. .attachment-chip button {
  686. min-width: 32px;
  687. min-height: 32px;
  688. display: grid;
  689. place-items: center;
  690. margin: -5px;
  691. }
  692. .attachment-chip svg {
  693. width: 12px;
  694. height: 12px;
  695. }
  696. .tabbar {
  697. display: flex;
  698. padding: 8px 9px 22px;
  699. gap: 3px;
  700. border-top: 1px solid var(--line);
  701. background: var(--canvas);
  702. flex-shrink: 0;
  703. }
  704. .tabbar:empty {
  705. display: none;
  706. }
  707. .tabbar button {
  708. flex: 1;
  709. min-height: 48px;
  710. display: flex;
  711. align-items: center;
  712. justify-content: center;
  713. flex-direction: column;
  714. gap: 5px;
  715. color: var(--muted);
  716. font-size: 9px;
  717. }
  718. .tabbar button svg {
  719. width: 21px;
  720. height: 21px;
  721. }
  722. .tabbar button.active {
  723. color: var(--accent);
  724. font-weight: 600;
  725. }
  726. .tabbar button.active > span:first-child {
  727. background: var(--tint);
  728. border-radius: 12px;
  729. padding: 2px 12px;
  730. margin: -2px -12px;
  731. }
  732. .tabbar button > span:first-child {
  733. height: 25px;
  734. display: flex;
  735. align-items: center;
  736. }
  737. .page-subtitle {
  738. font-size: 11px;
  739. color: var(--muted);
  740. line-height: 1.8;
  741. margin-bottom: 19px;
  742. }
  743. .search-field {
  744. display: flex;
  745. gap: 8px;
  746. align-items: center;
  747. border-radius: 13px;
  748. background: var(--soft);
  749. padding: 0 12px;
  750. margin-bottom: 16px;
  751. min-height: 44px;
  752. }
  753. .search-field svg {
  754. width: 16px;
  755. height: 16px;
  756. color: var(--muted);
  757. }
  758. .search-field input {
  759. width: 100%;
  760. border: 0;
  761. outline: none;
  762. background: none;
  763. font-size: 13px;
  764. color: var(--ink);
  765. min-height: 44px;
  766. }
  767. .search-field input::placeholder {
  768. color: var(--muted);
  769. }
  770. .segmented {
  771. display: flex;
  772. gap: 5px;
  773. border-bottom: 1px solid var(--line);
  774. margin-bottom: 19px;
  775. }
  776. .segmented button {
  777. position: relative;
  778. min-height: 42px;
  779. flex: 1;
  780. font-size: 12px;
  781. color: var(--muted);
  782. white-space: nowrap;
  783. }
  784. .segmented button.active {
  785. color: var(--ink);
  786. font-weight: 600;
  787. }
  788. .segmented button.active:after {
  789. position: absolute;
  790. content: '';
  791. width: 18px;
  792. height: 2px;
  793. background: var(--accent);
  794. bottom: -1px;
  795. left: calc(50% - 9px);
  796. border-radius: 2px;
  797. }
  798. .group-heading {
  799. color: var(--muted);
  800. font-size: 10px;
  801. margin: 24px 0 5px;
  802. display: flex;
  803. justify-content: space-between;
  804. align-items: center;
  805. }
  806. .conversation-row {
  807. display: flex;
  808. align-items: center;
  809. gap: 7px;
  810. padding: 17px 0;
  811. border-bottom: 1px solid var(--line);
  812. }
  813. .avatar {
  814. width: 39px;
  815. height: 39px;
  816. flex-shrink: 0;
  817. border-radius: 14px;
  818. display: grid;
  819. place-items: center;
  820. background: var(--tint);
  821. color: var(--accent);
  822. font-size: 13px;
  823. }
  824. .avatar svg {
  825. width: 22px;
  826. height: 22px;
  827. }
  828. .avatar.clay {
  829. background: #f1eae4;
  830. color: #95745e;
  831. }
  832. .avatar.lilac {
  833. background: #eeebf5;
  834. color: #8b7eaa;
  835. }
  836. .avatar.person {
  837. border-radius: 50%;
  838. }
  839. .conversation-open {
  840. display: flex;
  841. gap: 11px;
  842. text-align: left;
  843. flex: 1;
  844. min-width: 0;
  845. padding: 0;
  846. }
  847. .conversation-body {
  848. flex: 1;
  849. min-width: 0;
  850. }
  851. .conversation-top {
  852. display: flex;
  853. align-items: center;
  854. gap: 5px;
  855. }
  856. .conversation-top strong {
  857. font-size: 13px;
  858. font-weight: 550;
  859. overflow: hidden;
  860. white-space: nowrap;
  861. text-overflow: ellipsis;
  862. flex: 1;
  863. }
  864. .conversation-top time {
  865. font-size: 9px;
  866. color: var(--muted);
  867. flex-shrink: 0;
  868. }
  869. .conversation-body p {
  870. font-size: 11px;
  871. color: var(--muted);
  872. line-height: 1.6;
  873. overflow: hidden;
  874. white-space: nowrap;
  875. text-overflow: ellipsis;
  876. margin: 6px 0;
  877. }
  878. .conversation-meta {
  879. display: flex;
  880. align-items: center;
  881. gap: 5px;
  882. font-size: 9px;
  883. color: var(--secondary);
  884. }
  885. .conversation-meta .dot {
  886. width: 4px;
  887. height: 4px;
  888. }
  889. .unread {
  890. border-radius: 6px;
  891. background: var(--accent);
  892. color: #fff;
  893. min-width: 16px;
  894. padding: 2px 4px;
  895. font-size: 9px;
  896. text-align: center;
  897. }
  898. .row-more {
  899. width: 30px;
  900. min-height: 44px;
  901. padding: 0;
  902. display: grid;
  903. place-items: center;
  904. color: var(--muted);
  905. align-self: flex-start;
  906. margin-top: -7px;
  907. }
  908. .row-more svg {
  909. width: 17px;
  910. }
  911. .workspace {
  912. border-bottom: 1px solid var(--line);
  913. }
  914. .workspace-head {
  915. display: flex;
  916. align-items: center;
  917. gap: 8px;
  918. padding: 12px 0;
  919. }
  920. .workspace-toggle {
  921. min-height: 40px;
  922. flex: 1;
  923. display: flex;
  924. align-items: center;
  925. gap: 9px;
  926. text-align: left;
  927. font-size: 13px;
  928. }
  929. .workspace-toggle svg {
  930. width: 17px;
  931. color: var(--secondary);
  932. }
  933. .workspace-toggle small {
  934. color: var(--muted);
  935. font-size: 10px;
  936. margin-left: auto;
  937. }
  938. .workspace > div {
  939. padding-left: 12px;
  940. }
  941. .workspace .icon-button {
  942. min-width: 35px;
  943. width: 35px;
  944. height: 40px;
  945. color: var(--muted);
  946. }
  947. .workspace .icon-button svg {
  948. width: 17px;
  949. }
  950. .empty-state {
  951. padding: 55px 15px;
  952. text-align: center;
  953. color: var(--muted);
  954. }
  955. .empty-state > svg {
  956. width: 32px;
  957. height: 32px;
  958. margin-bottom: 15px;
  959. }
  960. .empty-state strong {
  961. display: block;
  962. font-size: 14px;
  963. color: var(--ink);
  964. font-weight: 500;
  965. }
  966. .empty-state p {
  967. font-size: 12px;
  968. line-height: 1.8;
  969. margin-top: 9px;
  970. }
  971. .empty-state button {
  972. margin-top: 16px;
  973. }
  974. .primary-button {
  975. display: flex;
  976. align-items: center;
  977. justify-content: center;
  978. gap: 7px;
  979. width: 100%;
  980. min-height: 47px;
  981. border-radius: 14px;
  982. background: var(--accent);
  983. color: #fff;
  984. font-size: 13px;
  985. }
  986. .secondary-button {
  987. min-height: 44px;
  988. border: 1px solid var(--line);
  989. background: var(--surface);
  990. border-radius: 12px;
  991. font-size: 12px;
  992. padding: 0 16px;
  993. }
  994. .primary-button svg {
  995. width: 17px;
  996. }
  997. .button-row {
  998. display: flex;
  999. gap: 9px;
  1000. margin-top: 20px;
  1001. }
  1002. .button-row > * {
  1003. flex: 1;
  1004. }
  1005. .danger {
  1006. color: var(--danger) !important;
  1007. }
  1008. .chat-screen {
  1009. padding: 12px 23px 15px;
  1010. font-size: var(--chat-font, 15px);
  1011. line-height: 1.9;
  1012. }
  1013. .chat-date {
  1014. text-align: center;
  1015. color: var(--muted);
  1016. font-size: 9px;
  1017. margin: 2px 0 25px;
  1018. letter-spacing: 1px;
  1019. }
  1020. .user-message {
  1021. display: flex;
  1022. justify-content: flex-end;
  1023. margin: 20px 0 28px;
  1024. }
  1025. .user-bubble {
  1026. background: #edf0e7;
  1027. max-width: 88%;
  1028. padding: 12px 16px;
  1029. border-radius: 19px 19px 5px 19px;
  1030. line-height: 1.85;
  1031. font-size: 13px;
  1032. overflow-wrap: anywhere;
  1033. }
  1034. .user-file {
  1035. display: block;
  1036. font-size: 10px;
  1037. color: var(--secondary);
  1038. padding-top: 5px;
  1039. }
  1040. .assistant-heading {
  1041. display: flex;
  1042. gap: 8px;
  1043. align-items: center;
  1044. margin-bottom: 16px;
  1045. font-size: 11px;
  1046. color: var(--secondary);
  1047. }
  1048. .assistant-heading > svg {
  1049. width: 21px;
  1050. height: 21px;
  1051. color: var(--accent);
  1052. }
  1053. .assistant-heading time {
  1054. margin-left: auto;
  1055. font-size: 9px;
  1056. color: var(--muted);
  1057. }
  1058. .process {
  1059. margin-bottom: 18px;
  1060. border: 1px solid var(--line);
  1061. border-radius: 13px;
  1062. padding: 0 12px;
  1063. background: var(--surface);
  1064. }
  1065. .process summary {
  1066. cursor: pointer;
  1067. list-style: none;
  1068. display: flex;
  1069. gap: 7px;
  1070. align-items: center;
  1071. min-height: 42px;
  1072. font-size: 10px;
  1073. color: var(--secondary);
  1074. }
  1075. .process summary::-webkit-details-marker {
  1076. display: none;
  1077. }
  1078. .process summary svg {
  1079. width: 14px;
  1080. height: 14px;
  1081. color: var(--accent);
  1082. }
  1083. .process summary .chevron {
  1084. margin-left: auto;
  1085. transition: transform 0.2s;
  1086. }
  1087. .process[open] summary .chevron {
  1088. transform: rotate(180deg);
  1089. }
  1090. .process ol {
  1091. padding: 0 0 10px 21px;
  1092. margin: 0;
  1093. color: var(--muted);
  1094. font-size: 10px;
  1095. line-height: 2.4;
  1096. }
  1097. .assistant-body {
  1098. overflow-wrap: anywhere;
  1099. }
  1100. .assistant-body h2 {
  1101. font-size: 18px;
  1102. font-weight: 600;
  1103. letter-spacing: -0.5px;
  1104. line-height: 1.6;
  1105. margin: 21px 0 12px;
  1106. }
  1107. .assistant-body p {
  1108. margin: 0 0 14px;
  1109. }
  1110. .assistant-body ul {
  1111. padding-left: 19px;
  1112. margin: 0 0 17px;
  1113. }
  1114. .assistant-body li {
  1115. margin-bottom: 8px;
  1116. }
  1117. .assistant-body strong {
  1118. font-weight: 600;
  1119. }
  1120. .assistant-body blockquote {
  1121. margin: 18px 0;
  1122. padding: 3px 0 3px 13px;
  1123. border-left: 2px solid #9bb192;
  1124. color: var(--secondary);
  1125. font-size: 13px;
  1126. }
  1127. .file-card {
  1128. display: flex;
  1129. align-items: center;
  1130. gap: 11px;
  1131. width: 100%;
  1132. text-align: left;
  1133. padding: 14px;
  1134. border: 1px solid var(--line);
  1135. border-radius: 15px;
  1136. margin: 18px 0;
  1137. background: var(--surface);
  1138. }
  1139. .file-badge {
  1140. height: 39px;
  1141. width: 33px;
  1142. border: 1px solid #dce5d7;
  1143. border-radius: 6px;
  1144. background: var(--tint);
  1145. color: var(--accent);
  1146. font-size: 9px;
  1147. display: grid;
  1148. place-items: center;
  1149. font-weight: 600;
  1150. flex-shrink: 0;
  1151. }
  1152. .file-card strong {
  1153. display: block;
  1154. font-size: 12px;
  1155. font-weight: 500;
  1156. }
  1157. .file-card small {
  1158. font-size: 9px;
  1159. color: var(--muted);
  1160. display: block;
  1161. margin-top: 5px;
  1162. }
  1163. .file-card > svg {
  1164. width: 17px;
  1165. color: var(--muted);
  1166. margin-left: auto;
  1167. }
  1168. .message-actions {
  1169. display: flex;
  1170. gap: 7px;
  1171. align-items: center;
  1172. margin: 13px 0 24px;
  1173. color: var(--muted);
  1174. }
  1175. .message-actions button {
  1176. width: 37px;
  1177. height: 37px;
  1178. display: grid;
  1179. place-items: center;
  1180. }
  1181. .message-actions svg {
  1182. width: 16px;
  1183. height: 16px;
  1184. }
  1185. .message-actions small {
  1186. font-size: 9px;
  1187. margin-left: auto;
  1188. }
  1189. .typing {
  1190. display: flex;
  1191. align-items: center;
  1192. gap: 4px;
  1193. color: var(--muted);
  1194. font-size: 11px;
  1195. padding: 10px 0;
  1196. }
  1197. .typing i {
  1198. width: 4px;
  1199. height: 4px;
  1200. background: var(--accent);
  1201. border-radius: 50%;
  1202. animation: pulse 1s infinite;
  1203. }
  1204. .typing i:nth-child(2) {
  1205. animation-delay: 0.15s;
  1206. }
  1207. .typing i:nth-child(3) {
  1208. animation-delay: 0.3s;
  1209. }
  1210. .connection-banner {
  1211. display: flex;
  1212. gap: 7px;
  1213. align-items: center;
  1214. background: #f4ede1;
  1215. color: #906f3e;
  1216. border-radius: 10px;
  1217. padding: 10px;
  1218. font-size: 11px;
  1219. margin-bottom: 12px;
  1220. width: 100%;
  1221. }
  1222. .connection-banner svg {
  1223. width: 16px;
  1224. }
  1225. .overview {
  1226. display: grid;
  1227. grid-template-columns: repeat(3, 1fr);
  1228. background: var(--tint);
  1229. border-radius: 18px;
  1230. padding: 19px 13px;
  1231. margin: 3px 0 23px;
  1232. }
  1233. .overview > div {
  1234. padding-left: 10px;
  1235. border-right: 1px solid #d8e2d3;
  1236. }
  1237. .overview > div:last-child {
  1238. border: 0;
  1239. }
  1240. .overview strong {
  1241. display: block;
  1242. font-size: 23px;
  1243. letter-spacing: -1px;
  1244. font-weight: 500;
  1245. margin-bottom: 5px;
  1246. }
  1247. .overview small {
  1248. font-size: 10px;
  1249. color: var(--secondary);
  1250. }
  1251. .agent-card {
  1252. padding: 18px;
  1253. border: 1px solid var(--line);
  1254. border-radius: 18px;
  1255. background: var(--surface);
  1256. margin: 13px 0;
  1257. }
  1258. .agent-card-head {
  1259. display: flex;
  1260. align-items: center;
  1261. gap: 10px;
  1262. }
  1263. .agent-card-head h2 {
  1264. font-size: 14px;
  1265. font-weight: 550;
  1266. }
  1267. .agent-card-head small {
  1268. display: flex;
  1269. align-items: center;
  1270. gap: 5px;
  1271. margin-top: 6px;
  1272. font-size: 10px;
  1273. color: var(--muted);
  1274. }
  1275. .agent-card-head > .tag {
  1276. margin-left: auto;
  1277. }
  1278. .tag {
  1279. display: inline-flex;
  1280. align-items: center;
  1281. gap: 5px;
  1282. border-radius: 6px;
  1283. background: var(--tint);
  1284. color: var(--accent);
  1285. font-size: 9px;
  1286. padding: 5px 7px;
  1287. }
  1288. .tag.offline {
  1289. background: var(--soft);
  1290. color: var(--muted);
  1291. }
  1292. .agent-current {
  1293. font-size: 11px;
  1294. color: var(--secondary);
  1295. line-height: 1.8;
  1296. margin: 16px 0;
  1297. padding: 11px;
  1298. border-radius: 10px;
  1299. background: var(--canvas);
  1300. }
  1301. .agent-metrics {
  1302. display: flex;
  1303. gap: 20px;
  1304. font-size: 9px;
  1305. color: var(--muted);
  1306. margin-bottom: 15px;
  1307. }
  1308. .agent-metrics b {
  1309. font-weight: 500;
  1310. color: var(--secondary);
  1311. margin-left: 3px;
  1312. }
  1313. .agent-actions {
  1314. display: flex;
  1315. border-top: 1px solid var(--line);
  1316. padding-top: 9px;
  1317. gap: 7px;
  1318. }
  1319. .agent-actions button {
  1320. font-size: 10px;
  1321. min-height: 38px;
  1322. flex: 1;
  1323. display: flex;
  1324. align-items: center;
  1325. justify-content: center;
  1326. gap: 5px;
  1327. color: var(--secondary);
  1328. }
  1329. .agent-actions button:last-child {
  1330. color: var(--accent);
  1331. background: var(--tint);
  1332. border-radius: 9px;
  1333. }
  1334. .agent-actions svg {
  1335. width: 14px;
  1336. height: 14px;
  1337. }
  1338. .contact-row {
  1339. display: flex;
  1340. align-items: center;
  1341. gap: 11px;
  1342. padding: 17px 0;
  1343. border-bottom: 1px solid var(--line);
  1344. }
  1345. .contact-row > button {
  1346. padding: 0;
  1347. flex: 1;
  1348. text-align: left;
  1349. display: flex;
  1350. gap: 11px;
  1351. align-items: center;
  1352. min-height: 44px;
  1353. }
  1354. .contact-row strong {
  1355. font-size: 13px;
  1356. font-weight: 500;
  1357. }
  1358. .contact-row small {
  1359. display: block;
  1360. font-size: 10px;
  1361. color: var(--muted);
  1362. margin-top: 6px;
  1363. }
  1364. .contact-row > svg {
  1365. width: 16px;
  1366. color: var(--muted);
  1367. }
  1368. .contact-department {
  1369. font-size: 10px;
  1370. color: var(--muted);
  1371. margin: 22px 0 2px;
  1372. }
  1373. .profile-card {
  1374. padding: 18px 0 25px;
  1375. display: flex;
  1376. gap: 13px;
  1377. align-items: center;
  1378. }
  1379. .profile-card .avatar {
  1380. width: 55px;
  1381. height: 55px;
  1382. font-size: 21px;
  1383. background: #e9ecdf;
  1384. color: #6c7856;
  1385. border-radius: 19px;
  1386. }
  1387. .profile-card h2 {
  1388. font-size: 19px;
  1389. font-weight: 500;
  1390. }
  1391. .profile-card p {
  1392. font-size: 10px;
  1393. color: var(--muted);
  1394. margin-top: 8px;
  1395. }
  1396. .settings-group {
  1397. margin: 10px 0 26px;
  1398. }
  1399. .settings-group h2 {
  1400. font-size: 10px;
  1401. color: var(--muted);
  1402. font-weight: 500;
  1403. margin-bottom: 11px;
  1404. }
  1405. .settings-row {
  1406. display: flex;
  1407. align-items: center;
  1408. gap: 10px;
  1409. min-height: 58px;
  1410. border-bottom: 1px solid var(--line);
  1411. width: 100%;
  1412. font-size: 12px;
  1413. text-align: left;
  1414. }
  1415. .settings-row > svg {
  1416. width: 18px;
  1417. color: var(--secondary);
  1418. }
  1419. .settings-row small {
  1420. margin-left: auto;
  1421. font-size: 10px;
  1422. color: var(--muted);
  1423. }
  1424. .settings-row > svg:last-child {
  1425. width: 14px;
  1426. margin-left: auto;
  1427. color: var(--muted);
  1428. }
  1429. .settings-row small + svg {
  1430. margin-left: 0 !important;
  1431. }
  1432. .toggle {
  1433. margin-left: auto;
  1434. width: 37px;
  1435. height: 23px;
  1436. border-radius: 20px;
  1437. background: #d9dfd2;
  1438. padding: 3px;
  1439. }
  1440. .toggle:before {
  1441. content: '';
  1442. display: block;
  1443. width: 17px;
  1444. height: 17px;
  1445. border-radius: 50%;
  1446. background: #fff;
  1447. box-shadow: 0 1px 3px #0001;
  1448. transition: transform 0.2s;
  1449. }
  1450. .toggle.on {
  1451. background: var(--accent);
  1452. }
  1453. .toggle.on:before {
  1454. transform: translateX(14px);
  1455. }
  1456. .palette-row {
  1457. display: flex;
  1458. gap: 10px;
  1459. padding: 10px 0;
  1460. }
  1461. .palette-option {
  1462. width: 44px;
  1463. height: 44px;
  1464. border-radius: 50%;
  1465. border: 1px solid var(--line);
  1466. display: grid;
  1467. place-items: center;
  1468. }
  1469. .palette-option > span {
  1470. width: 27px;
  1471. height: 27px;
  1472. border-radius: 50%;
  1473. background: var(--swatch);
  1474. }
  1475. .palette-option.active {
  1476. border-color: var(--accent);
  1477. box-shadow: 0 0 0 2px var(--tint);
  1478. }
  1479. .version-text {
  1480. text-align: center;
  1481. color: var(--muted);
  1482. font-size: 10px;
  1483. line-height: 1.9;
  1484. padding-top: 8px;
  1485. }
  1486. .font-options {
  1487. display: flex;
  1488. gap: 6px;
  1489. margin: 14px 0;
  1490. }
  1491. .font-options button {
  1492. min-height: 42px;
  1493. flex: 1;
  1494. border: 1px solid var(--line);
  1495. border-radius: 10px;
  1496. font-size: 11px;
  1497. }
  1498. .font-options button.active {
  1499. background: var(--tint);
  1500. border-color: var(--accent);
  1501. color: var(--accent);
  1502. }
  1503. #overlay-root {
  1504. position: absolute;
  1505. inset: 0;
  1506. z-index: 20;
  1507. pointer-events: none;
  1508. }
  1509. #overlay-root:not(:empty) {
  1510. pointer-events: auto;
  1511. }
  1512. .backdrop {
  1513. position: absolute;
  1514. inset: 0;
  1515. background: var(--shade);
  1516. animation: fade 0.2s;
  1517. }
  1518. .sheet {
  1519. position: absolute;
  1520. bottom: 0;
  1521. left: 0;
  1522. right: 0;
  1523. max-height: 88%;
  1524. display: flex;
  1525. flex-direction: column;
  1526. background: var(--canvas);
  1527. border-radius: 27px 27px 0 0;
  1528. padding: 0 23px 30px;
  1529. box-shadow: 0 -8px 30px #00000005;
  1530. animation: sheet-in 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
  1531. }
  1532. .sheet-handle {
  1533. width: 34px;
  1534. height: 4px;
  1535. border-radius: 3px;
  1536. background: var(--line);
  1537. align-self: center;
  1538. margin: 10px 0 3px;
  1539. flex-shrink: 0;
  1540. min-height: 4px;
  1541. }
  1542. .sheet-header {
  1543. display: flex;
  1544. align-items: center;
  1545. justify-content: space-between;
  1546. gap: 10px;
  1547. min-height: 61px;
  1548. flex-shrink: 0;
  1549. }
  1550. .sheet-header h2 {
  1551. font-size: 17px;
  1552. font-weight: 550;
  1553. }
  1554. .sheet-header .icon-button {
  1555. margin-right: -10px;
  1556. }
  1557. .sheet-body {
  1558. overflow: auto;
  1559. min-height: 0;
  1560. scrollbar-width: none;
  1561. overscroll-behavior: contain;
  1562. }
  1563. .sheet-description {
  1564. font-size: 11px;
  1565. line-height: 1.9;
  1566. color: var(--muted);
  1567. margin: 0 0 17px;
  1568. }
  1569. .sheet-list-button {
  1570. display: flex;
  1571. align-items: center;
  1572. gap: 12px;
  1573. min-height: 59px;
  1574. width: 100%;
  1575. border-bottom: 1px solid var(--line);
  1576. text-align: left;
  1577. font-size: 13px;
  1578. }
  1579. .sheet-list-button > svg {
  1580. width: 19px;
  1581. color: var(--secondary);
  1582. }
  1583. .sheet-list-button .selected-check {
  1584. color: var(--accent);
  1585. margin-left: auto;
  1586. }
  1587. .sheet-list-button small {
  1588. display: block;
  1589. color: var(--muted);
  1590. font-size: 10px;
  1591. margin-top: 5px;
  1592. }
  1593. .sheet-list-button .avatar {
  1594. width: 37px;
  1595. height: 37px;
  1596. border-radius: 12px;
  1597. }
  1598. .sheet-list-button > span:nth-child(2) {
  1599. flex: 1;
  1600. }
  1601. .sheet .segmented {
  1602. flex-shrink: 0;
  1603. }
  1604. .sheet-item {
  1605. padding: 15px 0;
  1606. border-bottom: 1px solid var(--line);
  1607. font-size: 12px;
  1608. }
  1609. .sheet-item strong {
  1610. font-size: 12px;
  1611. font-weight: 500;
  1612. }
  1613. .sheet-item p {
  1614. font-size: 11px;
  1615. color: var(--muted);
  1616. line-height: 1.8;
  1617. margin-top: 8px;
  1618. }
  1619. .sheet-item .tag {
  1620. float: right;
  1621. }
  1622. .sheet-form label {
  1623. display: block;
  1624. font-size: 11px;
  1625. color: var(--secondary);
  1626. margin-bottom: 8px;
  1627. }
  1628. .sheet-form input,
  1629. .sheet-form select {
  1630. width: 100%;
  1631. border: 1px solid var(--line);
  1632. background: var(--surface);
  1633. color: var(--ink);
  1634. border-radius: 11px;
  1635. min-height: 47px;
  1636. padding: 0 12px;
  1637. font-size: 14px;
  1638. }
  1639. .sheet-form .primary-button {
  1640. margin-top: 17px;
  1641. }
  1642. .form-error {
  1643. color: var(--danger);
  1644. font-size: 11px;
  1645. line-height: 1.7;
  1646. min-height: 22px;
  1647. padding-top: 5px;
  1648. }
  1649. .drawer {
  1650. position: absolute;
  1651. left: 0;
  1652. top: 0;
  1653. bottom: 0;
  1654. width: 88%;
  1655. max-width: 355px;
  1656. background: var(--canvas);
  1657. border-radius: 0 22px 22px 0;
  1658. display: flex;
  1659. flex-direction: column;
  1660. padding: 40px 20px 24px;
  1661. animation: drawer-in 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
  1662. }
  1663. .drawer-header {
  1664. display: flex;
  1665. align-items: center;
  1666. justify-content: space-between;
  1667. min-height: 44px;
  1668. }
  1669. .drawer > .primary-button {
  1670. margin: 19px 0 15px;
  1671. flex-shrink: 0;
  1672. }
  1673. .drawer > .search-field {
  1674. margin-bottom: 5px;
  1675. flex-shrink: 0;
  1676. }
  1677. .drawer-scroll {
  1678. flex: 1;
  1679. overflow: auto;
  1680. scrollbar-width: none;
  1681. margin: 5px -2px;
  1682. padding: 0 2px;
  1683. }
  1684. .drawer .group-heading {
  1685. padding: 0 4px;
  1686. margin-top: 13px;
  1687. min-height: 35px;
  1688. }
  1689. .drawer-history {
  1690. width: 100%;
  1691. display: flex;
  1692. gap: 7px;
  1693. align-items: center;
  1694. text-align: left;
  1695. min-height: 44px;
  1696. padding: 0 9px;
  1697. font-size: 11px;
  1698. border-radius: 9px;
  1699. }
  1700. .drawer-history.active {
  1701. background: var(--tint);
  1702. color: var(--accent);
  1703. }
  1704. .drawer-history svg {
  1705. width: 14px;
  1706. color: var(--muted);
  1707. }
  1708. .drawer-history span {
  1709. overflow: hidden;
  1710. text-overflow: ellipsis;
  1711. white-space: nowrap;
  1712. }
  1713. .drawer-nav {
  1714. display: grid;
  1715. grid-template-columns: repeat(4, 1fr);
  1716. border-top: 1px solid var(--line);
  1717. padding-top: 13px;
  1718. flex-shrink: 0;
  1719. }
  1720. .drawer-nav button {
  1721. min-height: 49px;
  1722. display: flex;
  1723. flex-direction: column;
  1724. gap: 6px;
  1725. align-items: center;
  1726. justify-content: center;
  1727. font-size: 9px;
  1728. color: var(--secondary);
  1729. }
  1730. .drawer-nav svg {
  1731. width: 20px;
  1732. height: 20px;
  1733. }
  1734. .drawer-bottom {
  1735. font-size: 9px;
  1736. color: var(--muted);
  1737. text-align: center;
  1738. margin-top: 15px;
  1739. }
  1740. .preview-document {
  1741. padding: 22px;
  1742. background: var(--surface);
  1743. border: 1px solid var(--line);
  1744. border-radius: 6px;
  1745. font-size: 11px;
  1746. line-height: 2;
  1747. margin: 5px 0 17px;
  1748. min-height: 280px;
  1749. }
  1750. .preview-document h1 {
  1751. font-size: 21px;
  1752. margin: 15px 0;
  1753. }
  1754. .preview-document h2 {
  1755. font-size: 14px;
  1756. margin: 18px 0 8px;
  1757. }
  1758. .preview-document p {
  1759. color: var(--secondary);
  1760. margin-bottom: 12px;
  1761. }
  1762. .preview-document table {
  1763. border-collapse: collapse;
  1764. width: 100%;
  1765. font-size: 10px;
  1766. margin: 18px 0;
  1767. }
  1768. .preview-document td,
  1769. .preview-document th {
  1770. padding: 8px 4px;
  1771. text-align: left;
  1772. border-bottom: 1px solid var(--line);
  1773. }
  1774. .preview-document th {
  1775. background: var(--soft);
  1776. }
  1777. .toast {
  1778. position: absolute;
  1779. left: 50%;
  1780. bottom: 130px;
  1781. transform: translate(-50%, 8px);
  1782. background: #28392eeb;
  1783. color: #fff;
  1784. padding: 12px 17px;
  1785. border-radius: 13px;
  1786. z-index: 40;
  1787. font-size: 11px;
  1788. line-height: 1.7;
  1789. max-width: 85%;
  1790. width: max-content;
  1791. opacity: 0;
  1792. pointer-events: none;
  1793. transition:
  1794. opacity 0.2s,
  1795. transform 0.2s;
  1796. text-align: center;
  1797. }
  1798. .toast.visible {
  1799. opacity: 1;
  1800. transform: translate(-50%, 0);
  1801. }
  1802. .state-chips {
  1803. display: flex;
  1804. flex-wrap: wrap;
  1805. gap: 7px;
  1806. padding: 8px 0 18px;
  1807. }
  1808. .state-chips button {
  1809. border: 1px solid var(--line);
  1810. border-radius: 9px;
  1811. padding: 10px;
  1812. font-size: 11px;
  1813. }
  1814. .state-chips button.active {
  1815. background: var(--tint);
  1816. color: var(--accent);
  1817. border-color: var(--accent);
  1818. }
  1819. .device.dark {
  1820. color-scheme: dark;
  1821. --canvas: #1e2520;
  1822. --surface: #252e27;
  1823. --soft: #2b342d;
  1824. --ink: #e1e7dc;
  1825. --muted: #8f9c8b;
  1826. --secondary: #aeb9a7;
  1827. --line: #354035;
  1828. --accent: #a4c59a;
  1829. --tint: #303f30;
  1830. --shade: #080f0bbb;
  1831. }
  1832. .dark .send-button,
  1833. .dark .primary-button,
  1834. .dark .unread {
  1835. color: #1e2520;
  1836. }
  1837. .dark .user-bubble {
  1838. background: #303c2e;
  1839. }
  1840. .dark .hero-art {
  1841. background: #303c2c;
  1842. }
  1843. .dark .composer {
  1844. border-color: #43503e;
  1845. }
  1846. .dark .profile-button {
  1847. background: #35412f;
  1848. color: #b8c8aa;
  1849. }
  1850. .dark .overview > div {
  1851. border-color: #43513e;
  1852. }
  1853. .dark .file-badge {
  1854. border-color: #4c5e45;
  1855. }
  1856. .dark .avatar.clay {
  1857. background: #40362e;
  1858. color: #c6ab96;
  1859. }
  1860. .dark .avatar.lilac {
  1861. background: #36313e;
  1862. color: #b4a6cc;
  1863. }
  1864. .dark .connection-banner {
  1865. background: #403729;
  1866. color: #d8bb87;
  1867. }
  1868. .dark .profile-card .avatar {
  1869. background: #38432e;
  1870. color: #bbcca3;
  1871. }
  1872. @keyframes arrive {
  1873. from {
  1874. opacity: 0;
  1875. transform: translateY(5px);
  1876. }
  1877. to {
  1878. opacity: 1;
  1879. transform: translateY(0);
  1880. }
  1881. }
  1882. @keyframes fade {
  1883. from {
  1884. opacity: 0;
  1885. }
  1886. to {
  1887. opacity: 1;
  1888. }
  1889. }
  1890. @keyframes sheet-in {
  1891. from {
  1892. transform: translateY(50px);
  1893. opacity: 0.3;
  1894. }
  1895. to {
  1896. transform: translateY(0);
  1897. opacity: 1;
  1898. }
  1899. }
  1900. @keyframes drawer-in {
  1901. from {
  1902. transform: translateX(-35px);
  1903. opacity: 0.4;
  1904. }
  1905. to {
  1906. transform: translateX(0);
  1907. opacity: 1;
  1908. }
  1909. }
  1910. @keyframes pulse {
  1911. 0%,
  1912. 80%,
  1913. 100% {
  1914. opacity: 0.25;
  1915. transform: translateY(0);
  1916. }
  1917. 40% {
  1918. opacity: 1;
  1919. transform: translateY(-3px);
  1920. }
  1921. }
  1922. @media (max-width: 1200px) {
  1923. .presentation {
  1924. grid-template-columns: 1fr 424px;
  1925. max-width: 1000px;
  1926. gap: 65px;
  1927. padding: 35px 60px;
  1928. }
  1929. .design-notes {
  1930. display: none;
  1931. }
  1932. }
  1933. @media (max-width: 820px) {
  1934. .presentation {
  1935. display: flex;
  1936. justify-content: center;
  1937. padding: 30px 0;
  1938. min-height: 100dvh;
  1939. }
  1940. .intro {
  1941. display: none;
  1942. }
  1943. .device {
  1944. height: min(858px, calc(100dvh - 75px));
  1945. }
  1946. }
  1947. @media (max-width: 520px) {
  1948. body {
  1949. background: var(--canvas);
  1950. }
  1951. .presentation {
  1952. display: block;
  1953. padding: 0;
  1954. min-height: 0;
  1955. }
  1956. .device-wrap {
  1957. width: 100%;
  1958. }
  1959. .device {
  1960. width: 100%;
  1961. height: 100dvh;
  1962. min-height: 0;
  1963. padding: 0;
  1964. border: 0;
  1965. border-radius: 0;
  1966. box-shadow: none;
  1967. }
  1968. .statusbar,
  1969. .home-indicator,
  1970. .device-caption {
  1971. display: none;
  1972. }
  1973. .app {
  1974. height: 100%;
  1975. border-radius: 0;
  1976. padding-top: env(safe-area-inset-top);
  1977. }
  1978. .app-header {
  1979. height: 64px;
  1980. min-height: 64px;
  1981. }
  1982. #composer-area {
  1983. padding-bottom: max(13px, env(safe-area-inset-bottom));
  1984. }
  1985. .tabbar {
  1986. padding-bottom: max(9px, env(safe-area-inset-bottom));
  1987. }
  1988. .drawer {
  1989. padding-top: max(19px, env(safe-area-inset-top));
  1990. padding-bottom: max(20px, env(safe-area-inset-bottom));
  1991. }
  1992. .sheet {
  1993. padding-bottom: max(25px, env(safe-area-inset-bottom));
  1994. }
  1995. .home-screen {
  1996. padding-top: clamp(15px, 5vh, 42px);
  1997. }
  1998. .home-hero h1 {
  1999. font-size: 32px;
  2000. }
  2001. .toast {
  2002. bottom: 145px;
  2003. }
  2004. }
  2005. @media (max-width: 360px) {
  2006. .screen {
  2007. padding-left: 18px;
  2008. padding-right: 18px;
  2009. }
  2010. .home-hero h1 {
  2011. font-size: 29px;
  2012. }
  2013. .home-hero p {
  2014. font-size: 11px;
  2015. }
  2016. .home-screen {
  2017. padding-top: 15px;
  2018. }
  2019. .hero-art {
  2020. margin-bottom: 16px;
  2021. width: 55px;
  2022. height: 55px;
  2023. }
  2024. .home-hero .overline {
  2025. font-size: 10px;
  2026. }
  2027. .agent-select {
  2028. max-width: 180px;
  2029. }
  2030. .conversation-top strong {
  2031. font-size: 12px;
  2032. }
  2033. }
  2034. @media (max-height: 740px) {
  2035. .home-screen {
  2036. padding-top: 10px;
  2037. }
  2038. .hero-art {
  2039. margin-bottom: 12px;
  2040. width: 48px;
  2041. height: 48px;
  2042. border-radius: 16px;
  2043. }
  2044. .hero-art svg {
  2045. width: 32px;
  2046. height: 32px;
  2047. }
  2048. .home-hero h1 {
  2049. font-size: 27px;
  2050. line-height: 1.5;
  2051. }
  2052. .home-hero p {
  2053. margin-top: 7px;
  2054. }
  2055. .prompts {
  2056. padding-top: 12px;
  2057. }
  2058. .recent-block {
  2059. padding-top: 14px;
  2060. }
  2061. .recent-row {
  2062. padding: 9px 0;
  2063. }
  2064. .composer-footnote {
  2065. margin-top: 7px;
  2066. }
  2067. .home-hero .overline {
  2068. margin-bottom: 7px;
  2069. }
  2070. .home-screen {
  2071. padding-bottom: 12px;
  2072. }
  2073. }
  2074. @media (prefers-reduced-motion: reduce) {
  2075. *,
  2076. *:before,
  2077. *:after {
  2078. animation: none !important;
  2079. transition: none !important;
  2080. scroll-behavior: auto !important;
  2081. }
  2082. }
  2083. .home-hero p {
  2084. font-size: 13px;
  2085. }
  2086. .prompt {
  2087. min-height: 44px;
  2088. font-size: 12px;
  2089. }
  2090. .recent-row {
  2091. min-height: 65px;
  2092. }
  2093. .recent-row strong {
  2094. font-size: 14px;
  2095. }
  2096. .recent-row small {
  2097. font-size: 11px;
  2098. }
  2099. .recent-row time {
  2100. font-size: 11px;
  2101. }
  2102. .section-label {
  2103. font-size: 11px;
  2104. }
  2105. .text-button {
  2106. font-size: 12px;
  2107. min-height: 44px;
  2108. }
  2109. .conversation-top strong {
  2110. font-size: 14px;
  2111. }
  2112. .conversation-body p {
  2113. font-size: 12px;
  2114. }
  2115. .conversation-meta {
  2116. font-size: 10px;
  2117. }
  2118. .conversation-top time {
  2119. font-size: 10px;
  2120. }
  2121. .segmented button {
  2122. min-height: 44px;
  2123. font-size: 13px;
  2124. }
  2125. .contact-row strong {
  2126. font-size: 14px;
  2127. }
  2128. .contact-row small {
  2129. font-size: 12px;
  2130. }
  2131. .tabbar button {
  2132. font-size: 10px;
  2133. }
  2134. .page-subtitle {
  2135. font-size: 12px;
  2136. }
  2137. .agent-card-head small {
  2138. font-size: 11px;
  2139. }
  2140. .agent-current {
  2141. font-size: 12px;
  2142. }
  2143. .agent-metrics {
  2144. font-size: 10px;
  2145. }
  2146. .agent-actions button {
  2147. min-height: 44px;
  2148. font-size: 11px;
  2149. }
  2150. .sheet-description {
  2151. font-size: 12px;
  2152. }
  2153. .sheet-list-button {
  2154. min-height: 63px;
  2155. }
  2156. .sheet-list-button small {
  2157. font-size: 11px;
  2158. }
  2159. .process summary {
  2160. font-size: 11px;
  2161. min-height: 44px;
  2162. }
  2163. .process ol {
  2164. font-size: 12px;
  2165. }
  2166. .user-bubble {
  2167. font-size: 14px;
  2168. }
  2169. .assistant-heading {
  2170. font-size: 12px;
  2171. }
  2172. .settings-row {
  2173. font-size: 14px;
  2174. }
  2175. .settings-row small {
  2176. font-size: 11px;
  2177. }
  2178. .composer-tools .icon-button {
  2179. width: 44px;
  2180. min-width: 44px;
  2181. height: 44px;
  2182. }
  2183. .send-button {
  2184. width: 44px;
  2185. height: 44px;
  2186. min-height: 44px;
  2187. }
  2188. .agent-select {
  2189. height: 44px;
  2190. font-size: 11px;
  2191. }
  2192. .user-file svg {
  2193. width: 13px;
  2194. height: 13px;
  2195. vertical-align: middle;
  2196. }
  2197. .hero-art {
  2198. flex-shrink: 0;
  2199. }
  2200. .header-center {
  2201. flex: 1;
  2202. }
  2203. .header-title {
  2204. display: flex;
  2205. align-items: center;
  2206. justify-content: center;
  2207. gap: 7px;
  2208. min-height: 31px;
  2209. width: 100%;
  2210. padding: 0;
  2211. }
  2212. .header-title strong {
  2213. overflow: hidden;
  2214. text-overflow: ellipsis;
  2215. white-space: nowrap;
  2216. font-size: 15px;
  2217. }
  2218. .header-title svg {
  2219. width: 12px;
  2220. height: 12px;
  2221. color: var(--muted);
  2222. }
  2223. .subtitle-separator {
  2224. color: var(--line);
  2225. margin: 0 3px;
  2226. }
  2227. .collaboration-rail {
  2228. display: flex;
  2229. align-items: center;
  2230. justify-content: space-between;
  2231. gap: 8px;
  2232. padding: 0 2px 8px;
  2233. }
  2234. .quick-current {
  2235. min-height: 44px;
  2236. display: flex;
  2237. align-items: center;
  2238. gap: 6px;
  2239. font-size: 11px;
  2240. color: var(--secondary);
  2241. padding: 0 7px;
  2242. }
  2243. .quick-current svg {
  2244. width: 15px;
  2245. height: 15px;
  2246. }
  2247. .quick-agent {
  2248. color: var(--muted);
  2249. }
  2250. .activity-entry {
  2251. min-height: 36px;
  2252. display: flex;
  2253. align-items: center;
  2254. gap: 7px;
  2255. font-size: 11px;
  2256. color: var(--accent);
  2257. padding: 0 11px;
  2258. border: 1px solid var(--line);
  2259. border-radius: 30px;
  2260. background: var(--surface);
  2261. position: relative;
  2262. }
  2263. .activity-entry:after {
  2264. content: '';
  2265. position: absolute;
  2266. inset: -4px 0;
  2267. }
  2268. .activity-entry svg {
  2269. width: 13px;
  2270. height: 13px;
  2271. }
  2272. .activity-orbit {
  2273. width: 7px;
  2274. height: 7px;
  2275. border: 1px solid var(--muted);
  2276. border-radius: 50%;
  2277. }
  2278. .activity-orbit.running {
  2279. border-color: var(--accent);
  2280. background: var(--accent);
  2281. box-shadow: 0 0 0 3px var(--tint);
  2282. animation: breathe 2.6s ease-in-out infinite;
  2283. }
  2284. .attention-count {
  2285. min-width: 17px;
  2286. height: 17px;
  2287. border-radius: 6px;
  2288. color: #a56434;
  2289. background: #f7eddf;
  2290. display: grid;
  2291. place-items: center;
  2292. font-size: 9px;
  2293. margin-left: 1px;
  2294. }
  2295. .activity-text {
  2296. color: var(--muted);
  2297. }
  2298. .activity-text.running,
  2299. .activity-text.done {
  2300. color: var(--accent);
  2301. }
  2302. .activity-text.attention {
  2303. color: #ac6941;
  2304. }
  2305. .inline-activity {
  2306. font-size: 10px;
  2307. display: inline-flex;
  2308. align-items: center;
  2309. gap: 5px;
  2310. white-space: nowrap;
  2311. }
  2312. .inline-activity:before {
  2313. content: '';
  2314. width: 4px;
  2315. height: 4px;
  2316. border-radius: 50%;
  2317. background: currentColor;
  2318. }
  2319. .conversation-meta .inline-activity {
  2320. margin-left: auto;
  2321. }
  2322. .inline-activity.running {
  2323. color: var(--accent);
  2324. }
  2325. .inline-activity.attention {
  2326. color: #a86a40;
  2327. }
  2328. .inline-activity.done {
  2329. color: #718468;
  2330. }
  2331. .inline-activity.idle {
  2332. color: var(--muted);
  2333. }
  2334. .activity-sheet {
  2335. height: 86%;
  2336. }
  2337. .activity-sheet .search-field {
  2338. position: sticky;
  2339. top: 0;
  2340. z-index: 2;
  2341. box-shadow: 0 -8px 0 8px var(--canvas);
  2342. }
  2343. .activity-sheet .segmented {
  2344. position: sticky;
  2345. top: 60px;
  2346. background: var(--canvas);
  2347. z-index: 2;
  2348. padding-top: 2px;
  2349. }
  2350. .activity-sheet .segmented button {
  2351. font-size: 11px;
  2352. }
  2353. .activity-group-label {
  2354. display: flex;
  2355. align-items: center;
  2356. justify-content: space-between;
  2357. font-size: 10px;
  2358. color: var(--muted);
  2359. padding: 12px 1px;
  2360. }
  2361. .activity-group-label .inline-activity {
  2362. font-size: 11px;
  2363. }
  2364. .activity-card {
  2365. display: flex;
  2366. align-items: flex-start;
  2367. gap: 10px;
  2368. min-height: 91px;
  2369. padding: 15px 11px;
  2370. margin-bottom: 8px;
  2371. border: 1px solid var(--line);
  2372. border-radius: 15px;
  2373. background: var(--surface);
  2374. width: 100%;
  2375. text-align: left;
  2376. }
  2377. .activity-card.current {
  2378. background: var(--tint);
  2379. border-color: transparent;
  2380. }
  2381. .activity-card.attention {
  2382. border-color: #e7d6c1;
  2383. }
  2384. .activity-card-avatar {
  2385. flex-shrink: 0;
  2386. position: relative;
  2387. }
  2388. .activity-card-avatar .avatar {
  2389. width: 33px;
  2390. height: 33px;
  2391. border-radius: 11px;
  2392. }
  2393. .activity-card-avatar .avatar svg {
  2394. width: 20px;
  2395. height: 20px;
  2396. }
  2397. .mini-state {
  2398. display: inline-flex;
  2399. width: 12px;
  2400. height: 12px;
  2401. border-radius: 50%;
  2402. align-items: center;
  2403. justify-content: center;
  2404. flex-shrink: 0;
  2405. font-size: 8px;
  2406. }
  2407. .mini-state.running {
  2408. background: var(--accent);
  2409. width: 6px;
  2410. height: 6px;
  2411. }
  2412. .mini-state.attention {
  2413. background: #ab7146;
  2414. color: white;
  2415. font-weight: 600;
  2416. }
  2417. .mini-state.done {
  2418. background: var(--accent);
  2419. color: var(--canvas);
  2420. }
  2421. .mini-state svg {
  2422. width: 9px;
  2423. height: 9px;
  2424. stroke-width: 2;
  2425. }
  2426. .activity-card-avatar .mini-state {
  2427. position: absolute;
  2428. right: -2px;
  2429. bottom: -2px;
  2430. outline: 3px solid var(--surface);
  2431. }
  2432. .activity-card-avatar .mini-state.running {
  2433. right: -1px;
  2434. bottom: 0;
  2435. }
  2436. .activity-card-content {
  2437. flex: 1;
  2438. min-width: 0;
  2439. }
  2440. .activity-card-content strong {
  2441. display: block;
  2442. font-size: 12px;
  2443. font-weight: 550;
  2444. line-height: 1.6;
  2445. }
  2446. .activity-card-content > small {
  2447. display: block;
  2448. font-size: 10px;
  2449. color: var(--muted);
  2450. margin-top: 6px;
  2451. }
  2452. .activity-detail {
  2453. display: block;
  2454. color: var(--secondary);
  2455. font-size: 10px;
  2456. line-height: 1.7;
  2457. margin-top: 9px;
  2458. }
  2459. .attention .activity-detail {
  2460. color: #a86a40;
  2461. }
  2462. .activity-card-end {
  2463. display: flex;
  2464. align-items: flex-end;
  2465. justify-content: space-between;
  2466. flex-direction: column;
  2467. align-self: stretch;
  2468. width: 55px;
  2469. flex-shrink: 0;
  2470. }
  2471. .activity-card-end svg {
  2472. width: 14px;
  2473. height: 14px;
  2474. color: var(--muted);
  2475. margin-top: 2px;
  2476. }
  2477. .activity-card-end small {
  2478. font-size: 8px;
  2479. color: var(--muted);
  2480. white-space: nowrap;
  2481. }
  2482. .activity-card-end em {
  2483. font-size: 9px;
  2484. color: var(--accent);
  2485. font-style: normal;
  2486. }
  2487. .activity-sheet-footer {
  2488. margin-top: 16px;
  2489. border-top: 1px solid var(--line);
  2490. padding-top: 13px;
  2491. display: flex;
  2492. flex-direction: column;
  2493. align-items: center;
  2494. gap: 3px;
  2495. }
  2496. .activity-sheet-footer > span {
  2497. font-size: 9px;
  2498. color: var(--muted);
  2499. text-align: center;
  2500. }
  2501. .activity-sheet-footer button {
  2502. min-height: 44px;
  2503. font-size: 10px;
  2504. color: var(--secondary);
  2505. }
  2506. .drawer > .segmented {
  2507. flex-shrink: 0;
  2508. margin-top: 8px;
  2509. margin-bottom: 1px;
  2510. }
  2511. .drawer > .segmented button {
  2512. font-size: 11px;
  2513. }
  2514. .drawer-conversation {
  2515. display: block;
  2516. width: 100%;
  2517. text-align: left;
  2518. padding: 12px 9px;
  2519. border-radius: 11px;
  2520. min-height: 64px;
  2521. }
  2522. .drawer-conversation.active {
  2523. background: var(--tint);
  2524. }
  2525. .drawer-conversation-title {
  2526. display: flex;
  2527. align-items: center;
  2528. gap: 8px;
  2529. font-size: 12px;
  2530. line-height: 1.7;
  2531. }
  2532. .drawer-conversation-title > .mini-state {
  2533. margin-left: auto;
  2534. }
  2535. .drawer-conversation > small {
  2536. display: block;
  2537. font-size: 10px;
  2538. color: var(--muted);
  2539. margin-top: 5px;
  2540. }
  2541. .drawer-agent-group {
  2542. padding: 13px 0;
  2543. border-bottom: 1px solid var(--line);
  2544. }
  2545. .drawer-agent-head {
  2546. display: flex;
  2547. gap: 8px;
  2548. align-items: center;
  2549. padding-left: 5px;
  2550. }
  2551. .drawer-agent-head .avatar {
  2552. width: 30px;
  2553. height: 30px;
  2554. border-radius: 10px;
  2555. }
  2556. .drawer-agent-head .avatar svg {
  2557. width: 18px;
  2558. height: 18px;
  2559. }
  2560. .drawer-agent-head strong {
  2561. font-size: 12px;
  2562. font-weight: 550;
  2563. display: block;
  2564. }
  2565. .drawer-agent-head small {
  2566. display: block;
  2567. font-size: 9px;
  2568. margin-top: 4px;
  2569. color: var(--muted);
  2570. }
  2571. .drawer-agent-head > .inline-activity,
  2572. .drawer-agent-head > small {
  2573. margin-left: auto;
  2574. }
  2575. .drawer-agent-new {
  2576. width: 35px;
  2577. min-height: 44px;
  2578. display: grid;
  2579. place-items: center;
  2580. padding: 0;
  2581. }
  2582. .drawer-agent-new svg {
  2583. width: 15px;
  2584. color: var(--secondary);
  2585. }
  2586. .drawer-archive {
  2587. min-height: 41px;
  2588. display: flex;
  2589. align-items: center;
  2590. gap: 8px;
  2591. width: 100%;
  2592. font-size: 10px;
  2593. color: var(--muted);
  2594. flex-shrink: 0;
  2595. }
  2596. .drawer-archive svg {
  2597. width: 14px;
  2598. height: 14px;
  2599. }
  2600. .drawer-archive svg:last-child {
  2601. margin-left: auto;
  2602. }
  2603. .drawer-nav {
  2604. padding-top: 8px;
  2605. }
  2606. .regenerate-title {
  2607. width: 100%;
  2608. display: flex;
  2609. align-items: center;
  2610. justify-content: center;
  2611. gap: 8px;
  2612. min-height: 47px;
  2613. font-size: 12px;
  2614. border: 1px solid var(--line);
  2615. border-radius: 13px;
  2616. margin-top: 11px;
  2617. color: var(--secondary);
  2618. }
  2619. .regenerate-title svg {
  2620. width: 15px;
  2621. height: 15px;
  2622. }
  2623. .regenerate-title span {
  2624. font-size: 9px;
  2625. color: var(--muted);
  2626. }
  2627. .title-protection {
  2628. display: flex;
  2629. align-items: flex-start;
  2630. gap: 6px;
  2631. font-size: 10px;
  2632. line-height: 1.9;
  2633. color: var(--muted);
  2634. margin: 16px 0 3px;
  2635. }
  2636. .title-protection svg {
  2637. width: 13px;
  2638. height: 13px;
  2639. margin-top: 3px;
  2640. }
  2641. .blank-chat {
  2642. height: 100%;
  2643. display: flex;
  2644. flex-direction: column;
  2645. align-items: center;
  2646. justify-content: center;
  2647. text-align: center;
  2648. padding-bottom: 75px;
  2649. }
  2650. .blank-chat-mark {
  2651. width: 66px;
  2652. height: 66px;
  2653. display: grid;
  2654. place-items: center;
  2655. background: var(--tint);
  2656. color: var(--accent);
  2657. border-radius: 24px;
  2658. margin-bottom: 23px;
  2659. }
  2660. .blank-chat-mark svg {
  2661. width: 38px;
  2662. height: 38px;
  2663. }
  2664. .blank-chat h1 {
  2665. font-size: 24px;
  2666. font-weight: 500;
  2667. letter-spacing: -0.8px;
  2668. }
  2669. .blank-chat p {
  2670. font-size: 12px;
  2671. color: var(--muted);
  2672. line-height: 2;
  2673. margin-top: 15px;
  2674. }
  2675. .completion-banner {
  2676. position: absolute;
  2677. top: 105px;
  2678. left: 19px;
  2679. right: 19px;
  2680. display: flex;
  2681. align-items: center;
  2682. gap: 10px;
  2683. background: var(--surface);
  2684. padding: 14px 10px 14px 14px;
  2685. z-index: 25;
  2686. box-shadow: 0 10px 35px #233a2620;
  2687. border: 1px solid var(--line);
  2688. border-radius: 17px;
  2689. animation: arrive 0.25s ease;
  2690. }
  2691. .completion-mark {
  2692. background: var(--tint);
  2693. color: var(--accent);
  2694. width: 31px;
  2695. height: 31px;
  2696. display: grid;
  2697. place-items: center;
  2698. border-radius: 50%;
  2699. flex-shrink: 0;
  2700. }
  2701. .completion-mark svg {
  2702. width: 17px;
  2703. }
  2704. .completion-banner > button {
  2705. text-align: left;
  2706. padding: 0;
  2707. flex: 1;
  2708. min-width: 0;
  2709. }
  2710. .completion-banner > button strong {
  2711. font-size: 12px;
  2712. font-weight: 550;
  2713. display: block;
  2714. }
  2715. .completion-banner > button small {
  2716. display: block;
  2717. font-size: 10px;
  2718. line-height: 1.7;
  2719. color: var(--muted);
  2720. margin-top: 5px;
  2721. }
  2722. .completion-banner > button:last-child {
  2723. width: 35px;
  2724. flex: 0 0 35px;
  2725. min-height: 44px;
  2726. display: grid;
  2727. place-items: center;
  2728. color: var(--muted);
  2729. }
  2730. .completion-banner > button:last-child svg {
  2731. width: 15px;
  2732. }
  2733. .prototype-shortcuts {
  2734. margin-top: 20px;
  2735. display: flex;
  2736. flex-direction: column;
  2737. }
  2738. .prototype-shortcuts button {
  2739. display: flex;
  2740. align-items: center;
  2741. gap: 6px;
  2742. min-height: 35px;
  2743. padding: 0;
  2744. font-size: 10px;
  2745. color: #748268;
  2746. text-align: left;
  2747. }
  2748. .prototype-shortcuts svg {
  2749. width: 12px;
  2750. height: 12px;
  2751. }
  2752. .scope-note {
  2753. margin-top: 20px;
  2754. }
  2755. @keyframes breathe {
  2756. 50% {
  2757. box-shadow: 0 0 0 5px var(--tint);
  2758. }
  2759. }
  2760. .sheet-handle {
  2761. width: 100%;
  2762. min-height: 25px;
  2763. height: 25px;
  2764. margin: 0;
  2765. background: none;
  2766. position: relative;
  2767. touch-action: none;
  2768. cursor: grab;
  2769. }
  2770. .sheet-handle:before {
  2771. content: '';
  2772. position: absolute;
  2773. left: calc(50% - 17px);
  2774. top: 10px;
  2775. width: 34px;
  2776. height: 4px;
  2777. background: var(--line);
  2778. border-radius: 4px;
  2779. }
  2780. .skeleton-list {
  2781. padding-top: 10px;
  2782. }
  2783. .skeleton-row {
  2784. display: flex;
  2785. align-items: center;
  2786. gap: 12px;
  2787. padding: 19px 0;
  2788. border-bottom: 1px solid var(--line);
  2789. }
  2790. .skeleton-row > span {
  2791. width: 39px;
  2792. height: 39px;
  2793. border-radius: 14px;
  2794. background: var(--soft);
  2795. }
  2796. .skeleton-row > div {
  2797. flex: 1;
  2798. }
  2799. .skeleton-row i {
  2800. display: block;
  2801. width: 78%;
  2802. height: 11px;
  2803. background: var(--soft);
  2804. border-radius: 5px;
  2805. }
  2806. .skeleton-row i:last-child {
  2807. width: 55%;
  2808. height: 8px;
  2809. margin-top: 12px;
  2810. }
  2811. @media (max-width: 520px) {
  2812. .device {
  2813. height: var(--visual-height, 100dvh);
  2814. }
  2815. .completion-banner {
  2816. top: calc(70px + env(safe-area-inset-top));
  2817. }
  2818. }
  2819. @media (max-width: 360px) {
  2820. .activity-card {
  2821. gap: 8px;
  2822. padding: 12px 9px;
  2823. }
  2824. .activity-card-content strong {
  2825. font-size: 11px;
  2826. }
  2827. .activity-card-end {
  2828. width: 44px;
  2829. }
  2830. .activity-card-end small {
  2831. font-size: 7px;
  2832. }
  2833. .quick-agent {
  2834. display: none;
  2835. }
  2836. }
  2837. @media (prefers-reduced-motion: reduce) {
  2838. .activity-orbit.running {
  2839. animation: none;
  2840. }
  2841. }
  2842. </style>
  2843. </head>
  2844. <body>
  2845. <div class="presentation">
  2846. <aside class="intro">
  2847. <a class="studio-brand" href="#/home"
  2848. ><span data-icon="flower"></span> fmode<span class="edition">MOBILE STUDY / 01</span></a
  2849. >
  2850. <div class="intro-copy">
  2851. <div class="eyebrow">不止是聊天,更是多线协作</div>
  2852. <h1>一手掌控。<br />多线从容。</h1>
  2853. <p>知道谁在工作,记得聊到哪里。<br />在每一段协作之间,自如切换。</p>
  2854. <span class="proposal-tag"><i class="dot"></i> 交互提案 · 非生产环境</span>
  2855. </div>
  2856. <div class="scene-switch" aria-label="原型场景">
  2857. <span class="eyebrow">从这里开始体验</span
  2858. ><button data-scene="chat">
  2859. <span>01</span> 沉浸式协作 <span data-icon="arrow-right"></span></button
  2860. ><button data-experience="activity">
  2861. <span>02</span> 一步切换,进展在握 <span data-icon="arrow-right"></span></button
  2862. ><button data-scene="messages">
  2863. <span>03</span> 找回之前的想法 <span data-icon="arrow-right"></span></button
  2864. ><button data-scene="home">
  2865. <span>04</span> 开始新的想法 <span data-icon="arrow-right"></span>
  2866. </button>
  2867. </div>
  2868. <div class="intro-footer">
  2869. FMODE / MOBILE EXPERIENCE<br /><span>独立 HTML 原型 · 2026.11.16</span>
  2870. </div>
  2871. </aside>
  2872. <div class="device-wrap">
  2873. <div class="device" id="device">
  2874. <div class="statusbar" aria-hidden="true">
  2875. <span>9:41</span>
  2876. <div class="island"></div>
  2877. <div class="status-icons">
  2878. <span data-icon="signal"></span><span data-icon="wifi"></span
  2879. ><span data-icon="battery"></span>
  2880. </div>
  2881. </div>
  2882. <div class="app" id="app">
  2883. <header id="app-header" class="app-header"></header>
  2884. <main id="main" tabindex="-1"></main>
  2885. <div id="composer-area"></div>
  2886. <nav id="tabbar" class="tabbar" aria-label="主导航"></nav>
  2887. </div>
  2888. <div id="overlay-root"></div>
  2889. <div id="toast" class="toast" role="status" aria-live="polite"></div>
  2890. <div class="home-indicator" aria-hidden="true"></div>
  2891. </div>
  2892. <div class="device-caption">
  2893. <i class="dot"></i> 可交互原型 <span>·</span> 点击、输入,试试看
  2894. </div>
  2895. </div>
  2896. <aside class="design-notes">
  2897. <span class="eyebrow">体验,而不是功能重做</span>
  2898. <div class="note">
  2899. <span>01 / AWARENESS</span>
  2900. <h2>专注这一件,也看得见全局</h2>
  2901. <p>输入坞上沿,一步打开协作动态。进行中、待关注、已完成,不再只靠猜。</p>
  2902. </div>
  2903. <div class="note">
  2904. <span>02 / REACH</span>
  2905. <h2>切换靠近拇指,不挤发送按钮</h2>
  2906. <p>新建、切换与发送各有位置。Enter 只换行,避免把未写完的想法发出去。</p>
  2907. </div>
  2908. <div class="note">
  2909. <span>03 / CONTINUITY</span>
  2910. <h2>按会话记住,不按分身覆盖</h2>
  2911. <p>切换保留草稿。标题可直接编辑,同一数字生命中新建,不必重新选人。</p>
  2912. </div>
  2913. <div class="prototype-shortcuts">
  2914. <button data-experience="title">体验标题编辑 <span data-icon="arrow-right"></span></button
  2915. ><button data-experience="complete">
  2916. 体验完成提醒 <span data-icon="arrow-right"></span>
  2917. </button>
  2918. </div>
  2919. <div class="scope-note">
  2920. <span data-icon="shield"></span
  2921. ><span>不接真实接口,不修改现有项目。<br />所有消息、文件和余额均为演示。</span>
  2922. </div>
  2923. </aside>
  2924. </div>
  2925. <input id="file-input" type="file" multiple hidden />
  2926. <script>
  2927. const icons = {
  2928. menu: '<path d="M4 7h16M4 12h11M4 17h16"/>',
  2929. flower: Array.from(
  2930. { length: 8 },
  2931. (_, index) =>
  2932. `<ellipse cx="12" cy="7.3" rx="2.15" ry="4.6" transform="rotate(${index * 45} 12 12)"/>`,
  2933. ).join(''),
  2934. 'arrow-right': '<path d="M5 12h14m-5-5 5 5-5 5"/>',
  2935. 'arrow-up': '<path d="M12 19V5m-6 6 6-6 6 6"/>',
  2936. back: '<path d="m14 5-7 7 7 7"/>',
  2937. chevron: '<path d="m8 10 4 4 4-4"/>',
  2938. right: '<path d="m9 6 6 6-6 6"/>',
  2939. plus: '<path d="M12 5v14M5 12h14"/>',
  2940. close: '<path d="m6 6 12 12M6 18 18 6"/>',
  2941. chat: '<path d="M20 11.5a7.7 7.7 0 0 1-8 7.5 9 9 0 0 1-3-.5L4 20l1.5-4.5A7.2 7.2 0 0 1 4 11.5a8 8 0 0 1 16 0Z"/><path d="M8 10h8M8 14h5"/>',
  2942. edit: '<path d="M12 4H4v16h16v-8M10 14l1-4L19 2l3 3-8 8Z"/>',
  2943. search: '<circle cx="10.5" cy="10.5" r="6.5"/><path d="m16 16 4 4"/>',
  2944. people:
  2945. '<circle cx="9" cy="8" r="3"/><path d="M3 20v-3a6 6 0 0 1 12 0v3m1-15a3 3 0 0 1 0 6m2 3a5 5 0 0 1 3 4v2"/>',
  2946. grid: '<rect x="4" y="4" width="6" height="6" rx="1.5"/><rect x="14" y="4" width="6" height="6" rx="1.5"/><rect x="4" y="14" width="6" height="6" rx="1.5"/><rect x="14" y="14" width="6" height="6" rx="1.5"/>',
  2947. user: '<circle cx="12" cy="8" r="4"/><path d="M4 21v-2a8 8 0 0 1 16 0v2"/>',
  2948. more: '<circle cx="5" cy="12" r=".9"/><circle cx="12" cy="12" r=".9"/><circle cx="19" cy="12" r=".9"/>',
  2949. folder: '<path d="M3 7a2 2 0 0 1 2-2h5l2 3h7a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z"/>',
  2950. archive: '<rect x="3" y="4" width="18" height="4" rx="1"/><path d="M5 8v12h14V8M10 12h4"/>',
  2951. file: '<path d="M14 3H5v18h14V8Zm0 0v6h5M8 13h8M8 17h6"/>',
  2952. clip: '<path d="m8 13 7-7a3 3 0 0 1 4 4L9 20a5 5 0 0 1-7-7L13 2"/>',
  2953. check: '<path d="m5 12 4 4L19 6"/>',
  2954. shield: '<path d="m12 3 8 3v6c0 5-8 9-8 9s-8-4-8-9V6Z"/><path d="m8 12 3 3 5-6"/>',
  2955. copy: '<rect x="8" y="8" width="12" height="13" rx="2"/><path d="M15 8V3H3v13h5"/>',
  2956. moon: '<path d="M20 14A8 8 0 0 1 10 4a8.5 8.5 0 1 0 10 10Z"/>',
  2957. bell: '<path d="M5 17h14l-2-4V9a5 5 0 0 0-10 0v4Zm5 3h4"/>',
  2958. key: '<circle cx="8" cy="9" r="5"/><path d="m12 13 8 8m-4-4 3-3"/>',
  2959. eye: '<path d="M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12Z"/><circle cx="12" cy="12" r="3"/>',
  2960. logout: '<path d="M10 4H4v16h6m5-12 5 4-5 4m-6-4h11"/>',
  2961. link: '<path d="m9 15 6-6m-4-3 2-2a5 5 0 0 1 7 7l-2 2m-5 5-2 2a5 5 0 0 1-7-7l2-2"/>',
  2962. wallet: '<rect x="3" y="5" width="18" height="15" rx="2"/><path d="M3 8h18m-5 4h5v5h-5Z"/>',
  2963. trash: '<path d="M3 6h18M9 6V3h6v3M5 6l1 15h12l1-15M10 10v7m4-7v7"/>',
  2964. download: '<path d="M12 3v12m-5-5 5 5 5-5M4 16v5h16v-5"/>',
  2965. spark: '<path d="m12 3 2.5 6.5L21 12l-6.5 2.5L12 21l-2.5-6.5L3 12l6.5-2.5Z"/>',
  2966. wifi: '<path d="M3 8a15 15 0 0 1 18 0M6 12a10 10 0 0 1 12 0M9 16a5 5 0 0 1 6 0"/><circle cx="12" cy="20" r=".7"/>',
  2967. signal: '<path d="M4 19v-3m5 3v-6m5 6V9m5 10V5" stroke-width="2.8"/>',
  2968. battery:
  2969. '<rect x="2" y="6" width="18" height="12" rx="3"/><path d="M22 10v4M5 9h12v6H5Z" fill="currentColor" stroke="none"/>',
  2970. };
  2971. const icon = (name, className = '') =>
  2972. `<svg class="${className}" viewBox="0 0 24 24" aria-hidden="true">${icons[name] || icons.spark}</svg>`;
  2973. const esc = (value) =>
  2974. String(value).replace(
  2975. /[&<>"']/g,
  2976. (character) =>
  2977. ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[character],
  2978. );
  2979. const ib = (name, label, action, extra = '') =>
  2980. `<button class="icon-button" aria-label="${esc(label)}" data-action="${action}" ${extra}>${icon(name)}</button>`;
  2981. const agents = [
  2982. {
  2983. id: 'a1',
  2984. name: '小禾',
  2985. role: '研究与写作伙伴',
  2986. tone: '',
  2987. online: true,
  2988. cpu: '12%',
  2989. memory: '328 MB',
  2990. balance: '128.60',
  2991. task: '正在整理产品体验调研',
  2992. symbol: 'flower',
  2993. },
  2994. {
  2995. id: 'a2',
  2996. name: '阿澈',
  2997. role: '开发与技术伙伴',
  2998. tone: 'clay',
  2999. online: true,
  3000. cpu: '8%',
  3001. memory: '256 MB',
  3002. balance: '86.20',
  3003. task: '等待新的协作指令',
  3004. symbol: 'grid',
  3005. },
  3006. {
  3007. id: 'a3',
  3008. name: '知夏',
  3009. role: '设计与创意伙伴',
  3010. tone: 'lilac',
  3011. online: false,
  3012. cpu: '—',
  3013. memory: '—',
  3014. balance: '42.00',
  3015. task: '当前离线,连接恢复后继续协作',
  3016. symbol: 'spark',
  3017. },
  3018. ];
  3019. const conversations = [
  3020. {
  3021. id: 'c1',
  3022. title: '把产品的第一印象做好',
  3023. agentId: 'a1',
  3024. preview: '我整理了三个可以落地的优化方向。',
  3025. time: '刚刚',
  3026. group: '今天',
  3027. workspace: 'w1',
  3028. unread: 2,
  3029. archived: false,
  3030. },
  3031. {
  3032. id: 'c2',
  3033. title: '官网首页的灵感与参考',
  3034. agentId: 'a3',
  3035. preview: '留白、秩序,以及一点点恰好的温度。',
  3036. time: '10:24',
  3037. group: '今天',
  3038. workspace: 'w1',
  3039. unread: 0,
  3040. archived: false,
  3041. },
  3042. {
  3043. id: 'c3',
  3044. title: '梳理一下这周的工作',
  3045. agentId: 'a1',
  3046. preview: '已按优先级整理好,随时可以继续。',
  3047. time: '昨天',
  3048. group: '昨天',
  3049. workspace: null,
  3050. unread: 0,
  3051. archived: false,
  3052. },
  3053. {
  3054. id: 'c4',
  3055. title: '登录接口联调记录',
  3056. agentId: 'a2',
  3057. preview: '接口参数和错误处理已经检查完毕。',
  3058. time: '昨天',
  3059. group: '昨天',
  3060. workspace: 'w2',
  3061. unread: 1,
  3062. archived: false,
  3063. },
  3064. {
  3065. id: 'c5',
  3066. title: '一些还没成形的小想法',
  3067. agentId: 'a1',
  3068. preview: '我们可以从一个最小的版本开始。',
  3069. time: '周五',
  3070. group: '更早',
  3071. workspace: null,
  3072. unread: 0,
  3073. archived: false,
  3074. },
  3075. {
  3076. id: 'c6',
  3077. title: '上一版品牌文案',
  3078. agentId: 'a1',
  3079. preview: '品牌文案讨论已归档。',
  3080. time: '11/08',
  3081. group: '更早',
  3082. workspace: 'w1',
  3083. unread: 0,
  3084. archived: true,
  3085. },
  3086. ];
  3087. let workspaces = [
  3088. { id: 'w1', name: '产品与灵感' },
  3089. { id: 'w2', name: '研发协作' },
  3090. ];
  3091. const messages = new Map();
  3092. const collaboration = new Map([
  3093. ['c1', { kind: 'done', label: '体验优化建议已交付', elapsed: '刚刚完成' }],
  3094. ['c2', { kind: 'attention', label: '连接中断,等待恢复', elapsed: '需要关注' }],
  3095. ['c3', { kind: 'running', label: '正在整理本周的优先级', elapsed: '已进行 2 分钟' }],
  3096. ['c4', { kind: 'running', label: '正在检查接口返回结果', elapsed: '已进行 45 秒' }],
  3097. ['c5', { kind: 'idle', label: '等待新的想法', elapsed: '空闲' }],
  3098. ]);
  3099. const activityNames = { running: '进行中', attention: '待关注', done: '已完成', idle: '空闲' };
  3100. const drafts = new Map();
  3101. const draftKey = () => (state.page === 'chat' ? state.currentId : 'home');
  3102. function saveDraft() {
  3103. if (['home', 'chat'].includes(state.page))
  3104. drafts.set(draftKey(), { text: state.draft, files: [...state.attachments] });
  3105. }
  3106. function restoreDraft() {
  3107. const draft = drafts.get(draftKey());
  3108. state.draft = draft?.text || '';
  3109. state.attachments = [...(draft?.files || [])];
  3110. }
  3111. let preferences = { dark: false, palette: 'forest', font: 14 };
  3112. try {
  3113. preferences = {
  3114. ...preferences,
  3115. ...JSON.parse(localStorage.getItem('fmode_mobile_proposal_v1') || '{}'),
  3116. };
  3117. } catch {}
  3118. const state = {
  3119. page: 'home',
  3120. currentId: 'c1',
  3121. agentId: null,
  3122. draft: '',
  3123. attachments: [],
  3124. filter: 'all',
  3125. contactFilter: 'agents',
  3126. agentFilter: 'all',
  3127. keyword: '',
  3128. expanded: new Set(),
  3129. drawerExpanded: new Set(),
  3130. pendingSend: false,
  3131. newWorkspace: null,
  3132. generating: false,
  3133. disconnected: false,
  3134. tokenVisible: false,
  3135. drawerView: 'recent',
  3136. activityFilter: 'all',
  3137. activityKeyword: '',
  3138. ...preferences,
  3139. };
  3140. const main = document.querySelector('#main'),
  3141. header = document.querySelector('#app-header'),
  3142. composerArea = document.querySelector('#composer-area'),
  3143. tabbar = document.querySelector('#tabbar'),
  3144. overlay = document.querySelector('#overlay-root'),
  3145. app = document.querySelector('#app');
  3146. let returnFocus, toastTimer, generationTimer;
  3147. const getAgent = (agentId) => agents.find((agent) => agent.id === agentId) || agents[0];
  3148. const getConversation = (identifier = state.currentId) =>
  3149. conversations.find((conversation) => conversation.id === identifier);
  3150. const avatar = (agent) => `<span class="avatar ${agent.tone}">${icon(agent.symbol)}</span>`;
  3151. const activeConversations = () => conversations.filter((conversation) => !conversation.archived);
  3152. const navItems = [
  3153. ['messages', 'chat', '会话'],
  3154. ['contacts', 'people', '通讯录'],
  3155. ['workbench', 'grid', '工作台'],
  3156. ['mine', 'user', '我的'],
  3157. ];
  3158. const emptyState = (title, description = '', symbol = 'search') =>
  3159. `<div class="empty-state">${icon(symbol)}<strong>${title}</strong><p>${description}</p></div>`;
  3160. const tabs = (items, active, action) =>
  3161. `<div class="segmented" aria-label="筛选">${items.map(([value, label]) => `<button data-action="${action}" data-value="${value}" aria-pressed="${value === active}" class="${value === active ? 'active' : ''}">${label}</button>`).join('')}</div>`;
  3162. const searchField = (placeholder, action = 'search', value = '') =>
  3163. `<label class="search-field">${icon('search')}<input type="search" aria-label="${placeholder}" placeholder="${placeholder}" data-input="${action}" value="${esc(value)}" /></label>`;
  3164. const navigation = () =>
  3165. navItems
  3166. .map(
  3167. ([page, symbol, label]) =>
  3168. `<button data-action="navigate" data-page="${page}" class="${state.page === page ? 'active' : ''}" ${state.page === page ? 'aria-current="page"' : ''}><span>${icon(symbol)}</span><span>${label}</span></button>`,
  3169. )
  3170. .join('');
  3171. function applyPreferences() {
  3172. const device = document.querySelector('#device');
  3173. device.classList.toggle('dark', state.dark);
  3174. const palettes = {
  3175. forest: ['#386b52', '#eaf1e8', '#a4c59a', '#303f30'],
  3176. blue: ['#496a96', '#eaf0f8', '#a5bde0', '#2e3c50'],
  3177. purple: ['#806495', '#f0eaf5', '#c9acdf', '#403349'],
  3178. amber: ['#9a7641', '#f4efdf', '#ddc195', '#443a27'],
  3179. };
  3180. const palette = palettes[state.palette] || palettes.forest;
  3181. device.style.setProperty('--accent', palette[state.dark ? 2 : 0]);
  3182. device.style.setProperty('--tint', palette[state.dark ? 3 : 1]);
  3183. device.style.setProperty('--chat-font', `${state.font}px`);
  3184. try {
  3185. localStorage.setItem(
  3186. 'fmode_mobile_proposal_v1',
  3187. JSON.stringify({ dark: state.dark, palette: state.palette, font: state.font }),
  3188. );
  3189. } catch {}
  3190. }
  3191. function navigate(page, identifier) {
  3192. const destination =
  3193. page === 'chat'
  3194. ? `#/chat/${identifier || state.currentId}`
  3195. : page === 'agent'
  3196. ? `#/agent/${identifier}`
  3197. : `#/${page}`;
  3198. if (location.hash === destination) readRoute();
  3199. else location.hash = destination;
  3200. }
  3201. function readRoute() {
  3202. saveDraft();
  3203. const [page = 'home', identifier] = location.hash.replace(/^#\/?/, '').split('/');
  3204. state.page = ['home', 'chat', 'messages', 'contacts', 'workbench', 'mine', 'agent'].includes(page)
  3205. ? page
  3206. : 'home';
  3207. if (state.page === 'chat') {
  3208. const conversation = getConversation(identifier);
  3209. if (conversation) {
  3210. state.currentId = identifier;
  3211. conversation.unread = 0;
  3212. } else state.page = 'messages';
  3213. }
  3214. if (state.page === 'agent') state.detailAgentId = identifier;
  3215. state.keyword = '';
  3216. restoreDraft();
  3217. closeOverlay();
  3218. render();
  3219. main.scrollTop = 0;
  3220. }
  3221. function render() {
  3222. const conversation = getConversation(),
  3223. agent = getAgent(conversation?.agentId);
  3224. if (state.page === 'chat')
  3225. header.innerHTML = `${ib('menu', '打开会话侧栏', 'drawer')}<div class="header-center"><button class="header-title" data-action="edit-current-title" aria-label="编辑会话标题:${esc(conversation.title)}"><strong>${esc(conversation.title)}</strong>${icon('edit')}</button><small>${esc(agent.name)}<span class="subtitle-separator">/</span><span class="activity-text ${collaboration.get(conversation.id)?.kind || 'idle'}">${activityNames[collaboration.get(conversation.id)?.kind || 'idle']}</span></small></div>${ib('more', '会话详情', 'details')}`;
  3226. else if (state.page === 'home')
  3227. header.innerHTML = `${ib('menu', '打开会话侧栏', 'drawer')}<div class="header-brand">${icon('flower')}<strong>fmode</strong></div><button class="profile-button" data-action="navigate" data-page="mine" aria-label="我的">林</button>`;
  3228. else if (state.page === 'agent')
  3229. header.innerHTML = `${ib('back', '返回通讯录', 'navigate', 'data-page="contacts"')}<strong class="page-title">数字生命设置</strong>`;
  3230. else
  3231. header.innerHTML = `${ib('menu', '打开会话侧栏', 'drawer')}<strong class="page-title">${navItems.find(([page]) => page === state.page)?.[2]}</strong>${state.page === 'messages' ? ib('edit', '新建对话', 'new-chat') : '<span style="width:44px"></span>'}`;
  3232. ({
  3233. home: renderHome,
  3234. chat: renderChat,
  3235. messages: renderMessages,
  3236. contacts: renderContacts,
  3237. workbench: renderWorkbench,
  3238. mine: renderMine,
  3239. agent: renderAgent,
  3240. })[state.page]();
  3241. if (state.page === 'chat' && messages.get(state.currentId)?.length === 0) {
  3242. main.innerHTML = `<section class="screen blank-chat"><div class="blank-chat-mark">${icon(agent.symbol)}</div><h1>新的想法,直接说。</h1><p>正在和 ${esc(agent.name)} 对话<br />${esc(workspaces.find((workspace) => workspace.id === conversation.workspace)?.name || '日常对话')} · 不影响之前的会话</p></section>`;
  3243. }
  3244. if (state.page === 'mine')
  3245. main
  3246. .querySelector('.version-text')
  3247. .insertAdjacentHTML(
  3248. 'beforeend',
  3249. '<br /><button class="text-button" data-action="preview-states">查看加载与反馈状态 · 原型专用</button>',
  3250. );
  3251. tabbar.innerHTML = ['messages', 'contacts', 'workbench', 'mine'].includes(state.page)
  3252. ? navigation()
  3253. : '';
  3254. if (['home', 'chat'].includes(state.page)) renderComposer();
  3255. else composerArea.innerHTML = '';
  3256. document
  3257. .querySelectorAll('[data-scene]')
  3258. .forEach((button) => button.classList.toggle('active', button.dataset.scene === state.page));
  3259. applyPreferences();
  3260. }
  3261. function renderHome() {
  3262. main.innerHTML = `<section class="screen home-screen"><div class="home-hero"><div class="hero-art">${icon('flower')}</div><div class="overline">每一个想法,都值得被认真对待</div><h1>让想法,<br />再往前一步。</h1><p>写下想做的事,和你的数字生命一起完成。</p></div><div class="prompts"><button class="prompt" data-action="prompt" data-value="帮我梳理一下这周的工作安排">${icon('file')}梳理思路</button><button class="prompt" data-action="prompt" data-value="帮我写一份产品体验优化方案">${icon('edit')}写点什么</button><button class="prompt" data-action="prompt" data-value="帮我找几个官网设计的灵感方向">${icon('spark')}找点灵感</button></div><div class="recent-block"><div class="section-label"><span>接着上次的想法</span><button class="text-button" data-action="navigate" data-page="messages">全部会话 ${icon('arrow-right')}</button></div>${activeConversations()
  3263. .slice(0, 2)
  3264. .map(
  3265. (conversation) =>
  3266. `<button class="recent-row" data-action="open-chat" data-id="${conversation.id}">${icon('chat')}<span class="row-text"><strong>${esc(conversation.title)}</strong><small>${esc(getAgent(conversation.agentId).name)} · ${esc(workspaces.find((workspace) => workspace.id === conversation.workspace)?.name || '日常对话')}</small></span><time>${conversation.time}</time></button>`,
  3267. )
  3268. .join('')}</div></section>`;
  3269. }
  3270. function renderComposer() {
  3271. const agentId = state.page === 'chat' ? getConversation()?.agentId : state.agentId,
  3272. agent = agentId ? getAgent(agentId) : null;
  3273. composerArea.innerHTML = `<div class="composer"><div class="attachment-list">${state.attachments.map((file, index) => `<span class="attachment-chip">${icon('clip')}<span>${esc(file.name)}</span><button aria-label="移除附件 ${esc(file.name)}" data-action="remove-attachment" data-index="${index}">${icon('close')}</button></span>`).join('')}</div><textarea id="draft" rows="1" aria-label="输入消息" placeholder="说说你的想法…" ${state.generating ? 'disabled' : ''}>${esc(state.draft)}</textarea><div class="composer-tools">${ib('plus', '添加附件', 'attach')}<button class="agent-select" data-action="${state.page === 'home' ? 'pick-agent' : 'agent-info'}">${agent ? '<i class="dot ' + (agent.online ? '' : 'offline') + '"></i>' : icon('flower')}<span>${agent ? esc(agent.name) + ' · ' + agent.role : '选择数字生命'}</span>${state.page === 'home' ? icon('chevron') : ''}</button><button class="send-button" aria-label="${state.generating ? '发送中' : '发送消息'}" data-action="send" ${state.generating || (!state.draft.trim() && !state.attachments.length) ? 'disabled' : ''}>${state.generating ? '<span class="typing"><i></i><i></i><i></i></span>' : icon('arrow-up')}</button></div></div><div class="composer-footnote">${state.page === 'home' ? '和数字生命一起,把想法变成现实' : '内容由 AI 生成,请核实重要信息'} · 演示</div>`;
  3274. if (state.page === 'chat') {
  3275. const running = activeConversations().filter(
  3276. (conversation) => collaboration.get(conversation.id)?.kind === 'running',
  3277. ).length;
  3278. const attention = activeConversations().filter(
  3279. (conversation) => collaboration.get(conversation.id)?.kind === 'attention',
  3280. ).length;
  3281. composerArea.insertAdjacentHTML(
  3282. 'afterbegin',
  3283. `<div class="collaboration-rail"><button class="quick-current" data-action="quick-current" aria-label="在当前数字生命 ${esc(agent.name)} 中新建对话">${icon('edit')}<span>新对话</span><span class="quick-agent">· ${esc(agent.name)}</span></button><button class="activity-entry" data-action="activity" aria-label="切换协作,${running} 个进行中,${attention} 个待关注"><span class="activity-orbit ${running ? 'running' : ''}"></span><span>${running ? running + ' 个进行中' : '协作动态'}</span>${attention ? `<span class="attention-count">${attention}</span>` : ''}${icon('chevron')}</button></div>`,
  3284. );
  3285. }
  3286. const textarea = document.querySelector('#draft');
  3287. textarea.setAttribute('enterkeyhint', 'enter');
  3288. textarea.style.height = 'auto';
  3289. textarea.style.height = `${Math.min(textarea.scrollHeight, 116)}px`;
  3290. }
  3291. function conversationRow(conversation) {
  3292. const agent = getAgent(conversation.agentId);
  3293. return `<article class="conversation-row"><button class="conversation-open" data-action="open-chat" data-id="${conversation.id}">${avatar(agent)}<span class="conversation-body"><span class="conversation-top"><strong>${esc(conversation.title)}</strong><time>${conversation.time}</time></span><p>${esc(conversation.preview)}</p><span class="conversation-meta">${esc(agent.name)}${conversation.workspace ? ' · ' + esc(workspaces.find((workspace) => workspace.id === conversation.workspace)?.name || '工作区') : ''}<span class="inline-activity ${collaboration.get(conversation.id)?.kind || 'idle'}">${activityNames[collaboration.get(conversation.id)?.kind || 'idle']}</span>${conversation.unread ? `<span class="unread">${conversation.unread}</span>` : ''}</span></span></button><button class="row-more" data-action="conversation-menu" data-id="${conversation.id}" aria-label="${esc(conversation.title)} 更多操作">${icon('more')}</button></article>`;
  3294. }
  3295. function renderMessages() {
  3296. main.innerHTML = `<section class="screen"><p class="page-subtitle">每一次对话,都是想法向前的一步。</p>${searchField('搜索会话或数字生命', 'search', state.keyword)}${tabs(
  3297. [
  3298. ['all', '全部'],
  3299. ['unread', '未读'],
  3300. ['workspace', '工作区'],
  3301. ],
  3302. state.filter,
  3303. 'message-filter',
  3304. )}<div id="conversation-results">${conversationResults()}</div></section>`;
  3305. }
  3306. function conversationResults() {
  3307. const keyword = state.keyword.trim().toLowerCase(),
  3308. filtered = activeConversations().filter(
  3309. (conversation) =>
  3310. (state.filter !== 'unread' || conversation.unread > 0) &&
  3311. `${conversation.title} ${getAgent(conversation.agentId).name}`
  3312. .toLowerCase()
  3313. .includes(keyword),
  3314. );
  3315. if (state.filter === 'workspace')
  3316. return `<button class="text-button" data-action="create-workspace">${icon('plus')} 新建工作区</button>${workspaces
  3317. .map((workspace) => {
  3318. const rows = filtered.filter((conversation) => conversation.workspace === workspace.id);
  3319. if (keyword && !rows.length && !workspace.name.includes(keyword)) return '';
  3320. return `<section class="workspace"><header class="workspace-head"><button class="workspace-toggle" data-action="toggle-workspace" data-id="${workspace.id}" aria-expanded="${state.expanded.has(workspace.id)}" aria-controls="workspace-${workspace.id}">${icon(state.expanded.has(workspace.id) ? 'chevron' : 'right')}${icon('folder')} ${esc(workspace.name)}<small>${rows.length}</small></button>${ib('plus', '在 ' + workspace.name + ' 中新建对话', 'workspace-chat', `data-id="${workspace.id}"`)}${ib('more', workspace.name + ' 更多操作', 'workspace-menu', `data-id="${workspace.id}"`)}</header><div id="workspace-${workspace.id}" ${state.expanded.has(workspace.id) || keyword ? '' : 'hidden'}>${rows.length ? rows.map(conversationRow).join('') : emptyState('还没有对话', '在这里开始一个新的想法', 'chat')}</div></section>`;
  3321. })
  3322. .join('')}`;
  3323. if (!filtered.length)
  3324. return emptyState(
  3325. state.filter === 'unread' ? '未读已清空,安心专注' : '没有找到相关对话',
  3326. state.filter === 'unread' ? '新的消息会出现在这里。' : '换个关键词再试试。',
  3327. );
  3328. return ['今天', '昨天', '更早']
  3329. .map((group) => {
  3330. const rows = filtered.filter((conversation) => conversation.group === group);
  3331. return rows.length
  3332. ? `<div class="group-heading">${group}</div>${rows.map(conversationRow).join('')}`
  3333. : '';
  3334. })
  3335. .join('');
  3336. }
  3337. const sampleAnswer =
  3338. '<p>好的。第一印象不一定要做得更满,<br />而是让用户更快地感到:<strong>这里懂我。</strong></p><h2>先把这三件事做好</h2><ul><li><strong>让入口更清楚</strong><br />一个明确的主操作,比同时展示很多功能更有效。</li><li><strong>让阅读更轻松</strong><br />减少卡片边框,拉开段落间距,让内容成为主角。</li><li><strong>让操作有回应</strong><br />无论是发送、等待还是完成,都给出清晰、克制的反馈。</li></ul><blockquote>好的体验,是不用思考下一步该点哪里。</blockquote><p>我把具体建议整理成了一份文档,可以先从首页和对话页开始验证。</p>';
  3339. function sampleMessages(conversation) {
  3340. if (conversation.id === 'c1')
  3341. return [
  3342. { role: 'user', text: '我们来想想,怎么把产品的第一印象做得更好?' },
  3343. { role: 'assistant', html: sampleAnswer, file: true },
  3344. ];
  3345. return [
  3346. { role: 'user', text: conversation.title },
  3347. {
  3348. role: 'assistant',
  3349. html: `<p>${esc(conversation.preview)}</p><p>这段对话保留在「${esc(workspaces.find((workspace) => workspace.id === conversation.workspace)?.name || '日常对话')}」中,你可以接着补充想法。</p><blockquote>这是界面演示内容,不是真实的历史消息。</blockquote>`,
  3350. },
  3351. ];
  3352. }
  3353. function fileCard() {
  3354. return `<button class="file-card" data-action="preview-file"><span class="file-badge">DOC</span><span><strong>产品初体验优化建议</strong><small>DOCX · 24 KB · 已上传云盘(演示)</small></span>${icon('right')}</button>`;
  3355. }
  3356. function renderChat() {
  3357. const conversation = getConversation(),
  3358. agent = getAgent(conversation.agentId);
  3359. if (!messages.has(conversation.id)) messages.set(conversation.id, sampleMessages(conversation));
  3360. const rows = messages.get(conversation.id);
  3361. main.innerHTML = `<section class="screen chat-screen">${state.disconnected ? `<button class="connection-banner" data-action="reconnect">${icon('wifi')}连接已断开,点击重连 ${icon('right')}</button>` : ''}<div class="chat-date">今天 · 10:42</div>${rows.map((message, index) => (message.role === 'user' ? `<div class="user-message"><div class="user-bubble">${esc(message.text).replace(/\n/g, '<br />')}${message.files?.map((name) => `<span class="user-file">${icon('clip')} ${esc(name)}</span>`).join('') || ''}</div></div>` : `<article class="assistant-message"><div class="assistant-heading">${icon(agent.symbol)}<span>${esc(agent.name)}</span><time>演示回复</time></div><details class="process"><summary>${icon('check')} 已完成 ${message.file ? '3' : '2'} 个步骤 · ${message.file ? '12' : '3'} 秒 ${icon('chevron', 'chevron')}</summary><ol><li>理解需求与对话上下文</li><li>整理可执行的建议</li>${message.file ? '<li>生成文档并上传云盘</li>' : ''}</ol></details><div class="assistant-body">${message.html}</div>${message.file ? fileCard() : ''}<div class="message-actions"><button aria-label="复制回复" data-action="copy-message" data-index="${index}">${icon('copy')}</button>${message.file ? `<button aria-label="查看成果文件" data-action="details" data-tab="deliver">${icon('file')}</button>` : ''}<small>AI 生成 · 请核实</small></div></article>`)).join('')}${state.generating && state.generatingId === conversation.id ? '<div class="assistant-heading">' + icon(agent.symbol) + '正在整理你的想法</div><div class="typing" role="status" aria-label="正在生成演示回复"><i></i><i></i><i></i></div>' : ''}</section>`;
  3362. }
  3363. function renderContacts() {
  3364. main.innerHTML = `<section class="screen">${tabs(
  3365. [
  3366. ['agents', '数字生命'],
  3367. ['coworkers', '同事'],
  3368. ],
  3369. state.contactFilter,
  3370. 'contact-filter',
  3371. )}${searchField('搜索联系人', 'contact-search', state.keyword)}<div id="contact-results">${contactResults()}</div></section>`;
  3372. }
  3373. function contactResults() {
  3374. if (state.contactFilter === 'coworkers') {
  3375. const people = [
  3376. { name: '林一', role: '产品设计 · 我', initial: '林' },
  3377. { name: '陈序', role: '研发协作', initial: '陈' },
  3378. ].filter((person) => person.name.includes(state.keyword));
  3379. return people.length
  3380. ? `<div class="contact-department">产品与研发 · ${people.length} 人</div>${people.map((person) => `<div class="contact-row"><button data-action="coworker" data-name="${person.name}"><span class="avatar person">${person.initial}</span><span><strong>${person.name}</strong><small>${person.role}</small></span></button>${icon('right')}</div>`).join('')}`
  3381. : emptyState('没有找到联系人');
  3382. }
  3383. const filtered = agents.filter((agent) => `${agent.name} ${agent.role}`.includes(state.keyword));
  3384. return filtered.length
  3385. ? `<div class="section-label"><span>我的数字伙伴</span><span>${filtered.length} 位</span></div>${filtered.map((agent) => `<div class="contact-row"><button data-action="open-agent" data-id="${agent.id}">${avatar(agent)}<span><strong>${esc(agent.name)}</strong><small>${agent.role} · ${agent.online ? '在线' : '离线'}</small></span></button>${icon('right')}</div>`).join('')}`
  3386. : emptyState('没有找到数字生命');
  3387. }
  3388. function renderWorkbench() {
  3389. main.innerHTML = `<section class="screen"><p class="page-subtitle">伙伴们的工作状态,一眼就知道。</p><div class="overview"><div><strong>3</strong><small>数字生命</small></div><div><strong>2<span style="font-size:12px"> / 3</span></strong><small>在线</small></div><div><strong>1</strong><small>离线</small></div></div>${tabs(
  3390. [
  3391. ['all', '全部'],
  3392. ['online', '在线'],
  3393. ['offline', '离线'],
  3394. ],
  3395. state.agentFilter,
  3396. 'agent-filter',
  3397. )}${searchField('搜索数字生命', 'agent-search', state.keyword)}<div id="agent-results">${agentResults()}</div></section>`;
  3398. }
  3399. function agentResults() {
  3400. const filtered = agents.filter(
  3401. (agent) =>
  3402. agent.name.includes(state.keyword) &&
  3403. (state.agentFilter === 'all' || agent.online === (state.agentFilter === 'online')),
  3404. );
  3405. return filtered.length
  3406. ? filtered
  3407. .map(
  3408. (agent) =>
  3409. `<article class="agent-card"><div class="agent-card-head">${avatar(agent)}<div><h2>${esc(agent.name)}</h2><small>${agent.role}</small></div><span class="tag ${agent.online ? '' : 'offline'}">${agent.online ? '在线' : '离线'}</span></div><p class="agent-current">${agent.task}</p><div class="agent-metrics"><span>CPU <b>${agent.cpu}</b></span><span>内存 <b>${agent.memory}</b></span><span>余额 <b>¥${agent.balance}</b></span></div><div class="agent-actions"><button data-action="channels" data-id="${agent.id}">${icon('link')}通道</button><button data-action="recharge" data-id="${agent.id}">${icon('wallet')}充值</button><button data-action="agent-chat" data-id="${agent.id}">进入会话 ${icon('arrow-right')}</button></div></article>`,
  3410. )
  3411. .join('')
  3412. : emptyState('没有匹配的数字生命');
  3413. }
  3414. function renderMine() {
  3415. main.innerHTML = `<section class="screen"><div class="profile-card"><span class="avatar">林</span><div><h2>林一</h2><p>fmode 体验空间 · 演示账号</p></div></div><section class="settings-group"><h2>外观与阅读</h2><div class="palette-row">${[
  3416. ['forest', '#386b52', '森林'],
  3417. ['blue', '#496a96', '湖蓝'],
  3418. ['purple', '#806495', '暮紫'],
  3419. ['amber', '#9a7641', '暖砂'],
  3420. ]
  3421. .map(
  3422. ([value, color, label]) =>
  3423. `<button class="palette-option ${state.palette === value ? 'active' : ''}" style="--swatch:${color}" aria-label="${label}配色" aria-pressed="${state.palette === value}" data-action="palette" data-value="${value}"><span></span></button>`,
  3424. )
  3425. .join(
  3426. '',
  3427. )}</div><button class="settings-row" data-action="theme" role="switch" aria-checked="${state.dark}">${icon('moon')}深色模式<span class="toggle ${state.dark ? 'on' : ''}"></span></button><button class="settings-row" data-action="font">${icon('file')}对话正文字号<small>${state.font === 14 ? '标准' : state.font === 16 ? '较大' : '大号'}</small>${icon('right')}</button></section><section class="settings-group"><h2>账号与通知</h2><button class="settings-row" data-action="token">${icon('key')}访问 Token<small>仅演示占位</small>${icon('right')}</button><button class="settings-row" data-action="notifications">${icon('bell')}消息与任务通知<small>权限说明</small>${icon('right')}</button><button class="settings-row danger" data-action="logout">${icon('logout')}退出登录${icon('right')}</button></section><div class="version-text">fmode · 人机共生中枢<br />Mobile experience / 01 · 独立体验提案</div></section>`;
  3428. }
  3429. function renderAgent() {
  3430. const agent = getAgent(state.detailAgentId);
  3431. main.innerHTML = `<section class="screen"><div class="profile-card">${avatar(agent)}<div><h2>${esc(agent.name)}</h2><p>${agent.role}</p></div></div><section class="settings-group"><h2>容器设置</h2><button class="settings-row" data-action="rename-agent" data-id="${agent.id}">显示名称<small>${esc(agent.name)}</small>${icon('right')}</button><div class="settings-row">连接状态<small>${agent.online ? '在线' : '离线'}</small></div></section><p class="page-subtitle">沿用现有通讯录逻辑:数字生命详情只提供重命名。</p></section>`;
  3432. }
  3433. function openOverlay(html) {
  3434. if (!overlay.childElementCount) returnFocus = document.activeElement;
  3435. overlay.innerHTML = html;
  3436. app.inert = true;
  3437. requestAnimationFrame(() => {
  3438. const target = overlay.querySelector('[autofocus]') || overlay.querySelector('button,input,select,summary');
  3439. target?.focus({ preventScroll: true });
  3440. });
  3441. }
  3442. function closeOverlay() {
  3443. const wasOpen = overlay.childElementCount > 0;
  3444. overlay.innerHTML = '';
  3445. app.inert = false;
  3446. state.pendingSend = false;
  3447. if (wasOpen && returnFocus?.isConnected) returnFocus.focus({ preventScroll: true });
  3448. }
  3449. function sheet(title, content, extra = '') {
  3450. openOverlay(
  3451. `<div class="backdrop" data-action="close" aria-hidden="true"></div><section class="sheet" role="dialog" aria-modal="true" aria-labelledby="sheet-title"><div class="sheet-handle" aria-hidden="true"></div><header class="sheet-header"><h2 id="sheet-title">${title}</h2>${ib('close', '关闭面板', 'close')}</header>${extra}<div class="sheet-body">${content}</div></section>`,
  3452. );
  3453. }
  3454. function drawerHistory(keyword = '') {
  3455. if (state.drawerView === 'recent') {
  3456. const recent = activeConversations().filter((conversation) =>
  3457. `${conversation.title} ${getAgent(conversation.agentId).name} ${workspaces.find((workspace) => workspace.id === conversation.workspace)?.name || ''}`.includes(
  3458. keyword,
  3459. ),
  3460. );
  3461. return `<div class="group-heading">最近的协作<span>${recent.length} 段对话</span></div>${recent.map((conversation) => drawerConversation(conversation)).join('') || emptyState('没有找到对话', '换个关键词再试试。')}`;
  3462. }
  3463. if (state.drawerView === 'agents') {
  3464. return (
  3465. agents
  3466. .map((agent) => {
  3467. const rows = activeConversations().filter(
  3468. (conversation) =>
  3469. conversation.agentId === agent.id &&
  3470. `${conversation.title} ${agent.name}`.includes(keyword),
  3471. );
  3472. if (!rows.length) return '';
  3473. const running = rows.filter(
  3474. (conversation) => collaboration.get(conversation.id)?.kind === 'running',
  3475. ).length;
  3476. return `<section class="drawer-agent-group"><div class="drawer-agent-head">${avatar(agent)}<span><strong>${esc(agent.name)}</strong><small>${agent.role}</small></span>${running ? `<span class="inline-activity running">${running} 进行中</span>` : `<small>${rows.length} 段对话</small>`}<button class="drawer-agent-new" data-action="agent-new" data-id="${agent.id}" aria-label="在 ${esc(agent.name)} 中新建对话">${icon('plus')}</button></div>${rows.map((conversation) => drawerConversation(conversation)).join('')}</section>`;
  3477. })
  3478. .join('') || emptyState('没有找到对话')
  3479. );
  3480. }
  3481. const matches = (conversation) =>
  3482. `${conversation.title} ${getAgent(conversation.agentId).name}`.includes(keyword),
  3483. row = (conversation) =>
  3484. `<button class="drawer-history ${state.page === 'chat' && state.currentId === conversation.id ? 'active' : ''}" data-action="open-chat" data-id="${conversation.id}">${icon('chat')}<span>${esc(conversation.title)}</span></button>`;
  3485. return `${workspaces
  3486. .map(
  3487. (workspace) =>
  3488. `<div class="workspace-head"><button class="workspace-toggle" data-action="drawer-workspace" data-id="${workspace.id}" aria-expanded="${state.drawerExpanded.has(workspace.id)}">${icon(state.drawerExpanded.has(workspace.id) ? 'chevron' : 'right')}${icon('folder')}${esc(workspace.name)}</button>${ib('more', workspace.name + ' 更多操作', 'workspace-menu', `data-id="${workspace.id}"`)}</div>${
  3489. state.drawerExpanded.has(workspace.id) || keyword
  3490. ? activeConversations()
  3491. .filter(
  3492. (conversation) =>
  3493. conversation.workspace === workspace.id && matches(conversation),
  3494. )
  3495. .map(row)
  3496. .join('')
  3497. : ''
  3498. }`,
  3499. )
  3500. .join(
  3501. '',
  3502. )}<button class="text-button" data-action="create-workspace">${icon('plus')} 新建工作区</button><div class="group-heading">日常对话</div>${
  3503. activeConversations()
  3504. .filter((conversation) => !conversation.workspace && matches(conversation))
  3505. .map(row)
  3506. .join('') || '<p class="sheet-description">暂无匹配对话</p>'
  3507. }<button class="drawer-history" data-action="show-archived">${icon('archive')}已归档 <span style="margin-left:auto">${conversations.filter((conversation) => conversation.archived).length}</span></button>`;
  3508. }
  3509. function openDrawer() {
  3510. openOverlay(
  3511. `<div class="backdrop" data-action="close" aria-hidden="true"></div><aside class="drawer" role="dialog" aria-modal="true" aria-label="会话与导航"><div class="drawer-header"><div class="header-brand">${icon('flower')}<strong>fmode</strong></div>${ib('close', '关闭侧栏', 'close')}</div><button class="primary-button" data-action="new-chat">${icon('plus')}新建对话</button>${searchField('搜索历史对话', 'drawer-search')}<div class="drawer-scroll" id="drawer-results">${drawerHistory()}</div><nav class="drawer-nav" aria-label="侧栏导航">${navigation()}</nav><div class="drawer-bottom">林一 · 体验空间 / 演示</div></aside>`,
  3512. );
  3513. overlay.querySelector('.search-field').insertAdjacentHTML(
  3514. 'afterend',
  3515. tabs(
  3516. [
  3517. ['recent', '最近'],
  3518. ['agents', '数字生命'],
  3519. ['workspace', '工作区'],
  3520. ],
  3521. state.drawerView,
  3522. 'drawer-view',
  3523. ),
  3524. );
  3525. overlay
  3526. .querySelector('.drawer-scroll')
  3527. .insertAdjacentHTML(
  3528. 'afterend',
  3529. '<button class="drawer-archive" data-action="show-archived">' +
  3530. icon('archive') +
  3531. '已归档对话' +
  3532. icon('right') +
  3533. '</button>',
  3534. );
  3535. }
  3536. function pickAgent(pending = false) {
  3537. sheet(
  3538. '和谁一起开始?',
  3539. `<p class="sheet-description">选择数字生命,草稿和附件会一并保留。</p>${agents.map((agent) => `<button class="sheet-list-button" data-action="choose-agent" data-id="${agent.id}">${avatar(agent)}<span>${esc(agent.name)}<small>${agent.role} · ${agent.online ? '在线' : '离线'}</small></span>${state.agentId === agent.id ? icon('check', 'selected-check') : icon('right')}</button>`).join('')}<p class="sheet-description" style="margin-top:18px">保留「先选择数字生命,再建立会话」的现有流程。</p>`,
  3540. );
  3541. state.pendingSend = pending;
  3542. }
  3543. function details(tab = 'task') {
  3544. const agent = getAgent(getConversation().agentId),
  3545. content = {
  3546. task: `<p class="sheet-description">当前会话中的任务,不新增全局任务入口。</p><div class="sheet-item"><span class="tag">已完成</span><strong>产品初体验优化建议</strong><p>分析首页与对话页的体验问题,整理可执行的改进方向。</p><p>3 / 3 步骤完成 · ${esc(agent.name)}</p></div>`,
  3547. file: `${fileCard()}<p class="sheet-description">演示文件内容为静态预览,不会上传或读取云盘。</p>`,
  3548. deliver: `<div class="sheet-item"><span class="tag">v1.0</span><strong>产品初体验优化建议</strong><p>今天 10:42 · ${esc(agent.name)} 已交付</p>${fileCard()}</div>`,
  3549. state: `<div class="sheet-item"><strong>数字生命</strong><p>${esc(agent.name)} · ${agent.online ? '在线' : '离线'}</p></div><div class="sheet-item"><strong>会话连接</strong><p>${state.disconnected ? '连接中断,等待重连' : '已连接 · 当前没有待发送消息'}</p></div><p class="sheet-description" style="margin-top:18px">原型状态演示(不影响实际服务)</p><div class="state-chips"><button data-action="disconnect">模拟断线</button><button data-action="reconnect">恢复连接</button></div>`,
  3550. };
  3551. if (state.currentId !== 'c1' && tab !== 'state')
  3552. content[tab] = emptyState(
  3553. tab === 'task' ? '还没有任务' : tab === 'file' ? '还没有文件' : '还没有成果',
  3554. '这段对话中的内容会显示在这里。',
  3555. tab === 'task' ? 'check' : 'file',
  3556. );
  3557. sheet(
  3558. '会话详情',
  3559. content[tab] || content.task,
  3560. tabs(
  3561. [
  3562. ['task', '任务'],
  3563. ['file', '文件'],
  3564. ['deliver', '成果'],
  3565. ['state', '状态'],
  3566. ],
  3567. tab,
  3568. 'detail-tab',
  3569. ),
  3570. );
  3571. }
  3572. function previewFile() {
  3573. sheet(
  3574. '文档预览',
  3575. `<p class="sheet-description">产品初体验优化建议.docx · 演示内容</p><article class="preview-document"><div class="eyebrow">FMODE / EXPERIENCE NOTE</div><h1>把第一印象做好</h1><p>一份围绕移动端的体验优化建议<br />2026.11.16 / v1.0</p><h2>01 · 让入口更清楚</h2><p>保留熟悉的导航,用明确的主操作降低理解成本。</p><h2>02 · 让内容回到中心</h2><p>减少无效的视觉容器,用段落、留白与字重建立信息层级。</p><table><thead><tr><th>页面</th><th>体验方向</th></tr></thead><tbody><tr><td>新建对话</td><td>一个输入框,开始协作</td></tr><tr><td>会话详情</td><td>正文优先,过程折叠</td></tr><tr><td>会话列表</td><td>搜索、分组与清晰状态</td></tr></tbody></table><h2>03 · 每次操作都有回应</h2><p>发送、加载、离线和失败状态清晰可见,操作始终可恢复。</p></article><button class="primary-button" data-action="download-demo">${icon('download')}下载演示文稿(TXT)</button><button class="text-button" data-action="details" data-tab="file">${icon('back')}返回会话文件</button>`,
  3576. );
  3577. }
  3578. function formSheet(title, label, value, submitAction, identifier = '') {
  3579. sheet(
  3580. title,
  3581. `<form class="sheet-form" data-form="${submitAction}" data-id="${identifier}"><label for="form-value">${label}</label><input id="form-value" name="value" maxlength="60" value="${esc(value)}" autocomplete="off" autofocus required /><p class="form-error" role="alert"></p><button class="primary-button" type="submit">保存</button></form>`,
  3582. );
  3583. }
  3584. function confirmation(title, description, action, identifier) {
  3585. sheet(
  3586. title,
  3587. `<p class="sheet-description">${description}</p><div class="button-row"><button class="secondary-button" data-action="close">取消</button><button class="secondary-button danger" data-action="${action}" data-id="${identifier || ''}">确认${title.replace('?', '')}</button></div>`,
  3588. );
  3589. }
  3590. function conversationMenu(identifier) {
  3591. const conversation = getConversation(identifier);
  3592. sheet(
  3593. '管理这段对话',
  3594. `<p class="sheet-description">${esc(conversation.title)}</p><button class="sheet-list-button" data-action="rename-conversation" data-id="${identifier}">${icon('edit')}重命名</button><button class="sheet-list-button" data-action="move-conversation" data-id="${identifier}">${icon('folder')}移动到工作区</button><button class="sheet-list-button" data-action="archive-conversation" data-id="${identifier}">${icon('archive')}${conversation.archived ? '取消归档' : '归档对话'}</button><button class="sheet-list-button danger" data-action="delete-conversation" data-id="${identifier}">${icon('trash')}删除对话</button>`,
  3595. );
  3596. }
  3597. function drawerConversation(conversation) {
  3598. const status = collaboration.get(conversation.id)?.kind || 'idle';
  3599. const workspace =
  3600. workspaces.find((item) => item.id === conversation.workspace)?.name || '日常对话';
  3601. return `<button class="drawer-conversation ${state.page === 'chat' && state.currentId === conversation.id ? 'active' : ''}" data-action="open-chat" data-id="${conversation.id}"><span class="drawer-conversation-title">${esc(conversation.title)}<span class="mini-state ${status}" aria-label="${activityNames[status]}">${status === 'done' ? icon('check') : status === 'attention' ? '!' : ''}</span></span><small>${state.drawerView === 'agents' ? '' : esc(getAgent(conversation.agentId).name) + ' · '}${esc(workspace)}</small></button>`;
  3602. }
  3603. function activityResults() {
  3604. const rows = activeConversations().filter((conversation) => {
  3605. const status = collaboration.get(conversation.id)?.kind;
  3606. return (
  3607. status &&
  3608. status !== 'idle' &&
  3609. (state.activityFilter === 'all' || status === state.activityFilter) &&
  3610. `${conversation.title} ${getAgent(conversation.agentId).name}`.includes(state.activityKeyword)
  3611. );
  3612. });
  3613. return (
  3614. ['running', 'attention', 'done']
  3615. .map((kind) => {
  3616. const group = rows.filter(
  3617. (conversation) => collaboration.get(conversation.id)?.kind === kind,
  3618. );
  3619. if (!group.length) return '';
  3620. return `<div class="activity-group-label"><span class="inline-activity ${kind}">${activityNames[kind]}</span><span>${group.length}</span></div>${group
  3621. .map((conversation) => {
  3622. const activity = collaboration.get(conversation.id);
  3623. const agent = getAgent(conversation.agentId);
  3624. const workspace =
  3625. workspaces.find((item) => item.id === conversation.workspace)?.name || '日常对话';
  3626. return `<button class="activity-card ${kind} ${conversation.id === state.currentId ? 'current' : ''}" data-action="activity-open" data-id="${conversation.id}"><span class="activity-card-avatar">${avatar(agent)}<span class="mini-state ${kind}">${kind === 'done' ? icon('check') : kind === 'attention' ? '!' : ''}</span></span><span class="activity-card-content"><strong>${esc(conversation.title)}</strong><small>${esc(agent.name)} · ${esc(workspace)}</small><span class="activity-detail">${esc(activity.label)}</span></span><span class="activity-card-end">${conversation.id === state.currentId ? '<em>当前</em>' : icon('right')}<small>${activity.elapsed}</small></span></button>`;
  3627. })
  3628. .join('')}`;
  3629. })
  3630. .join('') || emptyState('这里暂时没有协作动态', '切换筛选,看看其他会话。', 'check')
  3631. );
  3632. }
  3633. function openActivity() {
  3634. const count = (kind) =>
  3635. activeConversations().filter(
  3636. (conversation) => collaboration.get(conversation.id)?.kind === kind,
  3637. ).length;
  3638. sheet(
  3639. '切换协作',
  3640. `<p class="sheet-description">不用退出对话,也能知道每件事的进展。</p>${searchField('搜索正在协作的事', 'activity-search', state.activityKeyword)}${tabs(
  3641. [
  3642. ['all', '全部'],
  3643. ['running', '进行中 ' + count('running')],
  3644. ['attention', '待关注 ' + count('attention')],
  3645. ['done', '已完成 ' + count('done')],
  3646. ],
  3647. state.activityFilter,
  3648. 'activity-filter',
  3649. )}<div id="activity-results">${activityResults()}</div><div class="activity-sheet-footer"><span>会话状态演示 · 不等于数字生命在线状态</span><button data-action="complete-demo">模拟完成提醒</button></div>`,
  3650. );
  3651. overlay.querySelector('.sheet').classList.add('activity-sheet');
  3652. }
  3653. function quickCurrent() {
  3654. if (state.generating) {
  3655. toast('演示回复完成后即可新建');
  3656. return;
  3657. }
  3658. const previous = getConversation();
  3659. saveDraft();
  3660. const identifier = `c${Date.now()}`;
  3661. conversations.unshift({
  3662. id: identifier,
  3663. title: '新对话',
  3664. agentId: previous.agentId,
  3665. preview: '等待你的第一个想法',
  3666. time: '刚刚',
  3667. group: '今天',
  3668. workspace: previous.workspace,
  3669. unread: 0,
  3670. archived: false,
  3671. });
  3672. collaboration.set(identifier, { kind: 'idle', label: '等待新的想法', elapsed: '空闲' });
  3673. messages.set(identifier, []);
  3674. navigate('chat', identifier);
  3675. toast('已在 ' + getAgent(previous.agentId).name + ' 中新建,原对话草稿已保留');
  3676. }
  3677. function editCurrentTitle() {
  3678. const conversation = getConversation();
  3679. formSheet(
  3680. '给这段对话起个名字',
  3681. '会话标题',
  3682. conversation.title,
  3683. 'rename-conversation',
  3684. conversation.id,
  3685. );
  3686. const form = overlay.querySelector('form');
  3687. form.insertAdjacentHTML(
  3688. 'beforeend',
  3689. `<button class="regenerate-title" type="button" data-action="regenerate-title">${icon('spark')}生成一个候选标题<span>演示</span></button><p class="title-protection">${icon('shield')}只有点保存才会更新。手动标题不会被自动覆盖。</p>`,
  3690. );
  3691. }
  3692. function previewListState(mode) {
  3693. saveDraft();
  3694. state.page = 'messages';
  3695. state.keyword = '';
  3696. history.pushState(null, '', '#/messages');
  3697. closeOverlay();
  3698. render();
  3699. const results = document.querySelector('#conversation-results');
  3700. if (mode === 'loading') {
  3701. results.innerHTML = `<div class="skeleton-list" role="status" aria-label="正在加载会话" aria-busy="true">${Array.from({ length: 5 }, () => '<div class="skeleton-row"><span></span><div><i></i><i></i></div></div>').join('')}</div>`;
  3702. setTimeout(() => {
  3703. if (results.isConnected) results.innerHTML = conversationResults();
  3704. }, 1800);
  3705. } else if (mode === 'error') {
  3706. results.innerHTML =
  3707. emptyState('暂时没连上,不是消息丢了', '网络恢复后可以重试,草稿仍然保留。', 'wifi') +
  3708. '<button class="primary-button" data-action="retry-list">重新加载</button>';
  3709. } else
  3710. results.innerHTML =
  3711. emptyState('还没有对话,从一个想法开始', '选择熟悉的数字生命,开始你的第一次协作。', 'chat') +
  3712. '<button class="primary-button" data-action="new-chat">开始新对话</button>';
  3713. }
  3714. function completeDemo() {
  3715. const conversation = getConversation('c4');
  3716. if (!conversation) {
  3717. toast('这条演示会话已删除,刷新可恢复');
  3718. return;
  3719. }
  3720. const activity = collaboration.get(conversation.id);
  3721. if (activity?.kind === 'done') {
  3722. toast('该协作已完成,可在「已完成」中查看');
  3723. return;
  3724. }
  3725. collaboration.set(conversation.id, {
  3726. kind: 'done',
  3727. label: '接口检查已完成,结果已整理',
  3728. elapsed: '刚刚完成',
  3729. });
  3730. conversation.unread = 1;
  3731. closeOverlay();
  3732. render();
  3733. document.querySelector('#completion-banner')?.remove();
  3734. document
  3735. .querySelector('#device')
  3736. .insertAdjacentHTML(
  3737. 'beforeend',
  3738. `<div class="completion-banner" id="completion-banner" role="status"><span class="completion-mark">${icon('check')}</span><button data-action="completion-open" data-id="${conversation.id}"><strong>阿澈的接口检查完成了</strong><small>结果已整理好,点这里接着看 · 演示</small></button><button data-action="dismiss-completion" aria-label="关闭完成提醒">${icon('close')}</button></div>`,
  3739. );
  3740. }
  3741. function send() {
  3742. if (state.generating || (!state.draft.trim() && !state.attachments.length)) return;
  3743. if (state.disconnected && state.page === 'chat') {
  3744. toast('连接已断开,请先重连;草稿已保留');
  3745. return;
  3746. }
  3747. if (state.page === 'home' && !state.agentId) {
  3748. pickAgent(true);
  3749. return;
  3750. }
  3751. if (state.page === 'home') {
  3752. drafts.delete('home');
  3753. const identifier = `c${Date.now()}`;
  3754. conversations.unshift({
  3755. id: identifier,
  3756. title: state.draft.trim().slice(0, 18) || '附件对话',
  3757. agentId: state.agentId,
  3758. preview: '正在整理你的想法…',
  3759. time: '刚刚',
  3760. group: '今天',
  3761. workspace: state.newWorkspace,
  3762. unread: 0,
  3763. archived: false,
  3764. });
  3765. messages.set(identifier, []);
  3766. state.currentId = identifier;
  3767. state.newWorkspace = null;
  3768. state.page = 'chat';
  3769. history.pushState(null, '', `#/chat/${identifier}`);
  3770. }
  3771. const conversation = getConversation(),
  3772. rows = messages.get(conversation.id) || sampleMessages(conversation),
  3773. question = state.draft.trim(),
  3774. files = state.attachments.map((file) => file.name);
  3775. rows.push({ role: 'user', text: question || '请查看我添加的附件', files });
  3776. if (conversation.title === '新对话' && !conversation.manuallyNamed)
  3777. conversation.title = (question || '附件对话').slice(0, 18);
  3778. collaboration.set(conversation.id, {
  3779. kind: 'running',
  3780. label: '正在处理你的消息',
  3781. elapsed: '刚刚开始',
  3782. });
  3783. messages.set(conversation.id, rows);
  3784. state.draft = '';
  3785. state.attachments = [];
  3786. drafts.delete(conversation.id);
  3787. state.generating = true;
  3788. state.generatingId = conversation.id;
  3789. render();
  3790. main.scrollTop = main.scrollHeight;
  3791. clearTimeout(generationTimer);
  3792. generationTimer = setTimeout(() => {
  3793. rows.push({
  3794. role: 'assistant',
  3795. html: `<p>收到,我们就从「<strong>${esc(question || '这份附件')}</strong>」开始。</p><p>我会先把目标、已有信息和下一步梳理清楚,再一起把它变成可执行的行动。</p><blockquote>这是一条本地模拟回复,仅用于体验发送、等待和阅读的完整流程${files.length ? ';附件只展示文件名,未读取或上传' : ''}。</blockquote>`,
  3796. });
  3797. conversation.preview = '已整理好思路,可以继续讨论。';
  3798. collaboration.set(conversation.id, {
  3799. kind: 'done',
  3800. label: '演示回复已完成',
  3801. elapsed: '刚刚完成',
  3802. });
  3803. state.generating = false;
  3804. if (state.page === 'chat' && state.currentId === conversation.id) {
  3805. render();
  3806. main.scrollTop = main.scrollHeight;
  3807. } else if (['home', 'messages'].includes(state.page)) render();
  3808. }, 1100);
  3809. }
  3810. function toast(message) {
  3811. const element = document.querySelector('#toast');
  3812. element.textContent = message;
  3813. element.classList.add('visible');
  3814. clearTimeout(toastTimer);
  3815. toastTimer = setTimeout(() => element.classList.remove('visible'), 2700);
  3816. }
  3817. async function copyText(text) {
  3818. try {
  3819. await navigator.clipboard.writeText(text);
  3820. toast('已复制');
  3821. } catch {
  3822. toast('浏览器未开放剪贴板权限,请手动选择内容复制');
  3823. }
  3824. }
  3825. function downloadDemo() {
  3826. const content =
  3827. '产品初体验优化建议(演示文稿)\n\n01 让入口更清楚\n保留现有导航与功能,突出主操作。\n\n02 让阅读更轻松\n减少厚重卡片,扩大段落留白。\n\n03 让操作有回应\n清晰呈现加载、断线与错误状态。\n\n本文件为独立 HTML 原型的演示文稿,并非真实云盘文件。',
  3828. url = URL.createObjectURL(new Blob([content], { type: 'text/plain;charset=utf-8' })),
  3829. link = document.createElement('a');
  3830. link.href = url;
  3831. link.download = '产品初体验优化建议-演示.txt';
  3832. link.click();
  3833. setTimeout(() => URL.revokeObjectURL(url), 1000);
  3834. toast('演示文稿已下载,不是实际 DOCX 文件');
  3835. }
  3836. function showArchived() {
  3837. sheet(
  3838. '已归档对话',
  3839. conversations
  3840. .filter((conversation) => conversation.archived)
  3841. .map(conversationRow)
  3842. .join('') || emptyState('没有归档对话', '归档的对话会保留在这里。', 'archive'),
  3843. );
  3844. }
  3845. function newChat(workspace = null, agentId = null) {
  3846. if (state.generating) {
  3847. toast('演示回复完成后即可新建对话');
  3848. return;
  3849. }
  3850. state.agentId = agentId;
  3851. state.newWorkspace = workspace;
  3852. navigate('home');
  3853. }
  3854. const actions = {
  3855. 'preview-states': () =>
  3856. sheet(
  3857. '加载与反馈状态',
  3858. '<p class="sheet-description">仅切换演示视图,不改变真实数据或权限。</p><button class="sheet-list-button" data-action="list-state" data-value="loading">' +
  3859. icon('more') +
  3860. '加载骨架屏</button><button class="sheet-list-button" data-action="list-state" data-value="empty">' +
  3861. icon('chat') +
  3862. '首次使用空态</button><button class="sheet-list-button" data-action="list-state" data-value="error">' +
  3863. icon('wifi') +
  3864. '断网与重试</button>',
  3865. ),
  3866. 'list-state': (button) => previewListState(button.dataset.value),
  3867. 'retry-list': renderMessages,
  3868. activity: openActivity,
  3869. 'activity-filter': (button) => {
  3870. state.activityFilter = button.dataset.value;
  3871. openActivity();
  3872. },
  3873. 'activity-open': (button) => {
  3874. closeOverlay();
  3875. navigate('chat', button.dataset.id);
  3876. requestAnimationFrame(() => {
  3877. main.scrollTop = main.scrollHeight;
  3878. });
  3879. },
  3880. 'drawer-view': (button) => {
  3881. state.drawerView = button.dataset.value;
  3882. openDrawer();
  3883. },
  3884. 'quick-current': quickCurrent,
  3885. 'agent-new': (button) => {
  3886. newChat(null, button.dataset.id);
  3887. toast('已选中 ' + getAgent(button.dataset.id).name + ',不用再次选择');
  3888. },
  3889. 'edit-current-title': editCurrentTitle,
  3890. 'regenerate-title': () => {
  3891. const conversation = getConversation();
  3892. const rows = messages.get(conversation.id) || [];
  3893. const question = [...rows].reverse().find((message) => message.role === 'user')?.text;
  3894. overlay.querySelector('#form-value').value =
  3895. conversation.id === 'c1'
  3896. ? '移动端第一印象与体验优化'
  3897. : (question || conversation.title).slice(0, 22);
  3898. toast('候选标题已填入,保存后才会更新;未调用 AI');
  3899. },
  3900. 'complete-demo': completeDemo,
  3901. 'dismiss-completion': () => document.querySelector('#completion-banner')?.remove(),
  3902. 'completion-open': (button) => {
  3903. document.querySelector('#completion-banner')?.remove();
  3904. navigate('chat', button.dataset.id);
  3905. requestAnimationFrame(() => {
  3906. main.scrollTop = main.scrollHeight;
  3907. });
  3908. },
  3909. navigate: (button) => navigate(button.dataset.page),
  3910. drawer: openDrawer,
  3911. close: closeOverlay,
  3912. 'new-chat': () => newChat(),
  3913. 'open-chat': (button) => navigate('chat', button.dataset.id),
  3914. 'pick-agent': () => pickAgent(false),
  3915. 'choose-agent': (button) => {
  3916. const pending = state.pendingSend;
  3917. state.agentId = button.dataset.id;
  3918. closeOverlay();
  3919. renderComposer();
  3920. if (pending) send();
  3921. },
  3922. 'agent-info': () => {
  3923. const agent = getAgent(getConversation().agentId);
  3924. sheet(
  3925. '当前数字生命',
  3926. `<div class="profile-card">${avatar(agent)}<div><h2>${esc(agent.name)}</h2><p>${agent.role} · ${agent.online ? '在线' : '离线'}</p></div></div><p class="sheet-description">当前会话固定关联该数字生命。如需更换,请新建对话。</p>`,
  3927. );
  3928. },
  3929. prompt: (button) => {
  3930. state.draft = button.dataset.value;
  3931. renderComposer();
  3932. document.querySelector('#draft').focus();
  3933. },
  3934. send,
  3935. attach: () => {
  3936. if (state.generating) return;
  3937. document.querySelector('#file-input').click();
  3938. },
  3939. 'remove-attachment': (button) => {
  3940. state.attachments.splice(Number(button.dataset.index), 1);
  3941. renderComposer();
  3942. },
  3943. 'message-filter': (button) => {
  3944. state.filter = button.dataset.value;
  3945. renderMessages();
  3946. },
  3947. 'contact-filter': (button) => {
  3948. state.contactFilter = button.dataset.value;
  3949. state.keyword = '';
  3950. renderContacts();
  3951. },
  3952. 'agent-filter': (button) => {
  3953. state.agentFilter = button.dataset.value;
  3954. renderWorkbench();
  3955. },
  3956. 'toggle-workspace': (button) => {
  3957. state.expanded.has(button.dataset.id)
  3958. ? state.expanded.delete(button.dataset.id)
  3959. : state.expanded.add(button.dataset.id);
  3960. document.querySelector('#conversation-results').innerHTML = conversationResults();
  3961. },
  3962. 'drawer-workspace': (button) => {
  3963. state.drawerExpanded.has(button.dataset.id)
  3964. ? state.drawerExpanded.delete(button.dataset.id)
  3965. : state.drawerExpanded.add(button.dataset.id);
  3966. document.querySelector('#drawer-results').innerHTML = drawerHistory(
  3967. document.querySelector('[data-input="drawer-search"]').value,
  3968. );
  3969. },
  3970. 'workspace-chat': (button) => newChat(button.dataset.id),
  3971. 'create-workspace': () =>
  3972. formSheet('新建工作区', '工作区名称(最多 24 字)', '', 'create-workspace'),
  3973. 'workspace-menu': (button) => {
  3974. const workspace = workspaces.find((item) => item.id === button.dataset.id);
  3975. sheet(
  3976. esc(workspace.name),
  3977. `<button class="sheet-list-button" data-action="rename-workspace" data-id="${workspace.id}">${icon('edit')}重命名工作区</button><button class="sheet-list-button danger" data-action="delete-workspace" data-id="${workspace.id}">${icon('trash')}删除工作区</button>`,
  3978. );
  3979. },
  3980. 'rename-workspace': (button) =>
  3981. formSheet(
  3982. '重命名工作区',
  3983. '工作区名称(最多 24 字)',
  3984. workspaces.find((workspace) => workspace.id === button.dataset.id).name,
  3985. 'rename-workspace',
  3986. button.dataset.id,
  3987. ),
  3988. 'delete-workspace': (button) =>
  3989. confirmation(
  3990. '删除工作区?',
  3991. '其中的会话会移到「日常对话」,不会被删除。此操作只影响演示数据。',
  3992. 'confirm-delete-workspace',
  3993. button.dataset.id,
  3994. ),
  3995. 'confirm-delete-workspace': (button) => {
  3996. conversations.forEach((conversation) => {
  3997. if (conversation.workspace === button.dataset.id) conversation.workspace = null;
  3998. });
  3999. workspaces = workspaces.filter((workspace) => workspace.id !== button.dataset.id);
  4000. if (state.newWorkspace === button.dataset.id) state.newWorkspace = null;
  4001. closeOverlay();
  4002. render();
  4003. toast('工作区已删除,会话已移到日常对话');
  4004. },
  4005. 'conversation-menu': (button) => conversationMenu(button.dataset.id),
  4006. 'rename-conversation': (button) =>
  4007. formSheet(
  4008. '重命名对话',
  4009. '对话名称',
  4010. getConversation(button.dataset.id).title,
  4011. 'rename-conversation',
  4012. button.dataset.id,
  4013. ),
  4014. 'move-conversation': (button) =>
  4015. sheet(
  4016. '移动到工作区',
  4017. `<button class="sheet-list-button" data-action="choose-workspace" data-id="${button.dataset.id}" data-workspace="">${icon('chat')}日常对话</button>${workspaces.map((workspace) => `<button class="sheet-list-button" data-action="choose-workspace" data-id="${button.dataset.id}" data-workspace="${workspace.id}">${icon('folder')}${esc(workspace.name)}</button>`).join('')}`,
  4018. ),
  4019. 'choose-workspace': (button) => {
  4020. getConversation(button.dataset.id).workspace = button.dataset.workspace || null;
  4021. closeOverlay();
  4022. render();
  4023. toast('已移动,仅影响本地演示数据');
  4024. },
  4025. 'archive-conversation': (button) => {
  4026. const conversation = getConversation(button.dataset.id);
  4027. conversation.archived = !conversation.archived;
  4028. closeOverlay();
  4029. if (state.page === 'chat' && conversation.archived) navigate('messages');
  4030. else render();
  4031. toast(conversation.archived ? '已归档,可在侧栏中找回' : '已取消归档');
  4032. },
  4033. 'delete-conversation': (button) =>
  4034. confirmation(
  4035. '删除对话?',
  4036. '删除后这条演示对话将从当前预览中移除,刷新页面可恢复。',
  4037. 'confirm-delete-conversation',
  4038. button.dataset.id,
  4039. ),
  4040. 'confirm-delete-conversation': (button) => {
  4041. const index = conversations.findIndex((conversation) => conversation.id === button.dataset.id);
  4042. if (index >= 0) conversations.splice(index, 1);
  4043. messages.delete(button.dataset.id);
  4044. closeOverlay();
  4045. if (state.page === 'chat') navigate('messages');
  4046. else render();
  4047. toast('演示对话已删除');
  4048. },
  4049. 'show-archived': showArchived,
  4050. details: (button) => details(button?.dataset.tab || 'task'),
  4051. 'detail-tab': (button) => details(button.dataset.value),
  4052. 'preview-file': previewFile,
  4053. 'download-demo': downloadDemo,
  4054. 'copy-message': (button) => {
  4055. const message = messages.get(state.currentId)[Number(button.dataset.index)],
  4056. content = document.createElement('div');
  4057. content.innerHTML = message.html;
  4058. copyText(content.textContent);
  4059. },
  4060. disconnect: () => {
  4061. state.disconnected = true;
  4062. closeOverlay();
  4063. renderChat();
  4064. toast('已进入断线演示,草稿不会丢失');
  4065. },
  4066. reconnect: () => {
  4067. state.disconnected = false;
  4068. closeOverlay();
  4069. renderChat();
  4070. toast('演示连接已恢复');
  4071. },
  4072. 'open-agent': (button) => navigate('agent', button.dataset.id),
  4073. 'rename-agent': (button) =>
  4074. formSheet(
  4075. '重命名数字生命',
  4076. '显示名称',
  4077. getAgent(button.dataset.id).name,
  4078. 'rename-agent',
  4079. button.dataset.id,
  4080. ),
  4081. 'agent-chat': (button) => {
  4082. const conversation = activeConversations().find((item) => item.agentId === button.dataset.id);
  4083. conversation ? navigate('chat', conversation.id) : newChat(null, button.dataset.id);
  4084. },
  4085. channels: (button) =>
  4086. sheet(
  4087. '消息通道',
  4088. `<p class="sheet-description">${esc(getAgent(button.dataset.id).name)} · 演示连接信息</p><div class="sheet-item"><span class="tag">${getAgent(button.dataset.id).online ? '已连接' : '离线'}</span><strong>Matrix</strong><p>沿用现有消息通道,不在原型中建立真实连接。</p></div>`,
  4089. ),
  4090. recharge: (button) =>
  4091. sheet(
  4092. '数字生命充值',
  4093. `<p class="sheet-description">${esc(getAgent(button.dataset.id).name)} · 当前演示余额 ¥${getAgent(button.dataset.id).balance}</p><div class="empty-state">${icon('shield')}<strong>这里只预览,不会产生支付</strong><p>正式迁移时继续使用现有充值页面与接口,金额、账单和支付流程均不改变。</p></div>`,
  4094. ),
  4095. coworker: (button) =>
  4096. sheet(
  4097. esc(button.dataset.name),
  4098. `<p class="sheet-description">同事的数字生命 · 演示</p>${agents
  4099. .slice(0, 2)
  4100. .map(
  4101. (agent) =>
  4102. `<button class="sheet-list-button" data-action="open-agent" data-id="${agent.id}">${avatar(agent)}<span>${esc(agent.name)}<small>${agent.role}</small></span>${icon('right')}</button>`,
  4103. )
  4104. .join('')}`,
  4105. ),
  4106. theme: () => {
  4107. state.dark = !state.dark;
  4108. const scroll = main.scrollTop;
  4109. renderMine();
  4110. applyPreferences();
  4111. main.scrollTop = scroll;
  4112. },
  4113. palette: (button) => {
  4114. state.palette = button.dataset.value;
  4115. const scroll = main.scrollTop;
  4116. renderMine();
  4117. applyPreferences();
  4118. main.scrollTop = scroll;
  4119. },
  4120. font: () =>
  4121. sheet(
  4122. '舒适地阅读',
  4123. `<p class="sheet-description">仅调整对话正文,沿用现有字号偏好功能。</p><div class="font-options">${[
  4124. [14, '标准'],
  4125. [16, '较大'],
  4126. [18, '大号'],
  4127. ]
  4128. .map(
  4129. ([value, label]) =>
  4130. `<button data-action="choose-font" data-value="${value}" class="${state.font === value ? 'active' : ''}">${label}</button>`,
  4131. )
  4132. .join(
  4133. '',
  4134. )}</div><div class="assistant-body" id="font-preview" style="font-size:${state.font}px;line-height:1.9;padding:14px 0">让每一个想法,都有舒展的空间。<br />好的阅读体验,从恰好的字号开始。</div>`,
  4135. ),
  4136. 'choose-font': (button) => {
  4137. state.font = Number(button.dataset.value);
  4138. applyPreferences();
  4139. renderMine();
  4140. actions.font();
  4141. },
  4142. token: () =>
  4143. sheet(
  4144. '访问 Token',
  4145. `<p class="sheet-description">演示占位,不读取或展示任何真实凭据。</p><div class="sheet-item"><strong>${state.tokenVisible ? 'DEMO-NOT-A-REAL-TOKEN' : '•••• •••• •••• ••••'}</strong></div><div class="button-row"><button class="secondary-button" data-action="toggle-token">${state.tokenVisible ? '隐藏' : '显示'}占位 Token</button><button class="secondary-button" data-action="copy-token" ${state.tokenVisible ? '' : 'disabled'}>复制占位内容</button></div>`,
  4146. ),
  4147. 'toggle-token': () => {
  4148. state.tokenVisible = !state.tokenVisible;
  4149. actions.token();
  4150. },
  4151. 'copy-token': () => copyText('DEMO-NOT-A-REAL-TOKEN'),
  4152. notifications: () =>
  4153. sheet(
  4154. '消息与任务通知',
  4155. `<p class="sheet-description">继续保留现有通知权限状态和系统设置入口。</p><div class="empty-state">${icon('bell')}<strong>原型不申请系统权限</strong><p>正式版本仍由现有通知服务检查权限,并引导到系统设置。</p></div>`,
  4156. ),
  4157. logout: () =>
  4158. confirmation('退出登录?', '此处仅演示二次确认,不会退出真实项目账号。', 'confirm-logout'),
  4159. 'confirm-logout': () => {
  4160. closeOverlay();
  4161. navigate('home');
  4162. toast('退出交互演示完成;未操作真实账号');
  4163. },
  4164. };
  4165. document.addEventListener('click', (event) => {
  4166. const experience = event.target.closest('[data-experience]');
  4167. if (experience) {
  4168. const type = experience.dataset.experience;
  4169. closeOverlay();
  4170. if (state.page !== 'chat') {
  4171. saveDraft();
  4172. state.page = 'chat';
  4173. state.currentId = 'c1';
  4174. restoreDraft();
  4175. history.pushState(null, '', '#/chat/c1');
  4176. render();
  4177. }
  4178. if (type === 'activity') openActivity();
  4179. if (type === 'title') editCurrentTitle();
  4180. if (type === 'complete') completeDemo();
  4181. return;
  4182. }
  4183. const scene = event.target.closest('[data-scene]');
  4184. if (scene) {
  4185. navigate(scene.dataset.scene, scene.dataset.scene === 'chat' ? 'c1' : undefined);
  4186. return;
  4187. }
  4188. const button = event.target.closest('[data-action]');
  4189. if (button && !button.disabled) actions[button.dataset.action]?.(button);
  4190. });
  4191. document.addEventListener('input', (event) => {
  4192. const element = event.target;
  4193. if (element.id === 'draft') {
  4194. state.draft = element.value;
  4195. element.style.height = 'auto';
  4196. element.style.height = `${Math.min(element.scrollHeight, 116)}px`;
  4197. document.querySelector('.send-button').disabled =
  4198. state.generating || (!state.draft.trim() && !state.attachments.length);
  4199. return;
  4200. }
  4201. const kind = element.dataset.input;
  4202. if (!kind) return;
  4203. if (kind === 'activity-search') {
  4204. state.activityKeyword = element.value;
  4205. document.querySelector('#activity-results').innerHTML = activityResults();
  4206. return;
  4207. }
  4208. if (kind === 'drawer-search') {
  4209. document.querySelector('#drawer-results').innerHTML = drawerHistory(element.value);
  4210. return;
  4211. }
  4212. state.keyword = element.value;
  4213. if (kind === 'search')
  4214. document.querySelector('#conversation-results').innerHTML = conversationResults();
  4215. if (kind === 'contact-search')
  4216. document.querySelector('#contact-results').innerHTML = contactResults();
  4217. if (kind === 'agent-search') document.querySelector('#agent-results').innerHTML = agentResults();
  4218. });
  4219. document.addEventListener('keydown', (event) => {
  4220. if (event.key === 'Escape' && overlay.childElementCount) {
  4221. event.preventDefault();
  4222. closeOverlay();
  4223. return;
  4224. }
  4225. if (event.key === 'Tab' && overlay.childElementCount) {
  4226. const focusable = [
  4227. ...overlay.querySelectorAll('button:not(:disabled),input,select,a[href],summary'),
  4228. ].filter((element) => element.getClientRects().length),
  4229. first = focusable[0],
  4230. last = focusable.at(-1);
  4231. if (event.shiftKey && document.activeElement === first) {
  4232. event.preventDefault();
  4233. last?.focus();
  4234. } else if (!event.shiftKey && document.activeElement === last) {
  4235. event.preventDefault();
  4236. first?.focus();
  4237. }
  4238. }
  4239. });
  4240. let sheetDrag = null;
  4241. overlay.addEventListener('pointerdown', (event) => {
  4242. const handle = event.target.closest('.sheet-handle');
  4243. if (!handle) return;
  4244. sheetDrag = { start: event.clientY, distance: 0, element: handle.closest('.sheet'), handle };
  4245. handle.setPointerCapture(event.pointerId);
  4246. sheetDrag.element.style.transition = 'none';
  4247. sheetDrag.element.style.animation = 'none';
  4248. });
  4249. overlay.addEventListener('pointermove', (event) => {
  4250. if (!sheetDrag) return;
  4251. sheetDrag.distance = Math.max(0, event.clientY - sheetDrag.start);
  4252. sheetDrag.element.style.transform = `translateY(${sheetDrag.distance}px)`;
  4253. });
  4254. overlay.addEventListener('pointerup', () => {
  4255. if (!sheetDrag) return;
  4256. if (sheetDrag.distance > 85) closeOverlay();
  4257. else {
  4258. sheetDrag.element.style.transition = 'transform .2s ease';
  4259. sheetDrag.element.style.transform = '';
  4260. }
  4261. sheetDrag = null;
  4262. });
  4263. overlay.addEventListener('pointercancel', () => {
  4264. if (sheetDrag) sheetDrag.element.style.transform = '';
  4265. sheetDrag = null;
  4266. });
  4267. document.addEventListener('submit', (event) => {
  4268. const form = event.target.closest('[data-form]');
  4269. if (!form) return;
  4270. event.preventDefault();
  4271. const value = new FormData(form).get('value').trim(),
  4272. kind = form.dataset.form,
  4273. identifier = form.dataset.id,
  4274. error = form.querySelector('.form-error');
  4275. if (!value) {
  4276. error.textContent = '名称不能为空';
  4277. return;
  4278. }
  4279. if (kind.includes('workspace')) {
  4280. if (value.length > 24) {
  4281. error.textContent = '工作区名称最多 24 字';
  4282. return;
  4283. }
  4284. if (workspaces.some((workspace) => workspace.name === value && workspace.id !== identifier)) {
  4285. error.textContent = '已有同名工作区,请换一个名称';
  4286. return;
  4287. }
  4288. }
  4289. if (kind === 'create-workspace') workspaces.push({ id: `w${Date.now()}`, name: value });
  4290. if (kind === 'rename-workspace')
  4291. workspaces.find((workspace) => workspace.id === identifier).name = value;
  4292. if (kind === 'rename-conversation') {
  4293. getConversation(identifier).title = value;
  4294. getConversation(identifier).manuallyNamed = true;
  4295. }
  4296. if (kind === 'rename-agent') getAgent(identifier).name = value;
  4297. closeOverlay();
  4298. render();
  4299. toast('已保存,仅影响本地演示数据');
  4300. });
  4301. document.querySelector('#file-input').addEventListener('change', (event) => {
  4302. state.attachments.push(...Array.from(event.target.files));
  4303. event.target.value = '';
  4304. renderComposer();
  4305. toast('附件仅暂存在本页,不会读取或上传');
  4306. });
  4307. window.addEventListener('hashchange', readRoute);
  4308. function syncVisualViewport() {
  4309. if (window.innerWidth <= 520 && window.visualViewport?.scale === 1) {
  4310. document
  4311. .querySelector('#device')
  4312. .style.setProperty('--visual-height', `${window.visualViewport.height}px`);
  4313. } else document.querySelector('#device').style.removeProperty('--visual-height');
  4314. }
  4315. window.visualViewport?.addEventListener('resize', syncVisualViewport);
  4316. window.addEventListener('resize', syncVisualViewport);
  4317. syncVisualViewport();
  4318. document
  4319. .querySelectorAll('[data-icon]')
  4320. .forEach((element) => (element.innerHTML = icon(element.dataset.icon)));
  4321. readRoute();
  4322. </script>
  4323. </body>
  4324. </html>