| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328 |
- <!doctype html>
- <html lang="zh-CN">
- <head>
- <meta charset="UTF-8" />
- <meta
- name="viewport"
- content="width=device-width, initial-scale=1, viewport-fit=cover, interactive-widget=resizes-content"
- />
- <meta name="theme-color" content="#fafbf8" />
- <title>fmode · 移动端体验提案</title>
- <style>
- :root {
- color-scheme: light;
- --canvas: #fafbf8;
- --surface: #fff;
- --soft: #f0f2ed;
- --ink: #252d28;
- --muted: #899183;
- --secondary: #697363;
- --line: #e7ebe2;
- --accent: #386b52;
- --tint: #eaf1e8;
- --danger: #ae514a;
- --shade: #1a221c42;
- font-family:
- Inter,
- 'Noto Sans SC',
- 'PingFang SC',
- 'Microsoft YaHei',
- -apple-system,
- BlinkMacSystemFont,
- 'Segoe UI',
- sans-serif;
- -webkit-font-smoothing: antialiased;
- }
- * {
- box-sizing: border-box;
- }
- body {
- margin: 0;
- background: #eef0eb;
- color: var(--ink);
- }
- button,
- input,
- textarea,
- select {
- font: inherit;
- -webkit-tap-highlight-color: transparent;
- }
- button {
- color: inherit;
- cursor: pointer;
- border: 0;
- background: none;
- touch-action: manipulation;
- }
- button:disabled {
- cursor: default;
- opacity: 0.4;
- }
- button:focus-visible,
- a:focus-visible,
- input:focus-visible,
- summary:focus-visible,
- textarea:focus-visible {
- outline: 2px solid var(--accent);
- outline-offset: 3px;
- }
- a {
- color: inherit;
- text-decoration: none;
- }
- svg {
- width: 22px;
- height: 22px;
- stroke: currentColor;
- stroke-width: 1.65;
- fill: none;
- stroke-linecap: round;
- stroke-linejoin: round;
- flex-shrink: 0;
- }
- button svg {
- pointer-events: none;
- }
- h1,
- h2,
- h3,
- p {
- margin: 0;
- }
- [hidden] {
- display: none !important;
- }
- .presentation {
- max-width: 1400px;
- min-height: 100dvh;
- margin: auto;
- display: grid;
- grid-template-columns: minmax(270px, 1fr) 424px minmax(200px, 0.74fr);
- gap: 65px;
- align-items: center;
- padding: 35px 60px;
- }
- .intro {
- align-self: stretch;
- display: flex;
- flex-direction: column;
- padding: 16px 0 8px;
- }
- .studio-brand {
- display: flex;
- align-items: center;
- gap: 9px;
- font-size: 25px;
- letter-spacing: -1px;
- font-weight: 650;
- flex-wrap: wrap;
- }
- .studio-brand svg {
- width: 29px;
- height: 29px;
- color: var(--accent);
- }
- .edition {
- width: 100%;
- margin-top: 9px;
- font-size: 9px;
- color: #8c948a;
- letter-spacing: 2px;
- font-weight: 500;
- }
- .intro-copy {
- margin-top: clamp(44px, 9vh, 100px);
- }
- .eyebrow {
- font-size: 11px;
- letter-spacing: 1.4px;
- color: var(--muted);
- }
- .intro h1 {
- font-size: clamp(31px, 3vw, 43px);
- font-weight: 500;
- letter-spacing: -1.9px;
- line-height: 1.65;
- margin: 15px 0 16px;
- }
- .intro-copy p {
- font-size: 13px;
- line-height: 2;
- color: var(--secondary);
- }
- .proposal-tag {
- display: inline-flex;
- gap: 7px;
- align-items: center;
- border: 1px solid #d9dfd5;
- border-radius: 20px;
- padding: 7px 11px;
- font-size: 10px;
- color: var(--secondary);
- margin-top: 23px;
- }
- .dot {
- width: 6px;
- height: 6px;
- background: #64866b;
- border-radius: 100%;
- display: inline-block;
- flex-shrink: 0;
- }
- .dot.offline {
- background: #b1b6a9;
- }
- .scene-switch {
- margin-top: 42px;
- max-width: 285px;
- }
- .scene-switch > .eyebrow {
- display: block;
- margin-bottom: 12px;
- }
- .scene-switch button {
- display: flex;
- align-items: center;
- gap: 15px;
- border-bottom: 1px solid #dde2d8;
- width: 100%;
- padding: 15px 0;
- font-size: 12px;
- text-align: left;
- }
- .scene-switch button > span:first-child {
- font-size: 10px;
- color: #9ba397;
- font-family: monospace;
- }
- .scene-switch button > span:last-child {
- margin-left: auto;
- }
- .scene-switch svg {
- width: 15px;
- height: 15px;
- }
- .scene-switch button:hover,
- .scene-switch button.active {
- color: var(--accent);
- }
- .intro-footer {
- margin-top: auto;
- padding-top: 40px;
- font-size: 9px;
- letter-spacing: 1.4px;
- line-height: 2;
- color: #677160;
- }
- .intro-footer span {
- font-size: 10px;
- letter-spacing: 0.3px;
- color: #92998d;
- }
- .device-wrap {
- width: 424px;
- }
- .device {
- height: min(858px, calc(100dvh - 90px));
- min-height: 660px;
- width: 424px;
- padding: 7px;
- border-radius: 46px;
- background: var(--canvas);
- border: 1px solid #cdd2c8;
- box-shadow:
- 0 30px 70px -30px #3f4b3c33,
- 0 0 0 5px #e5e8df,
- 0 0 0 6px #d9ded2;
- position: relative;
- overflow: hidden;
- isolation: isolate;
- }
- .statusbar {
- height: 40px;
- padding: 6px 23px;
- display: flex;
- align-items: center;
- justify-content: space-between;
- font-size: 13px;
- font-weight: 650;
- }
- .island {
- position: absolute;
- top: 15px;
- left: 50%;
- transform: translateX(-50%);
- width: 99px;
- height: 25px;
- border-radius: 25px;
- background: #242824;
- }
- .status-icons {
- display: flex;
- gap: 4px;
- align-items: center;
- }
- .status-icons svg {
- width: 15px;
- height: 15px;
- stroke-width: 1.9;
- }
- .status-icons > span:last-child svg {
- width: 22px;
- }
- .home-indicator {
- position: absolute;
- bottom: 8px;
- left: 50%;
- transform: translateX(-50%);
- height: 4px;
- width: 118px;
- background: var(--ink);
- border-radius: 8px;
- pointer-events: none;
- z-index: 30;
- }
- .device-caption {
- display: flex;
- align-items: center;
- justify-content: center;
- gap: 8px;
- margin-top: 18px;
- font-size: 10px;
- color: #8b9386;
- letter-spacing: 0.5px;
- }
- .device-caption .dot {
- width: 5px;
- height: 5px;
- }
- .design-notes {
- max-width: 235px;
- }
- .design-notes > .eyebrow {
- font-size: 10px;
- letter-spacing: 1px;
- }
- .note {
- margin-top: 37px;
- padding-top: 16px;
- border-top: 1px solid #d9dfd3;
- }
- .note > span {
- font-size: 9px;
- letter-spacing: 1.5px;
- color: #8b9682;
- }
- .note h2 {
- font-size: 14px;
- font-weight: 550;
- margin: 12px 0 10px;
- letter-spacing: -0.3px;
- }
- .note p {
- font-size: 11px;
- line-height: 2.1;
- color: #86907d;
- }
- .scope-note {
- display: flex;
- gap: 8px;
- margin-top: 39px;
- font-size: 9px;
- color: #91998a;
- line-height: 2;
- }
- .scope-note svg {
- width: 16px;
- height: 16px;
- margin-top: 2px;
- }
- .app {
- height: calc(100% - 40px);
- display: flex;
- flex-direction: column;
- overflow: hidden;
- border-radius: 0 0 35px 35px;
- font-size: 14px;
- }
- .app-header {
- height: 64px;
- min-height: 64px;
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 10px;
- padding: 4px 17px;
- z-index: 2;
- background: var(--canvas);
- }
- .icon-button {
- min-width: 44px;
- width: 44px;
- height: 44px;
- display: inline-flex;
- align-items: center;
- justify-content: center;
- border-radius: 50%;
- flex-shrink: 0;
- }
- .icon-button:hover {
- background: var(--soft);
- }
- .header-center {
- text-align: center;
- min-width: 0;
- }
- .header-center strong {
- font-size: 15px;
- font-weight: 600;
- letter-spacing: -0.4px;
- }
- .header-center small {
- display: flex;
- justify-content: center;
- align-items: center;
- gap: 5px;
- color: var(--muted);
- font-size: 10px;
- margin-top: 5px;
- }
- .header-center .dot {
- width: 5px;
- height: 5px;
- }
- .header-brand {
- display: flex;
- align-items: center;
- gap: 6px;
- }
- .header-brand svg {
- width: 20px;
- height: 20px;
- color: var(--accent);
- }
- .header-brand strong {
- font-size: 21px;
- font-weight: 600;
- letter-spacing: -0.9px;
- }
- .profile-button {
- width: 34px;
- height: 34px;
- margin: 5px;
- border-radius: 50%;
- background: #e8ebdf;
- color: #657151;
- font-size: 12px;
- }
- .page-title {
- flex: 1;
- font-size: 20px;
- letter-spacing: -0.5px;
- font-weight: 600;
- }
- #main {
- flex: 1;
- min-height: 0;
- overflow-y: auto;
- overflow-x: hidden;
- overscroll-behavior: contain;
- scrollbar-width: none;
- outline: none;
- }
- #main::-webkit-scrollbar {
- display: none;
- }
- .screen {
- padding: 6px 23px 24px;
- animation: arrive 0.24s ease-out;
- }
- .home-screen {
- min-height: 100%;
- display: flex;
- flex-direction: column;
- padding-top: 31px;
- }
- .home-hero {
- padding: 4px 1px 10px;
- }
- .hero-art {
- display: grid;
- place-items: center;
- width: 65px;
- height: 65px;
- border-radius: 22px;
- background: #eaf0e4;
- color: var(--accent);
- margin-bottom: 25px;
- transform: rotate(-6deg);
- }
- .hero-art svg {
- width: 42px;
- height: 42px;
- transform: rotate(6deg);
- }
- .home-hero .overline {
- font-size: 11px;
- color: var(--muted);
- margin-bottom: 11px;
- letter-spacing: 1px;
- }
- .home-hero h1 {
- font-size: 31px;
- letter-spacing: -1.4px;
- line-height: 1.6;
- font-weight: 500;
- }
- .home-hero p {
- color: var(--muted);
- font-size: 12px;
- margin-top: 12px;
- line-height: 1.9;
- }
- .prompts {
- display: flex;
- gap: 8px;
- overflow-x: auto;
- scrollbar-width: none;
- padding: 19px 0 6px;
- flex-shrink: 0;
- }
- .prompt {
- white-space: nowrap;
- font-size: 11px;
- color: var(--secondary);
- border: 1px solid var(--line);
- padding: 10px 13px;
- border-radius: 12px;
- display: flex;
- align-items: center;
- gap: 6px;
- background: var(--surface);
- }
- .prompt svg {
- width: 14px;
- height: 14px;
- }
- .recent-block {
- margin-top: auto;
- padding-top: 25px;
- }
- .section-label {
- display: flex;
- align-items: center;
- justify-content: space-between;
- color: var(--muted);
- font-size: 10px;
- letter-spacing: 0.6px;
- margin: 0 0 10px;
- }
- .text-button {
- min-height: 36px;
- font-size: 11px;
- display: inline-flex;
- align-items: center;
- gap: 4px;
- color: var(--secondary);
- }
- .text-button svg {
- width: 13px;
- height: 13px;
- }
- .recent-row {
- width: 100%;
- display: flex;
- align-items: center;
- gap: 11px;
- padding: 12px 0;
- border-top: 1px solid var(--line);
- text-align: left;
- }
- .recent-row > svg {
- color: var(--muted);
- width: 16px;
- height: 16px;
- }
- .row-text {
- flex: 1;
- min-width: 0;
- }
- .recent-row strong {
- font-size: 12px;
- font-weight: 500;
- white-space: nowrap;
- text-overflow: ellipsis;
- overflow: hidden;
- display: block;
- }
- .recent-row small {
- font-size: 10px;
- color: var(--muted);
- margin-top: 5px;
- display: block;
- }
- .recent-row time {
- font-size: 10px;
- color: var(--muted);
- }
- #composer-area {
- flex-shrink: 0;
- padding: 6px 15px 18px;
- background: var(--canvas);
- }
- #composer-area:empty {
- display: none;
- }
- .composer {
- border: 1px solid #dfe4d9;
- background: var(--surface);
- border-radius: 24px;
- padding: 12px 12px 9px;
- box-shadow: 0 3px 14px #26352005;
- transition: border-color 0.2s;
- }
- .composer:focus-within {
- border-color: #9bae98;
- }
- .composer textarea {
- width: 100%;
- min-height: 46px;
- max-height: 116px;
- resize: none;
- display: block;
- border: 0;
- background: none;
- outline: none !important;
- color: var(--ink);
- font-size: 16px;
- line-height: 1.6;
- padding: 3px 4px;
- }
- .composer textarea::placeholder {
- color: var(--muted);
- font-size: 14px;
- }
- .composer-tools {
- display: flex;
- align-items: center;
- gap: 5px;
- }
- .composer-tools .icon-button {
- width: 40px;
- min-width: 40px;
- height: 40px;
- color: var(--secondary);
- }
- .agent-select {
- display: flex;
- gap: 6px;
- align-items: center;
- font-size: 10px;
- padding: 0 5px;
- height: 40px;
- color: var(--secondary);
- max-width: 205px;
- white-space: nowrap;
- overflow: hidden;
- }
- .agent-select svg {
- width: 13px;
- height: 13px;
- }
- .agent-select .dot {
- width: 5px;
- height: 5px;
- }
- .send-button {
- width: 37px;
- height: 37px;
- min-height: 37px;
- border-radius: 50%;
- display: grid;
- place-items: center;
- background: var(--accent);
- color: white;
- margin-left: auto;
- }
- .send-button:disabled {
- background: var(--soft);
- color: #a0a89a;
- opacity: 1;
- }
- .send-button svg {
- width: 20px;
- height: 20px;
- }
- .composer-footnote {
- text-align: center;
- color: var(--muted);
- font-size: 9px;
- margin-top: 10px;
- }
- .attachment-list {
- display: flex;
- gap: 6px;
- flex-wrap: wrap;
- }
- .attachment-chip {
- font-size: 10px;
- border-radius: 8px;
- background: var(--soft);
- padding: 6px 8px;
- display: flex;
- align-items: center;
- gap: 4px;
- margin-bottom: 6px;
- max-width: 100%;
- }
- .attachment-chip > span {
- max-width: 230px;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .attachment-chip button {
- min-width: 32px;
- min-height: 32px;
- display: grid;
- place-items: center;
- margin: -5px;
- }
- .attachment-chip svg {
- width: 12px;
- height: 12px;
- }
- .tabbar {
- display: flex;
- padding: 8px 9px 22px;
- gap: 3px;
- border-top: 1px solid var(--line);
- background: var(--canvas);
- flex-shrink: 0;
- }
- .tabbar:empty {
- display: none;
- }
- .tabbar button {
- flex: 1;
- min-height: 48px;
- display: flex;
- align-items: center;
- justify-content: center;
- flex-direction: column;
- gap: 5px;
- color: var(--muted);
- font-size: 9px;
- }
- .tabbar button svg {
- width: 21px;
- height: 21px;
- }
- .tabbar button.active {
- color: var(--accent);
- font-weight: 600;
- }
- .tabbar button.active > span:first-child {
- background: var(--tint);
- border-radius: 12px;
- padding: 2px 12px;
- margin: -2px -12px;
- }
- .tabbar button > span:first-child {
- height: 25px;
- display: flex;
- align-items: center;
- }
- .page-subtitle {
- font-size: 11px;
- color: var(--muted);
- line-height: 1.8;
- margin-bottom: 19px;
- }
- .search-field {
- display: flex;
- gap: 8px;
- align-items: center;
- border-radius: 13px;
- background: var(--soft);
- padding: 0 12px;
- margin-bottom: 16px;
- min-height: 44px;
- }
- .search-field svg {
- width: 16px;
- height: 16px;
- color: var(--muted);
- }
- .search-field input {
- width: 100%;
- border: 0;
- outline: none;
- background: none;
- font-size: 13px;
- color: var(--ink);
- min-height: 44px;
- }
- .search-field input::placeholder {
- color: var(--muted);
- }
- .segmented {
- display: flex;
- gap: 5px;
- border-bottom: 1px solid var(--line);
- margin-bottom: 19px;
- }
- .segmented button {
- position: relative;
- min-height: 42px;
- flex: 1;
- font-size: 12px;
- color: var(--muted);
- white-space: nowrap;
- }
- .segmented button.active {
- color: var(--ink);
- font-weight: 600;
- }
- .segmented button.active:after {
- position: absolute;
- content: '';
- width: 18px;
- height: 2px;
- background: var(--accent);
- bottom: -1px;
- left: calc(50% - 9px);
- border-radius: 2px;
- }
- .group-heading {
- color: var(--muted);
- font-size: 10px;
- margin: 24px 0 5px;
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- .conversation-row {
- display: flex;
- align-items: center;
- gap: 7px;
- padding: 17px 0;
- border-bottom: 1px solid var(--line);
- }
- .avatar {
- width: 39px;
- height: 39px;
- flex-shrink: 0;
- border-radius: 14px;
- display: grid;
- place-items: center;
- background: var(--tint);
- color: var(--accent);
- font-size: 13px;
- }
- .avatar svg {
- width: 22px;
- height: 22px;
- }
- .avatar.clay {
- background: #f1eae4;
- color: #95745e;
- }
- .avatar.lilac {
- background: #eeebf5;
- color: #8b7eaa;
- }
- .avatar.person {
- border-radius: 50%;
- }
- .conversation-open {
- display: flex;
- gap: 11px;
- text-align: left;
- flex: 1;
- min-width: 0;
- padding: 0;
- }
- .conversation-body {
- flex: 1;
- min-width: 0;
- }
- .conversation-top {
- display: flex;
- align-items: center;
- gap: 5px;
- }
- .conversation-top strong {
- font-size: 13px;
- font-weight: 550;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- flex: 1;
- }
- .conversation-top time {
- font-size: 9px;
- color: var(--muted);
- flex-shrink: 0;
- }
- .conversation-body p {
- font-size: 11px;
- color: var(--muted);
- line-height: 1.6;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- margin: 6px 0;
- }
- .conversation-meta {
- display: flex;
- align-items: center;
- gap: 5px;
- font-size: 9px;
- color: var(--secondary);
- }
- .conversation-meta .dot {
- width: 4px;
- height: 4px;
- }
- .unread {
- border-radius: 6px;
- background: var(--accent);
- color: #fff;
- min-width: 16px;
- padding: 2px 4px;
- font-size: 9px;
- text-align: center;
- }
- .row-more {
- width: 30px;
- min-height: 44px;
- padding: 0;
- display: grid;
- place-items: center;
- color: var(--muted);
- align-self: flex-start;
- margin-top: -7px;
- }
- .row-more svg {
- width: 17px;
- }
- .workspace {
- border-bottom: 1px solid var(--line);
- }
- .workspace-head {
- display: flex;
- align-items: center;
- gap: 8px;
- padding: 12px 0;
- }
- .workspace-toggle {
- min-height: 40px;
- flex: 1;
- display: flex;
- align-items: center;
- gap: 9px;
- text-align: left;
- font-size: 13px;
- }
- .workspace-toggle svg {
- width: 17px;
- color: var(--secondary);
- }
- .workspace-toggle small {
- color: var(--muted);
- font-size: 10px;
- margin-left: auto;
- }
- .workspace > div {
- padding-left: 12px;
- }
- .workspace .icon-button {
- min-width: 35px;
- width: 35px;
- height: 40px;
- color: var(--muted);
- }
- .workspace .icon-button svg {
- width: 17px;
- }
- .empty-state {
- padding: 55px 15px;
- text-align: center;
- color: var(--muted);
- }
- .empty-state > svg {
- width: 32px;
- height: 32px;
- margin-bottom: 15px;
- }
- .empty-state strong {
- display: block;
- font-size: 14px;
- color: var(--ink);
- font-weight: 500;
- }
- .empty-state p {
- font-size: 12px;
- line-height: 1.8;
- margin-top: 9px;
- }
- .empty-state button {
- margin-top: 16px;
- }
- .primary-button {
- display: flex;
- align-items: center;
- justify-content: center;
- gap: 7px;
- width: 100%;
- min-height: 47px;
- border-radius: 14px;
- background: var(--accent);
- color: #fff;
- font-size: 13px;
- }
- .secondary-button {
- min-height: 44px;
- border: 1px solid var(--line);
- background: var(--surface);
- border-radius: 12px;
- font-size: 12px;
- padding: 0 16px;
- }
- .primary-button svg {
- width: 17px;
- }
- .button-row {
- display: flex;
- gap: 9px;
- margin-top: 20px;
- }
- .button-row > * {
- flex: 1;
- }
- .danger {
- color: var(--danger) !important;
- }
- .chat-screen {
- padding: 12px 23px 15px;
- font-size: var(--chat-font, 15px);
- line-height: 1.9;
- }
- .chat-date {
- text-align: center;
- color: var(--muted);
- font-size: 9px;
- margin: 2px 0 25px;
- letter-spacing: 1px;
- }
- .user-message {
- display: flex;
- justify-content: flex-end;
- margin: 20px 0 28px;
- }
- .user-bubble {
- background: #edf0e7;
- max-width: 88%;
- padding: 12px 16px;
- border-radius: 19px 19px 5px 19px;
- line-height: 1.85;
- font-size: 13px;
- overflow-wrap: anywhere;
- }
- .user-file {
- display: block;
- font-size: 10px;
- color: var(--secondary);
- padding-top: 5px;
- }
- .assistant-heading {
- display: flex;
- gap: 8px;
- align-items: center;
- margin-bottom: 16px;
- font-size: 11px;
- color: var(--secondary);
- }
- .assistant-heading > svg {
- width: 21px;
- height: 21px;
- color: var(--accent);
- }
- .assistant-heading time {
- margin-left: auto;
- font-size: 9px;
- color: var(--muted);
- }
- .process {
- margin-bottom: 18px;
- border: 1px solid var(--line);
- border-radius: 13px;
- padding: 0 12px;
- background: var(--surface);
- }
- .process summary {
- cursor: pointer;
- list-style: none;
- display: flex;
- gap: 7px;
- align-items: center;
- min-height: 42px;
- font-size: 10px;
- color: var(--secondary);
- }
- .process summary::-webkit-details-marker {
- display: none;
- }
- .process summary svg {
- width: 14px;
- height: 14px;
- color: var(--accent);
- }
- .process summary .chevron {
- margin-left: auto;
- transition: transform 0.2s;
- }
- .process[open] summary .chevron {
- transform: rotate(180deg);
- }
- .process ol {
- padding: 0 0 10px 21px;
- margin: 0;
- color: var(--muted);
- font-size: 10px;
- line-height: 2.4;
- }
- .assistant-body {
- overflow-wrap: anywhere;
- }
- .assistant-body h2 {
- font-size: 18px;
- font-weight: 600;
- letter-spacing: -0.5px;
- line-height: 1.6;
- margin: 21px 0 12px;
- }
- .assistant-body p {
- margin: 0 0 14px;
- }
- .assistant-body ul {
- padding-left: 19px;
- margin: 0 0 17px;
- }
- .assistant-body li {
- margin-bottom: 8px;
- }
- .assistant-body strong {
- font-weight: 600;
- }
- .assistant-body blockquote {
- margin: 18px 0;
- padding: 3px 0 3px 13px;
- border-left: 2px solid #9bb192;
- color: var(--secondary);
- font-size: 13px;
- }
- .file-card {
- display: flex;
- align-items: center;
- gap: 11px;
- width: 100%;
- text-align: left;
- padding: 14px;
- border: 1px solid var(--line);
- border-radius: 15px;
- margin: 18px 0;
- background: var(--surface);
- }
- .file-badge {
- height: 39px;
- width: 33px;
- border: 1px solid #dce5d7;
- border-radius: 6px;
- background: var(--tint);
- color: var(--accent);
- font-size: 9px;
- display: grid;
- place-items: center;
- font-weight: 600;
- flex-shrink: 0;
- }
- .file-card strong {
- display: block;
- font-size: 12px;
- font-weight: 500;
- }
- .file-card small {
- font-size: 9px;
- color: var(--muted);
- display: block;
- margin-top: 5px;
- }
- .file-card > svg {
- width: 17px;
- color: var(--muted);
- margin-left: auto;
- }
- .message-actions {
- display: flex;
- gap: 7px;
- align-items: center;
- margin: 13px 0 24px;
- color: var(--muted);
- }
- .message-actions button {
- width: 37px;
- height: 37px;
- display: grid;
- place-items: center;
- }
- .message-actions svg {
- width: 16px;
- height: 16px;
- }
- .message-actions small {
- font-size: 9px;
- margin-left: auto;
- }
- .typing {
- display: flex;
- align-items: center;
- gap: 4px;
- color: var(--muted);
- font-size: 11px;
- padding: 10px 0;
- }
- .typing i {
- width: 4px;
- height: 4px;
- background: var(--accent);
- border-radius: 50%;
- animation: pulse 1s infinite;
- }
- .typing i:nth-child(2) {
- animation-delay: 0.15s;
- }
- .typing i:nth-child(3) {
- animation-delay: 0.3s;
- }
- .connection-banner {
- display: flex;
- gap: 7px;
- align-items: center;
- background: #f4ede1;
- color: #906f3e;
- border-radius: 10px;
- padding: 10px;
- font-size: 11px;
- margin-bottom: 12px;
- width: 100%;
- }
- .connection-banner svg {
- width: 16px;
- }
- .overview {
- display: grid;
- grid-template-columns: repeat(3, 1fr);
- background: var(--tint);
- border-radius: 18px;
- padding: 19px 13px;
- margin: 3px 0 23px;
- }
- .overview > div {
- padding-left: 10px;
- border-right: 1px solid #d8e2d3;
- }
- .overview > div:last-child {
- border: 0;
- }
- .overview strong {
- display: block;
- font-size: 23px;
- letter-spacing: -1px;
- font-weight: 500;
- margin-bottom: 5px;
- }
- .overview small {
- font-size: 10px;
- color: var(--secondary);
- }
- .agent-card {
- padding: 18px;
- border: 1px solid var(--line);
- border-radius: 18px;
- background: var(--surface);
- margin: 13px 0;
- }
- .agent-card-head {
- display: flex;
- align-items: center;
- gap: 10px;
- }
- .agent-card-head h2 {
- font-size: 14px;
- font-weight: 550;
- }
- .agent-card-head small {
- display: flex;
- align-items: center;
- gap: 5px;
- margin-top: 6px;
- font-size: 10px;
- color: var(--muted);
- }
- .agent-card-head > .tag {
- margin-left: auto;
- }
- .tag {
- display: inline-flex;
- align-items: center;
- gap: 5px;
- border-radius: 6px;
- background: var(--tint);
- color: var(--accent);
- font-size: 9px;
- padding: 5px 7px;
- }
- .tag.offline {
- background: var(--soft);
- color: var(--muted);
- }
- .agent-current {
- font-size: 11px;
- color: var(--secondary);
- line-height: 1.8;
- margin: 16px 0;
- padding: 11px;
- border-radius: 10px;
- background: var(--canvas);
- }
- .agent-metrics {
- display: flex;
- gap: 20px;
- font-size: 9px;
- color: var(--muted);
- margin-bottom: 15px;
- }
- .agent-metrics b {
- font-weight: 500;
- color: var(--secondary);
- margin-left: 3px;
- }
- .agent-actions {
- display: flex;
- border-top: 1px solid var(--line);
- padding-top: 9px;
- gap: 7px;
- }
- .agent-actions button {
- font-size: 10px;
- min-height: 38px;
- flex: 1;
- display: flex;
- align-items: center;
- justify-content: center;
- gap: 5px;
- color: var(--secondary);
- }
- .agent-actions button:last-child {
- color: var(--accent);
- background: var(--tint);
- border-radius: 9px;
- }
- .agent-actions svg {
- width: 14px;
- height: 14px;
- }
- .contact-row {
- display: flex;
- align-items: center;
- gap: 11px;
- padding: 17px 0;
- border-bottom: 1px solid var(--line);
- }
- .contact-row > button {
- padding: 0;
- flex: 1;
- text-align: left;
- display: flex;
- gap: 11px;
- align-items: center;
- min-height: 44px;
- }
- .contact-row strong {
- font-size: 13px;
- font-weight: 500;
- }
- .contact-row small {
- display: block;
- font-size: 10px;
- color: var(--muted);
- margin-top: 6px;
- }
- .contact-row > svg {
- width: 16px;
- color: var(--muted);
- }
- .contact-department {
- font-size: 10px;
- color: var(--muted);
- margin: 22px 0 2px;
- }
- .profile-card {
- padding: 18px 0 25px;
- display: flex;
- gap: 13px;
- align-items: center;
- }
- .profile-card .avatar {
- width: 55px;
- height: 55px;
- font-size: 21px;
- background: #e9ecdf;
- color: #6c7856;
- border-radius: 19px;
- }
- .profile-card h2 {
- font-size: 19px;
- font-weight: 500;
- }
- .profile-card p {
- font-size: 10px;
- color: var(--muted);
- margin-top: 8px;
- }
- .settings-group {
- margin: 10px 0 26px;
- }
- .settings-group h2 {
- font-size: 10px;
- color: var(--muted);
- font-weight: 500;
- margin-bottom: 11px;
- }
- .settings-row {
- display: flex;
- align-items: center;
- gap: 10px;
- min-height: 58px;
- border-bottom: 1px solid var(--line);
- width: 100%;
- font-size: 12px;
- text-align: left;
- }
- .settings-row > svg {
- width: 18px;
- color: var(--secondary);
- }
- .settings-row small {
- margin-left: auto;
- font-size: 10px;
- color: var(--muted);
- }
- .settings-row > svg:last-child {
- width: 14px;
- margin-left: auto;
- color: var(--muted);
- }
- .settings-row small + svg {
- margin-left: 0 !important;
- }
- .toggle {
- margin-left: auto;
- width: 37px;
- height: 23px;
- border-radius: 20px;
- background: #d9dfd2;
- padding: 3px;
- }
- .toggle:before {
- content: '';
- display: block;
- width: 17px;
- height: 17px;
- border-radius: 50%;
- background: #fff;
- box-shadow: 0 1px 3px #0001;
- transition: transform 0.2s;
- }
- .toggle.on {
- background: var(--accent);
- }
- .toggle.on:before {
- transform: translateX(14px);
- }
- .palette-row {
- display: flex;
- gap: 10px;
- padding: 10px 0;
- }
- .palette-option {
- width: 44px;
- height: 44px;
- border-radius: 50%;
- border: 1px solid var(--line);
- display: grid;
- place-items: center;
- }
- .palette-option > span {
- width: 27px;
- height: 27px;
- border-radius: 50%;
- background: var(--swatch);
- }
- .palette-option.active {
- border-color: var(--accent);
- box-shadow: 0 0 0 2px var(--tint);
- }
- .version-text {
- text-align: center;
- color: var(--muted);
- font-size: 10px;
- line-height: 1.9;
- padding-top: 8px;
- }
- .font-options {
- display: flex;
- gap: 6px;
- margin: 14px 0;
- }
- .font-options button {
- min-height: 42px;
- flex: 1;
- border: 1px solid var(--line);
- border-radius: 10px;
- font-size: 11px;
- }
- .font-options button.active {
- background: var(--tint);
- border-color: var(--accent);
- color: var(--accent);
- }
- #overlay-root {
- position: absolute;
- inset: 0;
- z-index: 20;
- pointer-events: none;
- }
- #overlay-root:not(:empty) {
- pointer-events: auto;
- }
- .backdrop {
- position: absolute;
- inset: 0;
- background: var(--shade);
- animation: fade 0.2s;
- }
- .sheet {
- position: absolute;
- bottom: 0;
- left: 0;
- right: 0;
- max-height: 88%;
- display: flex;
- flex-direction: column;
- background: var(--canvas);
- border-radius: 27px 27px 0 0;
- padding: 0 23px 30px;
- box-shadow: 0 -8px 30px #00000005;
- animation: sheet-in 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
- }
- .sheet-handle {
- width: 34px;
- height: 4px;
- border-radius: 3px;
- background: var(--line);
- align-self: center;
- margin: 10px 0 3px;
- flex-shrink: 0;
- min-height: 4px;
- }
- .sheet-header {
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 10px;
- min-height: 61px;
- flex-shrink: 0;
- }
- .sheet-header h2 {
- font-size: 17px;
- font-weight: 550;
- }
- .sheet-header .icon-button {
- margin-right: -10px;
- }
- .sheet-body {
- overflow: auto;
- min-height: 0;
- scrollbar-width: none;
- overscroll-behavior: contain;
- }
- .sheet-description {
- font-size: 11px;
- line-height: 1.9;
- color: var(--muted);
- margin: 0 0 17px;
- }
- .sheet-list-button {
- display: flex;
- align-items: center;
- gap: 12px;
- min-height: 59px;
- width: 100%;
- border-bottom: 1px solid var(--line);
- text-align: left;
- font-size: 13px;
- }
- .sheet-list-button > svg {
- width: 19px;
- color: var(--secondary);
- }
- .sheet-list-button .selected-check {
- color: var(--accent);
- margin-left: auto;
- }
- .sheet-list-button small {
- display: block;
- color: var(--muted);
- font-size: 10px;
- margin-top: 5px;
- }
- .sheet-list-button .avatar {
- width: 37px;
- height: 37px;
- border-radius: 12px;
- }
- .sheet-list-button > span:nth-child(2) {
- flex: 1;
- }
- .sheet .segmented {
- flex-shrink: 0;
- }
- .sheet-item {
- padding: 15px 0;
- border-bottom: 1px solid var(--line);
- font-size: 12px;
- }
- .sheet-item strong {
- font-size: 12px;
- font-weight: 500;
- }
- .sheet-item p {
- font-size: 11px;
- color: var(--muted);
- line-height: 1.8;
- margin-top: 8px;
- }
- .sheet-item .tag {
- float: right;
- }
- .sheet-form label {
- display: block;
- font-size: 11px;
- color: var(--secondary);
- margin-bottom: 8px;
- }
- .sheet-form input,
- .sheet-form select {
- width: 100%;
- border: 1px solid var(--line);
- background: var(--surface);
- color: var(--ink);
- border-radius: 11px;
- min-height: 47px;
- padding: 0 12px;
- font-size: 14px;
- }
- .sheet-form .primary-button {
- margin-top: 17px;
- }
- .form-error {
- color: var(--danger);
- font-size: 11px;
- line-height: 1.7;
- min-height: 22px;
- padding-top: 5px;
- }
- .drawer {
- position: absolute;
- left: 0;
- top: 0;
- bottom: 0;
- width: 88%;
- max-width: 355px;
- background: var(--canvas);
- border-radius: 0 22px 22px 0;
- display: flex;
- flex-direction: column;
- padding: 40px 20px 24px;
- animation: drawer-in 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
- }
- .drawer-header {
- display: flex;
- align-items: center;
- justify-content: space-between;
- min-height: 44px;
- }
- .drawer > .primary-button {
- margin: 19px 0 15px;
- flex-shrink: 0;
- }
- .drawer > .search-field {
- margin-bottom: 5px;
- flex-shrink: 0;
- }
- .drawer-scroll {
- flex: 1;
- overflow: auto;
- scrollbar-width: none;
- margin: 5px -2px;
- padding: 0 2px;
- }
- .drawer .group-heading {
- padding: 0 4px;
- margin-top: 13px;
- min-height: 35px;
- }
- .drawer-history {
- width: 100%;
- display: flex;
- gap: 7px;
- align-items: center;
- text-align: left;
- min-height: 44px;
- padding: 0 9px;
- font-size: 11px;
- border-radius: 9px;
- }
- .drawer-history.active {
- background: var(--tint);
- color: var(--accent);
- }
- .drawer-history svg {
- width: 14px;
- color: var(--muted);
- }
- .drawer-history span {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .drawer-nav {
- display: grid;
- grid-template-columns: repeat(4, 1fr);
- border-top: 1px solid var(--line);
- padding-top: 13px;
- flex-shrink: 0;
- }
- .drawer-nav button {
- min-height: 49px;
- display: flex;
- flex-direction: column;
- gap: 6px;
- align-items: center;
- justify-content: center;
- font-size: 9px;
- color: var(--secondary);
- }
- .drawer-nav svg {
- width: 20px;
- height: 20px;
- }
- .drawer-bottom {
- font-size: 9px;
- color: var(--muted);
- text-align: center;
- margin-top: 15px;
- }
- .preview-document {
- padding: 22px;
- background: var(--surface);
- border: 1px solid var(--line);
- border-radius: 6px;
- font-size: 11px;
- line-height: 2;
- margin: 5px 0 17px;
- min-height: 280px;
- }
- .preview-document h1 {
- font-size: 21px;
- margin: 15px 0;
- }
- .preview-document h2 {
- font-size: 14px;
- margin: 18px 0 8px;
- }
- .preview-document p {
- color: var(--secondary);
- margin-bottom: 12px;
- }
- .preview-document table {
- border-collapse: collapse;
- width: 100%;
- font-size: 10px;
- margin: 18px 0;
- }
- .preview-document td,
- .preview-document th {
- padding: 8px 4px;
- text-align: left;
- border-bottom: 1px solid var(--line);
- }
- .preview-document th {
- background: var(--soft);
- }
- .toast {
- position: absolute;
- left: 50%;
- bottom: 130px;
- transform: translate(-50%, 8px);
- background: #28392eeb;
- color: #fff;
- padding: 12px 17px;
- border-radius: 13px;
- z-index: 40;
- font-size: 11px;
- line-height: 1.7;
- max-width: 85%;
- width: max-content;
- opacity: 0;
- pointer-events: none;
- transition:
- opacity 0.2s,
- transform 0.2s;
- text-align: center;
- }
- .toast.visible {
- opacity: 1;
- transform: translate(-50%, 0);
- }
- .state-chips {
- display: flex;
- flex-wrap: wrap;
- gap: 7px;
- padding: 8px 0 18px;
- }
- .state-chips button {
- border: 1px solid var(--line);
- border-radius: 9px;
- padding: 10px;
- font-size: 11px;
- }
- .state-chips button.active {
- background: var(--tint);
- color: var(--accent);
- border-color: var(--accent);
- }
- .device.dark {
- color-scheme: dark;
- --canvas: #1e2520;
- --surface: #252e27;
- --soft: #2b342d;
- --ink: #e1e7dc;
- --muted: #8f9c8b;
- --secondary: #aeb9a7;
- --line: #354035;
- --accent: #a4c59a;
- --tint: #303f30;
- --shade: #080f0bbb;
- }
- .dark .send-button,
- .dark .primary-button,
- .dark .unread {
- color: #1e2520;
- }
- .dark .user-bubble {
- background: #303c2e;
- }
- .dark .hero-art {
- background: #303c2c;
- }
- .dark .composer {
- border-color: #43503e;
- }
- .dark .profile-button {
- background: #35412f;
- color: #b8c8aa;
- }
- .dark .overview > div {
- border-color: #43513e;
- }
- .dark .file-badge {
- border-color: #4c5e45;
- }
- .dark .avatar.clay {
- background: #40362e;
- color: #c6ab96;
- }
- .dark .avatar.lilac {
- background: #36313e;
- color: #b4a6cc;
- }
- .dark .connection-banner {
- background: #403729;
- color: #d8bb87;
- }
- .dark .profile-card .avatar {
- background: #38432e;
- color: #bbcca3;
- }
- @keyframes arrive {
- from {
- opacity: 0;
- transform: translateY(5px);
- }
- to {
- opacity: 1;
- transform: translateY(0);
- }
- }
- @keyframes fade {
- from {
- opacity: 0;
- }
- to {
- opacity: 1;
- }
- }
- @keyframes sheet-in {
- from {
- transform: translateY(50px);
- opacity: 0.3;
- }
- to {
- transform: translateY(0);
- opacity: 1;
- }
- }
- @keyframes drawer-in {
- from {
- transform: translateX(-35px);
- opacity: 0.4;
- }
- to {
- transform: translateX(0);
- opacity: 1;
- }
- }
- @keyframes pulse {
- 0%,
- 80%,
- 100% {
- opacity: 0.25;
- transform: translateY(0);
- }
- 40% {
- opacity: 1;
- transform: translateY(-3px);
- }
- }
- @media (max-width: 1200px) {
- .presentation {
- grid-template-columns: 1fr 424px;
- max-width: 1000px;
- gap: 65px;
- padding: 35px 60px;
- }
- .design-notes {
- display: none;
- }
- }
- @media (max-width: 820px) {
- .presentation {
- display: flex;
- justify-content: center;
- padding: 30px 0;
- min-height: 100dvh;
- }
- .intro {
- display: none;
- }
- .device {
- height: min(858px, calc(100dvh - 75px));
- }
- }
- @media (max-width: 520px) {
- body {
- background: var(--canvas);
- }
- .presentation {
- display: block;
- padding: 0;
- min-height: 0;
- }
- .device-wrap {
- width: 100%;
- }
- .device {
- width: 100%;
- height: 100dvh;
- min-height: 0;
- padding: 0;
- border: 0;
- border-radius: 0;
- box-shadow: none;
- }
- .statusbar,
- .home-indicator,
- .device-caption {
- display: none;
- }
- .app {
- height: 100%;
- border-radius: 0;
- padding-top: env(safe-area-inset-top);
- }
- .app-header {
- height: 64px;
- min-height: 64px;
- }
- #composer-area {
- padding-bottom: max(13px, env(safe-area-inset-bottom));
- }
- .tabbar {
- padding-bottom: max(9px, env(safe-area-inset-bottom));
- }
- .drawer {
- padding-top: max(19px, env(safe-area-inset-top));
- padding-bottom: max(20px, env(safe-area-inset-bottom));
- }
- .sheet {
- padding-bottom: max(25px, env(safe-area-inset-bottom));
- }
- .home-screen {
- padding-top: clamp(15px, 5vh, 42px);
- }
- .home-hero h1 {
- font-size: 32px;
- }
- .toast {
- bottom: 145px;
- }
- }
- @media (max-width: 360px) {
- .screen {
- padding-left: 18px;
- padding-right: 18px;
- }
- .home-hero h1 {
- font-size: 29px;
- }
- .home-hero p {
- font-size: 11px;
- }
- .home-screen {
- padding-top: 15px;
- }
- .hero-art {
- margin-bottom: 16px;
- width: 55px;
- height: 55px;
- }
- .home-hero .overline {
- font-size: 10px;
- }
- .agent-select {
- max-width: 180px;
- }
- .conversation-top strong {
- font-size: 12px;
- }
- }
- @media (max-height: 740px) {
- .home-screen {
- padding-top: 10px;
- }
- .hero-art {
- margin-bottom: 12px;
- width: 48px;
- height: 48px;
- border-radius: 16px;
- }
- .hero-art svg {
- width: 32px;
- height: 32px;
- }
- .home-hero h1 {
- font-size: 27px;
- line-height: 1.5;
- }
- .home-hero p {
- margin-top: 7px;
- }
- .prompts {
- padding-top: 12px;
- }
- .recent-block {
- padding-top: 14px;
- }
- .recent-row {
- padding: 9px 0;
- }
- .composer-footnote {
- margin-top: 7px;
- }
- .home-hero .overline {
- margin-bottom: 7px;
- }
- .home-screen {
- padding-bottom: 12px;
- }
- }
- @media (prefers-reduced-motion: reduce) {
- *,
- *:before,
- *:after {
- animation: none !important;
- transition: none !important;
- scroll-behavior: auto !important;
- }
- }
- .home-hero p {
- font-size: 13px;
- }
- .prompt {
- min-height: 44px;
- font-size: 12px;
- }
- .recent-row {
- min-height: 65px;
- }
- .recent-row strong {
- font-size: 14px;
- }
- .recent-row small {
- font-size: 11px;
- }
- .recent-row time {
- font-size: 11px;
- }
- .section-label {
- font-size: 11px;
- }
- .text-button {
- font-size: 12px;
- min-height: 44px;
- }
- .conversation-top strong {
- font-size: 14px;
- }
- .conversation-body p {
- font-size: 12px;
- }
- .conversation-meta {
- font-size: 10px;
- }
- .conversation-top time {
- font-size: 10px;
- }
- .segmented button {
- min-height: 44px;
- font-size: 13px;
- }
- .contact-row strong {
- font-size: 14px;
- }
- .contact-row small {
- font-size: 12px;
- }
- .tabbar button {
- font-size: 10px;
- }
- .page-subtitle {
- font-size: 12px;
- }
- .agent-card-head small {
- font-size: 11px;
- }
- .agent-current {
- font-size: 12px;
- }
- .agent-metrics {
- font-size: 10px;
- }
- .agent-actions button {
- min-height: 44px;
- font-size: 11px;
- }
- .sheet-description {
- font-size: 12px;
- }
- .sheet-list-button {
- min-height: 63px;
- }
- .sheet-list-button small {
- font-size: 11px;
- }
- .process summary {
- font-size: 11px;
- min-height: 44px;
- }
- .process ol {
- font-size: 12px;
- }
- .user-bubble {
- font-size: 14px;
- }
- .assistant-heading {
- font-size: 12px;
- }
- .settings-row {
- font-size: 14px;
- }
- .settings-row small {
- font-size: 11px;
- }
- .composer-tools .icon-button {
- width: 44px;
- min-width: 44px;
- height: 44px;
- }
- .send-button {
- width: 44px;
- height: 44px;
- min-height: 44px;
- }
- .agent-select {
- height: 44px;
- font-size: 11px;
- }
- .user-file svg {
- width: 13px;
- height: 13px;
- vertical-align: middle;
- }
- .hero-art {
- flex-shrink: 0;
- }
- .header-center {
- flex: 1;
- }
- .header-title {
- display: flex;
- align-items: center;
- justify-content: center;
- gap: 7px;
- min-height: 31px;
- width: 100%;
- padding: 0;
- }
- .header-title strong {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- font-size: 15px;
- }
- .header-title svg {
- width: 12px;
- height: 12px;
- color: var(--muted);
- }
- .subtitle-separator {
- color: var(--line);
- margin: 0 3px;
- }
- .collaboration-rail {
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 8px;
- padding: 0 2px 8px;
- }
- .quick-current {
- min-height: 44px;
- display: flex;
- align-items: center;
- gap: 6px;
- font-size: 11px;
- color: var(--secondary);
- padding: 0 7px;
- }
- .quick-current svg {
- width: 15px;
- height: 15px;
- }
- .quick-agent {
- color: var(--muted);
- }
- .activity-entry {
- min-height: 36px;
- display: flex;
- align-items: center;
- gap: 7px;
- font-size: 11px;
- color: var(--accent);
- padding: 0 11px;
- border: 1px solid var(--line);
- border-radius: 30px;
- background: var(--surface);
- position: relative;
- }
- .activity-entry:after {
- content: '';
- position: absolute;
- inset: -4px 0;
- }
- .activity-entry svg {
- width: 13px;
- height: 13px;
- }
- .activity-orbit {
- width: 7px;
- height: 7px;
- border: 1px solid var(--muted);
- border-radius: 50%;
- }
- .activity-orbit.running {
- border-color: var(--accent);
- background: var(--accent);
- box-shadow: 0 0 0 3px var(--tint);
- animation: breathe 2.6s ease-in-out infinite;
- }
- .attention-count {
- min-width: 17px;
- height: 17px;
- border-radius: 6px;
- color: #a56434;
- background: #f7eddf;
- display: grid;
- place-items: center;
- font-size: 9px;
- margin-left: 1px;
- }
- .activity-text {
- color: var(--muted);
- }
- .activity-text.running,
- .activity-text.done {
- color: var(--accent);
- }
- .activity-text.attention {
- color: #ac6941;
- }
- .inline-activity {
- font-size: 10px;
- display: inline-flex;
- align-items: center;
- gap: 5px;
- white-space: nowrap;
- }
- .inline-activity:before {
- content: '';
- width: 4px;
- height: 4px;
- border-radius: 50%;
- background: currentColor;
- }
- .conversation-meta .inline-activity {
- margin-left: auto;
- }
- .inline-activity.running {
- color: var(--accent);
- }
- .inline-activity.attention {
- color: #a86a40;
- }
- .inline-activity.done {
- color: #718468;
- }
- .inline-activity.idle {
- color: var(--muted);
- }
- .activity-sheet {
- height: 86%;
- }
- .activity-sheet .search-field {
- position: sticky;
- top: 0;
- z-index: 2;
- box-shadow: 0 -8px 0 8px var(--canvas);
- }
- .activity-sheet .segmented {
- position: sticky;
- top: 60px;
- background: var(--canvas);
- z-index: 2;
- padding-top: 2px;
- }
- .activity-sheet .segmented button {
- font-size: 11px;
- }
- .activity-group-label {
- display: flex;
- align-items: center;
- justify-content: space-between;
- font-size: 10px;
- color: var(--muted);
- padding: 12px 1px;
- }
- .activity-group-label .inline-activity {
- font-size: 11px;
- }
- .activity-card {
- display: flex;
- align-items: flex-start;
- gap: 10px;
- min-height: 91px;
- padding: 15px 11px;
- margin-bottom: 8px;
- border: 1px solid var(--line);
- border-radius: 15px;
- background: var(--surface);
- width: 100%;
- text-align: left;
- }
- .activity-card.current {
- background: var(--tint);
- border-color: transparent;
- }
- .activity-card.attention {
- border-color: #e7d6c1;
- }
- .activity-card-avatar {
- flex-shrink: 0;
- position: relative;
- }
- .activity-card-avatar .avatar {
- width: 33px;
- height: 33px;
- border-radius: 11px;
- }
- .activity-card-avatar .avatar svg {
- width: 20px;
- height: 20px;
- }
- .mini-state {
- display: inline-flex;
- width: 12px;
- height: 12px;
- border-radius: 50%;
- align-items: center;
- justify-content: center;
- flex-shrink: 0;
- font-size: 8px;
- }
- .mini-state.running {
- background: var(--accent);
- width: 6px;
- height: 6px;
- }
- .mini-state.attention {
- background: #ab7146;
- color: white;
- font-weight: 600;
- }
- .mini-state.done {
- background: var(--accent);
- color: var(--canvas);
- }
- .mini-state svg {
- width: 9px;
- height: 9px;
- stroke-width: 2;
- }
- .activity-card-avatar .mini-state {
- position: absolute;
- right: -2px;
- bottom: -2px;
- outline: 3px solid var(--surface);
- }
- .activity-card-avatar .mini-state.running {
- right: -1px;
- bottom: 0;
- }
- .activity-card-content {
- flex: 1;
- min-width: 0;
- }
- .activity-card-content strong {
- display: block;
- font-size: 12px;
- font-weight: 550;
- line-height: 1.6;
- }
- .activity-card-content > small {
- display: block;
- font-size: 10px;
- color: var(--muted);
- margin-top: 6px;
- }
- .activity-detail {
- display: block;
- color: var(--secondary);
- font-size: 10px;
- line-height: 1.7;
- margin-top: 9px;
- }
- .attention .activity-detail {
- color: #a86a40;
- }
- .activity-card-end {
- display: flex;
- align-items: flex-end;
- justify-content: space-between;
- flex-direction: column;
- align-self: stretch;
- width: 55px;
- flex-shrink: 0;
- }
- .activity-card-end svg {
- width: 14px;
- height: 14px;
- color: var(--muted);
- margin-top: 2px;
- }
- .activity-card-end small {
- font-size: 8px;
- color: var(--muted);
- white-space: nowrap;
- }
- .activity-card-end em {
- font-size: 9px;
- color: var(--accent);
- font-style: normal;
- }
- .activity-sheet-footer {
- margin-top: 16px;
- border-top: 1px solid var(--line);
- padding-top: 13px;
- display: flex;
- flex-direction: column;
- align-items: center;
- gap: 3px;
- }
- .activity-sheet-footer > span {
- font-size: 9px;
- color: var(--muted);
- text-align: center;
- }
- .activity-sheet-footer button {
- min-height: 44px;
- font-size: 10px;
- color: var(--secondary);
- }
- .drawer > .segmented {
- flex-shrink: 0;
- margin-top: 8px;
- margin-bottom: 1px;
- }
- .drawer > .segmented button {
- font-size: 11px;
- }
- .drawer-conversation {
- display: block;
- width: 100%;
- text-align: left;
- padding: 12px 9px;
- border-radius: 11px;
- min-height: 64px;
- }
- .drawer-conversation.active {
- background: var(--tint);
- }
- .drawer-conversation-title {
- display: flex;
- align-items: center;
- gap: 8px;
- font-size: 12px;
- line-height: 1.7;
- }
- .drawer-conversation-title > .mini-state {
- margin-left: auto;
- }
- .drawer-conversation > small {
- display: block;
- font-size: 10px;
- color: var(--muted);
- margin-top: 5px;
- }
- .drawer-agent-group {
- padding: 13px 0;
- border-bottom: 1px solid var(--line);
- }
- .drawer-agent-head {
- display: flex;
- gap: 8px;
- align-items: center;
- padding-left: 5px;
- }
- .drawer-agent-head .avatar {
- width: 30px;
- height: 30px;
- border-radius: 10px;
- }
- .drawer-agent-head .avatar svg {
- width: 18px;
- height: 18px;
- }
- .drawer-agent-head strong {
- font-size: 12px;
- font-weight: 550;
- display: block;
- }
- .drawer-agent-head small {
- display: block;
- font-size: 9px;
- margin-top: 4px;
- color: var(--muted);
- }
- .drawer-agent-head > .inline-activity,
- .drawer-agent-head > small {
- margin-left: auto;
- }
- .drawer-agent-new {
- width: 35px;
- min-height: 44px;
- display: grid;
- place-items: center;
- padding: 0;
- }
- .drawer-agent-new svg {
- width: 15px;
- color: var(--secondary);
- }
- .drawer-archive {
- min-height: 41px;
- display: flex;
- align-items: center;
- gap: 8px;
- width: 100%;
- font-size: 10px;
- color: var(--muted);
- flex-shrink: 0;
- }
- .drawer-archive svg {
- width: 14px;
- height: 14px;
- }
- .drawer-archive svg:last-child {
- margin-left: auto;
- }
- .drawer-nav {
- padding-top: 8px;
- }
- .regenerate-title {
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
- gap: 8px;
- min-height: 47px;
- font-size: 12px;
- border: 1px solid var(--line);
- border-radius: 13px;
- margin-top: 11px;
- color: var(--secondary);
- }
- .regenerate-title svg {
- width: 15px;
- height: 15px;
- }
- .regenerate-title span {
- font-size: 9px;
- color: var(--muted);
- }
- .title-protection {
- display: flex;
- align-items: flex-start;
- gap: 6px;
- font-size: 10px;
- line-height: 1.9;
- color: var(--muted);
- margin: 16px 0 3px;
- }
- .title-protection svg {
- width: 13px;
- height: 13px;
- margin-top: 3px;
- }
- .blank-chat {
- height: 100%;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- text-align: center;
- padding-bottom: 75px;
- }
- .blank-chat-mark {
- width: 66px;
- height: 66px;
- display: grid;
- place-items: center;
- background: var(--tint);
- color: var(--accent);
- border-radius: 24px;
- margin-bottom: 23px;
- }
- .blank-chat-mark svg {
- width: 38px;
- height: 38px;
- }
- .blank-chat h1 {
- font-size: 24px;
- font-weight: 500;
- letter-spacing: -0.8px;
- }
- .blank-chat p {
- font-size: 12px;
- color: var(--muted);
- line-height: 2;
- margin-top: 15px;
- }
- .completion-banner {
- position: absolute;
- top: 105px;
- left: 19px;
- right: 19px;
- display: flex;
- align-items: center;
- gap: 10px;
- background: var(--surface);
- padding: 14px 10px 14px 14px;
- z-index: 25;
- box-shadow: 0 10px 35px #233a2620;
- border: 1px solid var(--line);
- border-radius: 17px;
- animation: arrive 0.25s ease;
- }
- .completion-mark {
- background: var(--tint);
- color: var(--accent);
- width: 31px;
- height: 31px;
- display: grid;
- place-items: center;
- border-radius: 50%;
- flex-shrink: 0;
- }
- .completion-mark svg {
- width: 17px;
- }
- .completion-banner > button {
- text-align: left;
- padding: 0;
- flex: 1;
- min-width: 0;
- }
- .completion-banner > button strong {
- font-size: 12px;
- font-weight: 550;
- display: block;
- }
- .completion-banner > button small {
- display: block;
- font-size: 10px;
- line-height: 1.7;
- color: var(--muted);
- margin-top: 5px;
- }
- .completion-banner > button:last-child {
- width: 35px;
- flex: 0 0 35px;
- min-height: 44px;
- display: grid;
- place-items: center;
- color: var(--muted);
- }
- .completion-banner > button:last-child svg {
- width: 15px;
- }
- .prototype-shortcuts {
- margin-top: 20px;
- display: flex;
- flex-direction: column;
- }
- .prototype-shortcuts button {
- display: flex;
- align-items: center;
- gap: 6px;
- min-height: 35px;
- padding: 0;
- font-size: 10px;
- color: #748268;
- text-align: left;
- }
- .prototype-shortcuts svg {
- width: 12px;
- height: 12px;
- }
- .scope-note {
- margin-top: 20px;
- }
- @keyframes breathe {
- 50% {
- box-shadow: 0 0 0 5px var(--tint);
- }
- }
- .sheet-handle {
- width: 100%;
- min-height: 25px;
- height: 25px;
- margin: 0;
- background: none;
- position: relative;
- touch-action: none;
- cursor: grab;
- }
- .sheet-handle:before {
- content: '';
- position: absolute;
- left: calc(50% - 17px);
- top: 10px;
- width: 34px;
- height: 4px;
- background: var(--line);
- border-radius: 4px;
- }
- .skeleton-list {
- padding-top: 10px;
- }
- .skeleton-row {
- display: flex;
- align-items: center;
- gap: 12px;
- padding: 19px 0;
- border-bottom: 1px solid var(--line);
- }
- .skeleton-row > span {
- width: 39px;
- height: 39px;
- border-radius: 14px;
- background: var(--soft);
- }
- .skeleton-row > div {
- flex: 1;
- }
- .skeleton-row i {
- display: block;
- width: 78%;
- height: 11px;
- background: var(--soft);
- border-radius: 5px;
- }
- .skeleton-row i:last-child {
- width: 55%;
- height: 8px;
- margin-top: 12px;
- }
- @media (max-width: 520px) {
- .device {
- height: var(--visual-height, 100dvh);
- }
- .completion-banner {
- top: calc(70px + env(safe-area-inset-top));
- }
- }
- @media (max-width: 360px) {
- .activity-card {
- gap: 8px;
- padding: 12px 9px;
- }
- .activity-card-content strong {
- font-size: 11px;
- }
- .activity-card-end {
- width: 44px;
- }
- .activity-card-end small {
- font-size: 7px;
- }
- .quick-agent {
- display: none;
- }
- }
- @media (prefers-reduced-motion: reduce) {
- .activity-orbit.running {
- animation: none;
- }
- }
- </style>
- </head>
- <body>
- <div class="presentation">
- <aside class="intro">
- <a class="studio-brand" href="#/home"
- ><span data-icon="flower"></span> fmode<span class="edition">MOBILE STUDY / 01</span></a
- >
- <div class="intro-copy">
- <div class="eyebrow">不止是聊天,更是多线协作</div>
- <h1>一手掌控。<br />多线从容。</h1>
- <p>知道谁在工作,记得聊到哪里。<br />在每一段协作之间,自如切换。</p>
- <span class="proposal-tag"><i class="dot"></i> 交互提案 · 非生产环境</span>
- </div>
- <div class="scene-switch" aria-label="原型场景">
- <span class="eyebrow">从这里开始体验</span
- ><button data-scene="chat">
- <span>01</span> 沉浸式协作 <span data-icon="arrow-right"></span></button
- ><button data-experience="activity">
- <span>02</span> 一步切换,进展在握 <span data-icon="arrow-right"></span></button
- ><button data-scene="messages">
- <span>03</span> 找回之前的想法 <span data-icon="arrow-right"></span></button
- ><button data-scene="home">
- <span>04</span> 开始新的想法 <span data-icon="arrow-right"></span>
- </button>
- </div>
- <div class="intro-footer">
- FMODE / MOBILE EXPERIENCE<br /><span>独立 HTML 原型 · 2026.11.16</span>
- </div>
- </aside>
- <div class="device-wrap">
- <div class="device" id="device">
- <div class="statusbar" aria-hidden="true">
- <span>9:41</span>
- <div class="island"></div>
- <div class="status-icons">
- <span data-icon="signal"></span><span data-icon="wifi"></span
- ><span data-icon="battery"></span>
- </div>
- </div>
- <div class="app" id="app">
- <header id="app-header" class="app-header"></header>
- <main id="main" tabindex="-1"></main>
- <div id="composer-area"></div>
- <nav id="tabbar" class="tabbar" aria-label="主导航"></nav>
- </div>
- <div id="overlay-root"></div>
- <div id="toast" class="toast" role="status" aria-live="polite"></div>
- <div class="home-indicator" aria-hidden="true"></div>
- </div>
- <div class="device-caption">
- <i class="dot"></i> 可交互原型 <span>·</span> 点击、输入,试试看
- </div>
- </div>
- <aside class="design-notes">
- <span class="eyebrow">体验,而不是功能重做</span>
- <div class="note">
- <span>01 / AWARENESS</span>
- <h2>专注这一件,也看得见全局</h2>
- <p>输入坞上沿,一步打开协作动态。进行中、待关注、已完成,不再只靠猜。</p>
- </div>
- <div class="note">
- <span>02 / REACH</span>
- <h2>切换靠近拇指,不挤发送按钮</h2>
- <p>新建、切换与发送各有位置。Enter 只换行,避免把未写完的想法发出去。</p>
- </div>
- <div class="note">
- <span>03 / CONTINUITY</span>
- <h2>按会话记住,不按分身覆盖</h2>
- <p>切换保留草稿。标题可直接编辑,同一数字生命中新建,不必重新选人。</p>
- </div>
- <div class="prototype-shortcuts">
- <button data-experience="title">体验标题编辑 <span data-icon="arrow-right"></span></button
- ><button data-experience="complete">
- 体验完成提醒 <span data-icon="arrow-right"></span>
- </button>
- </div>
- <div class="scope-note">
- <span data-icon="shield"></span
- ><span>不接真实接口,不修改现有项目。<br />所有消息、文件和余额均为演示。</span>
- </div>
- </aside>
- </div>
- <input id="file-input" type="file" multiple hidden />
- <script>
- const icons = {
- menu: '<path d="M4 7h16M4 12h11M4 17h16"/>',
- flower: Array.from(
- { length: 8 },
- (_, index) =>
- `<ellipse cx="12" cy="7.3" rx="2.15" ry="4.6" transform="rotate(${index * 45} 12 12)"/>`,
- ).join(''),
- 'arrow-right': '<path d="M5 12h14m-5-5 5 5-5 5"/>',
- 'arrow-up': '<path d="M12 19V5m-6 6 6-6 6 6"/>',
- back: '<path d="m14 5-7 7 7 7"/>',
- chevron: '<path d="m8 10 4 4 4-4"/>',
- right: '<path d="m9 6 6 6-6 6"/>',
- plus: '<path d="M12 5v14M5 12h14"/>',
- close: '<path d="m6 6 12 12M6 18 18 6"/>',
- 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"/>',
- edit: '<path d="M12 4H4v16h16v-8M10 14l1-4L19 2l3 3-8 8Z"/>',
- search: '<circle cx="10.5" cy="10.5" r="6.5"/><path d="m16 16 4 4"/>',
- people:
- '<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"/>',
- 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"/>',
- user: '<circle cx="12" cy="8" r="4"/><path d="M4 21v-2a8 8 0 0 1 16 0v2"/>',
- more: '<circle cx="5" cy="12" r=".9"/><circle cx="12" cy="12" r=".9"/><circle cx="19" cy="12" r=".9"/>',
- 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"/>',
- archive: '<rect x="3" y="4" width="18" height="4" rx="1"/><path d="M5 8v12h14V8M10 12h4"/>',
- file: '<path d="M14 3H5v18h14V8Zm0 0v6h5M8 13h8M8 17h6"/>',
- clip: '<path d="m8 13 7-7a3 3 0 0 1 4 4L9 20a5 5 0 0 1-7-7L13 2"/>',
- check: '<path d="m5 12 4 4L19 6"/>',
- shield: '<path d="m12 3 8 3v6c0 5-8 9-8 9s-8-4-8-9V6Z"/><path d="m8 12 3 3 5-6"/>',
- copy: '<rect x="8" y="8" width="12" height="13" rx="2"/><path d="M15 8V3H3v13h5"/>',
- moon: '<path d="M20 14A8 8 0 0 1 10 4a8.5 8.5 0 1 0 10 10Z"/>',
- bell: '<path d="M5 17h14l-2-4V9a5 5 0 0 0-10 0v4Zm5 3h4"/>',
- key: '<circle cx="8" cy="9" r="5"/><path d="m12 13 8 8m-4-4 3-3"/>',
- 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"/>',
- logout: '<path d="M10 4H4v16h6m5-12 5 4-5 4m-6-4h11"/>',
- 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"/>',
- wallet: '<rect x="3" y="5" width="18" height="15" rx="2"/><path d="M3 8h18m-5 4h5v5h-5Z"/>',
- trash: '<path d="M3 6h18M9 6V3h6v3M5 6l1 15h12l1-15M10 10v7m4-7v7"/>',
- download: '<path d="M12 3v12m-5-5 5 5 5-5M4 16v5h16v-5"/>',
- spark: '<path d="m12 3 2.5 6.5L21 12l-6.5 2.5L12 21l-2.5-6.5L3 12l6.5-2.5Z"/>',
- 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"/>',
- signal: '<path d="M4 19v-3m5 3v-6m5 6V9m5 10V5" stroke-width="2.8"/>',
- battery:
- '<rect x="2" y="6" width="18" height="12" rx="3"/><path d="M22 10v4M5 9h12v6H5Z" fill="currentColor" stroke="none"/>',
- };
- const icon = (name, className = '') =>
- `<svg class="${className}" viewBox="0 0 24 24" aria-hidden="true">${icons[name] || icons.spark}</svg>`;
- const esc = (value) =>
- String(value).replace(
- /[&<>"']/g,
- (character) =>
- ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[character],
- );
- const ib = (name, label, action, extra = '') =>
- `<button class="icon-button" aria-label="${esc(label)}" data-action="${action}" ${extra}>${icon(name)}</button>`;
- const agents = [
- {
- id: 'a1',
- name: '小禾',
- role: '研究与写作伙伴',
- tone: '',
- online: true,
- cpu: '12%',
- memory: '328 MB',
- balance: '128.60',
- task: '正在整理产品体验调研',
- symbol: 'flower',
- },
- {
- id: 'a2',
- name: '阿澈',
- role: '开发与技术伙伴',
- tone: 'clay',
- online: true,
- cpu: '8%',
- memory: '256 MB',
- balance: '86.20',
- task: '等待新的协作指令',
- symbol: 'grid',
- },
- {
- id: 'a3',
- name: '知夏',
- role: '设计与创意伙伴',
- tone: 'lilac',
- online: false,
- cpu: '—',
- memory: '—',
- balance: '42.00',
- task: '当前离线,连接恢复后继续协作',
- symbol: 'spark',
- },
- ];
- const conversations = [
- {
- id: 'c1',
- title: '把产品的第一印象做好',
- agentId: 'a1',
- preview: '我整理了三个可以落地的优化方向。',
- time: '刚刚',
- group: '今天',
- workspace: 'w1',
- unread: 2,
- archived: false,
- },
- {
- id: 'c2',
- title: '官网首页的灵感与参考',
- agentId: 'a3',
- preview: '留白、秩序,以及一点点恰好的温度。',
- time: '10:24',
- group: '今天',
- workspace: 'w1',
- unread: 0,
- archived: false,
- },
- {
- id: 'c3',
- title: '梳理一下这周的工作',
- agentId: 'a1',
- preview: '已按优先级整理好,随时可以继续。',
- time: '昨天',
- group: '昨天',
- workspace: null,
- unread: 0,
- archived: false,
- },
- {
- id: 'c4',
- title: '登录接口联调记录',
- agentId: 'a2',
- preview: '接口参数和错误处理已经检查完毕。',
- time: '昨天',
- group: '昨天',
- workspace: 'w2',
- unread: 1,
- archived: false,
- },
- {
- id: 'c5',
- title: '一些还没成形的小想法',
- agentId: 'a1',
- preview: '我们可以从一个最小的版本开始。',
- time: '周五',
- group: '更早',
- workspace: null,
- unread: 0,
- archived: false,
- },
- {
- id: 'c6',
- title: '上一版品牌文案',
- agentId: 'a1',
- preview: '品牌文案讨论已归档。',
- time: '11/08',
- group: '更早',
- workspace: 'w1',
- unread: 0,
- archived: true,
- },
- ];
- let workspaces = [
- { id: 'w1', name: '产品与灵感' },
- { id: 'w2', name: '研发协作' },
- ];
- const messages = new Map();
- const collaboration = new Map([
- ['c1', { kind: 'done', label: '体验优化建议已交付', elapsed: '刚刚完成' }],
- ['c2', { kind: 'attention', label: '连接中断,等待恢复', elapsed: '需要关注' }],
- ['c3', { kind: 'running', label: '正在整理本周的优先级', elapsed: '已进行 2 分钟' }],
- ['c4', { kind: 'running', label: '正在检查接口返回结果', elapsed: '已进行 45 秒' }],
- ['c5', { kind: 'idle', label: '等待新的想法', elapsed: '空闲' }],
- ]);
- const activityNames = { running: '进行中', attention: '待关注', done: '已完成', idle: '空闲' };
- const drafts = new Map();
- const draftKey = () => (state.page === 'chat' ? state.currentId : 'home');
- function saveDraft() {
- if (['home', 'chat'].includes(state.page))
- drafts.set(draftKey(), { text: state.draft, files: [...state.attachments] });
- }
- function restoreDraft() {
- const draft = drafts.get(draftKey());
- state.draft = draft?.text || '';
- state.attachments = [...(draft?.files || [])];
- }
- let preferences = { dark: false, palette: 'forest', font: 14 };
- try {
- preferences = {
- ...preferences,
- ...JSON.parse(localStorage.getItem('fmode_mobile_proposal_v1') || '{}'),
- };
- } catch {}
- const state = {
- page: 'home',
- currentId: 'c1',
- agentId: null,
- draft: '',
- attachments: [],
- filter: 'all',
- contactFilter: 'agents',
- agentFilter: 'all',
- keyword: '',
- expanded: new Set(),
- drawerExpanded: new Set(),
- pendingSend: false,
- newWorkspace: null,
- generating: false,
- disconnected: false,
- tokenVisible: false,
- drawerView: 'recent',
- activityFilter: 'all',
- activityKeyword: '',
- ...preferences,
- };
- const main = document.querySelector('#main'),
- header = document.querySelector('#app-header'),
- composerArea = document.querySelector('#composer-area'),
- tabbar = document.querySelector('#tabbar'),
- overlay = document.querySelector('#overlay-root'),
- app = document.querySelector('#app');
- let returnFocus, toastTimer, generationTimer;
- const getAgent = (agentId) => agents.find((agent) => agent.id === agentId) || agents[0];
- const getConversation = (identifier = state.currentId) =>
- conversations.find((conversation) => conversation.id === identifier);
- const avatar = (agent) => `<span class="avatar ${agent.tone}">${icon(agent.symbol)}</span>`;
- const activeConversations = () => conversations.filter((conversation) => !conversation.archived);
- const navItems = [
- ['messages', 'chat', '会话'],
- ['contacts', 'people', '通讯录'],
- ['workbench', 'grid', '工作台'],
- ['mine', 'user', '我的'],
- ];
- const emptyState = (title, description = '', symbol = 'search') =>
- `<div class="empty-state">${icon(symbol)}<strong>${title}</strong><p>${description}</p></div>`;
- const tabs = (items, active, action) =>
- `<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>`;
- const searchField = (placeholder, action = 'search', value = '') =>
- `<label class="search-field">${icon('search')}<input type="search" aria-label="${placeholder}" placeholder="${placeholder}" data-input="${action}" value="${esc(value)}" /></label>`;
- const navigation = () =>
- navItems
- .map(
- ([page, symbol, label]) =>
- `<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>`,
- )
- .join('');
- function applyPreferences() {
- const device = document.querySelector('#device');
- device.classList.toggle('dark', state.dark);
- const palettes = {
- forest: ['#386b52', '#eaf1e8', '#a4c59a', '#303f30'],
- blue: ['#496a96', '#eaf0f8', '#a5bde0', '#2e3c50'],
- purple: ['#806495', '#f0eaf5', '#c9acdf', '#403349'],
- amber: ['#9a7641', '#f4efdf', '#ddc195', '#443a27'],
- };
- const palette = palettes[state.palette] || palettes.forest;
- device.style.setProperty('--accent', palette[state.dark ? 2 : 0]);
- device.style.setProperty('--tint', palette[state.dark ? 3 : 1]);
- device.style.setProperty('--chat-font', `${state.font}px`);
- try {
- localStorage.setItem(
- 'fmode_mobile_proposal_v1',
- JSON.stringify({ dark: state.dark, palette: state.palette, font: state.font }),
- );
- } catch {}
- }
- function navigate(page, identifier) {
- const destination =
- page === 'chat'
- ? `#/chat/${identifier || state.currentId}`
- : page === 'agent'
- ? `#/agent/${identifier}`
- : `#/${page}`;
- if (location.hash === destination) readRoute();
- else location.hash = destination;
- }
- function readRoute() {
- saveDraft();
- const [page = 'home', identifier] = location.hash.replace(/^#\/?/, '').split('/');
- state.page = ['home', 'chat', 'messages', 'contacts', 'workbench', 'mine', 'agent'].includes(page)
- ? page
- : 'home';
- if (state.page === 'chat') {
- const conversation = getConversation(identifier);
- if (conversation) {
- state.currentId = identifier;
- conversation.unread = 0;
- } else state.page = 'messages';
- }
- if (state.page === 'agent') state.detailAgentId = identifier;
- state.keyword = '';
- restoreDraft();
- closeOverlay();
- render();
- main.scrollTop = 0;
- }
- function render() {
- const conversation = getConversation(),
- agent = getAgent(conversation?.agentId);
- if (state.page === 'chat')
- 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')}`;
- else if (state.page === 'home')
- 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>`;
- else if (state.page === 'agent')
- header.innerHTML = `${ib('back', '返回通讯录', 'navigate', 'data-page="contacts"')}<strong class="page-title">数字生命设置</strong>`;
- else
- 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>'}`;
- ({
- home: renderHome,
- chat: renderChat,
- messages: renderMessages,
- contacts: renderContacts,
- workbench: renderWorkbench,
- mine: renderMine,
- agent: renderAgent,
- })[state.page]();
- if (state.page === 'chat' && messages.get(state.currentId)?.length === 0) {
- 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>`;
- }
- if (state.page === 'mine')
- main
- .querySelector('.version-text')
- .insertAdjacentHTML(
- 'beforeend',
- '<br /><button class="text-button" data-action="preview-states">查看加载与反馈状态 · 原型专用</button>',
- );
- tabbar.innerHTML = ['messages', 'contacts', 'workbench', 'mine'].includes(state.page)
- ? navigation()
- : '';
- if (['home', 'chat'].includes(state.page)) renderComposer();
- else composerArea.innerHTML = '';
- document
- .querySelectorAll('[data-scene]')
- .forEach((button) => button.classList.toggle('active', button.dataset.scene === state.page));
- applyPreferences();
- }
- function renderHome() {
- 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()
- .slice(0, 2)
- .map(
- (conversation) =>
- `<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>`,
- )
- .join('')}</div></section>`;
- }
- function renderComposer() {
- const agentId = state.page === 'chat' ? getConversation()?.agentId : state.agentId,
- agent = agentId ? getAgent(agentId) : null;
- 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>`;
- if (state.page === 'chat') {
- const running = activeConversations().filter(
- (conversation) => collaboration.get(conversation.id)?.kind === 'running',
- ).length;
- const attention = activeConversations().filter(
- (conversation) => collaboration.get(conversation.id)?.kind === 'attention',
- ).length;
- composerArea.insertAdjacentHTML(
- 'afterbegin',
- `<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>`,
- );
- }
- const textarea = document.querySelector('#draft');
- textarea.setAttribute('enterkeyhint', 'enter');
- textarea.style.height = 'auto';
- textarea.style.height = `${Math.min(textarea.scrollHeight, 116)}px`;
- }
- function conversationRow(conversation) {
- const agent = getAgent(conversation.agentId);
- 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>`;
- }
- function renderMessages() {
- main.innerHTML = `<section class="screen"><p class="page-subtitle">每一次对话,都是想法向前的一步。</p>${searchField('搜索会话或数字生命', 'search', state.keyword)}${tabs(
- [
- ['all', '全部'],
- ['unread', '未读'],
- ['workspace', '工作区'],
- ],
- state.filter,
- 'message-filter',
- )}<div id="conversation-results">${conversationResults()}</div></section>`;
- }
- function conversationResults() {
- const keyword = state.keyword.trim().toLowerCase(),
- filtered = activeConversations().filter(
- (conversation) =>
- (state.filter !== 'unread' || conversation.unread > 0) &&
- `${conversation.title} ${getAgent(conversation.agentId).name}`
- .toLowerCase()
- .includes(keyword),
- );
- if (state.filter === 'workspace')
- return `<button class="text-button" data-action="create-workspace">${icon('plus')} 新建工作区</button>${workspaces
- .map((workspace) => {
- const rows = filtered.filter((conversation) => conversation.workspace === workspace.id);
- if (keyword && !rows.length && !workspace.name.includes(keyword)) return '';
- 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>`;
- })
- .join('')}`;
- if (!filtered.length)
- return emptyState(
- state.filter === 'unread' ? '未读已清空,安心专注' : '没有找到相关对话',
- state.filter === 'unread' ? '新的消息会出现在这里。' : '换个关键词再试试。',
- );
- return ['今天', '昨天', '更早']
- .map((group) => {
- const rows = filtered.filter((conversation) => conversation.group === group);
- return rows.length
- ? `<div class="group-heading">${group}</div>${rows.map(conversationRow).join('')}`
- : '';
- })
- .join('');
- }
- const sampleAnswer =
- '<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>';
- function sampleMessages(conversation) {
- if (conversation.id === 'c1')
- return [
- { role: 'user', text: '我们来想想,怎么把产品的第一印象做得更好?' },
- { role: 'assistant', html: sampleAnswer, file: true },
- ];
- return [
- { role: 'user', text: conversation.title },
- {
- role: 'assistant',
- html: `<p>${esc(conversation.preview)}</p><p>这段对话保留在「${esc(workspaces.find((workspace) => workspace.id === conversation.workspace)?.name || '日常对话')}」中,你可以接着补充想法。</p><blockquote>这是界面演示内容,不是真实的历史消息。</blockquote>`,
- },
- ];
- }
- function fileCard() {
- 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>`;
- }
- function renderChat() {
- const conversation = getConversation(),
- agent = getAgent(conversation.agentId);
- if (!messages.has(conversation.id)) messages.set(conversation.id, sampleMessages(conversation));
- const rows = messages.get(conversation.id);
- 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>`;
- }
- function renderContacts() {
- main.innerHTML = `<section class="screen">${tabs(
- [
- ['agents', '数字生命'],
- ['coworkers', '同事'],
- ],
- state.contactFilter,
- 'contact-filter',
- )}${searchField('搜索联系人', 'contact-search', state.keyword)}<div id="contact-results">${contactResults()}</div></section>`;
- }
- function contactResults() {
- if (state.contactFilter === 'coworkers') {
- const people = [
- { name: '林一', role: '产品设计 · 我', initial: '林' },
- { name: '陈序', role: '研发协作', initial: '陈' },
- ].filter((person) => person.name.includes(state.keyword));
- return people.length
- ? `<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('')}`
- : emptyState('没有找到联系人');
- }
- const filtered = agents.filter((agent) => `${agent.name} ${agent.role}`.includes(state.keyword));
- return filtered.length
- ? `<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('')}`
- : emptyState('没有找到数字生命');
- }
- function renderWorkbench() {
- 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(
- [
- ['all', '全部'],
- ['online', '在线'],
- ['offline', '离线'],
- ],
- state.agentFilter,
- 'agent-filter',
- )}${searchField('搜索数字生命', 'agent-search', state.keyword)}<div id="agent-results">${agentResults()}</div></section>`;
- }
- function agentResults() {
- const filtered = agents.filter(
- (agent) =>
- agent.name.includes(state.keyword) &&
- (state.agentFilter === 'all' || agent.online === (state.agentFilter === 'online')),
- );
- return filtered.length
- ? filtered
- .map(
- (agent) =>
- `<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>`,
- )
- .join('')
- : emptyState('没有匹配的数字生命');
- }
- function renderMine() {
- 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">${[
- ['forest', '#386b52', '森林'],
- ['blue', '#496a96', '湖蓝'],
- ['purple', '#806495', '暮紫'],
- ['amber', '#9a7641', '暖砂'],
- ]
- .map(
- ([value, color, label]) =>
- `<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>`,
- )
- .join(
- '',
- )}</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>`;
- }
- function renderAgent() {
- const agent = getAgent(state.detailAgentId);
- 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>`;
- }
- function openOverlay(html) {
- if (!overlay.childElementCount) returnFocus = document.activeElement;
- overlay.innerHTML = html;
- app.inert = true;
- requestAnimationFrame(() => {
- const target = overlay.querySelector('[autofocus]') || overlay.querySelector('button,input,select,summary');
- target?.focus({ preventScroll: true });
- });
- }
- function closeOverlay() {
- const wasOpen = overlay.childElementCount > 0;
- overlay.innerHTML = '';
- app.inert = false;
- state.pendingSend = false;
- if (wasOpen && returnFocus?.isConnected) returnFocus.focus({ preventScroll: true });
- }
- function sheet(title, content, extra = '') {
- openOverlay(
- `<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>`,
- );
- }
- function drawerHistory(keyword = '') {
- if (state.drawerView === 'recent') {
- const recent = activeConversations().filter((conversation) =>
- `${conversation.title} ${getAgent(conversation.agentId).name} ${workspaces.find((workspace) => workspace.id === conversation.workspace)?.name || ''}`.includes(
- keyword,
- ),
- );
- return `<div class="group-heading">最近的协作<span>${recent.length} 段对话</span></div>${recent.map((conversation) => drawerConversation(conversation)).join('') || emptyState('没有找到对话', '换个关键词再试试。')}`;
- }
- if (state.drawerView === 'agents') {
- return (
- agents
- .map((agent) => {
- const rows = activeConversations().filter(
- (conversation) =>
- conversation.agentId === agent.id &&
- `${conversation.title} ${agent.name}`.includes(keyword),
- );
- if (!rows.length) return '';
- const running = rows.filter(
- (conversation) => collaboration.get(conversation.id)?.kind === 'running',
- ).length;
- 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>`;
- })
- .join('') || emptyState('没有找到对话')
- );
- }
- const matches = (conversation) =>
- `${conversation.title} ${getAgent(conversation.agentId).name}`.includes(keyword),
- row = (conversation) =>
- `<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>`;
- return `${workspaces
- .map(
- (workspace) =>
- `<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>${
- state.drawerExpanded.has(workspace.id) || keyword
- ? activeConversations()
- .filter(
- (conversation) =>
- conversation.workspace === workspace.id && matches(conversation),
- )
- .map(row)
- .join('')
- : ''
- }`,
- )
- .join(
- '',
- )}<button class="text-button" data-action="create-workspace">${icon('plus')} 新建工作区</button><div class="group-heading">日常对话</div>${
- activeConversations()
- .filter((conversation) => !conversation.workspace && matches(conversation))
- .map(row)
- .join('') || '<p class="sheet-description">暂无匹配对话</p>'
- }<button class="drawer-history" data-action="show-archived">${icon('archive')}已归档 <span style="margin-left:auto">${conversations.filter((conversation) => conversation.archived).length}</span></button>`;
- }
- function openDrawer() {
- openOverlay(
- `<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>`,
- );
- overlay.querySelector('.search-field').insertAdjacentHTML(
- 'afterend',
- tabs(
- [
- ['recent', '最近'],
- ['agents', '数字生命'],
- ['workspace', '工作区'],
- ],
- state.drawerView,
- 'drawer-view',
- ),
- );
- overlay
- .querySelector('.drawer-scroll')
- .insertAdjacentHTML(
- 'afterend',
- '<button class="drawer-archive" data-action="show-archived">' +
- icon('archive') +
- '已归档对话' +
- icon('right') +
- '</button>',
- );
- }
- function pickAgent(pending = false) {
- sheet(
- '和谁一起开始?',
- `<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>`,
- );
- state.pendingSend = pending;
- }
- function details(tab = 'task') {
- const agent = getAgent(getConversation().agentId),
- content = {
- 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>`,
- file: `${fileCard()}<p class="sheet-description">演示文件内容为静态预览,不会上传或读取云盘。</p>`,
- deliver: `<div class="sheet-item"><span class="tag">v1.0</span><strong>产品初体验优化建议</strong><p>今天 10:42 · ${esc(agent.name)} 已交付</p>${fileCard()}</div>`,
- 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>`,
- };
- if (state.currentId !== 'c1' && tab !== 'state')
- content[tab] = emptyState(
- tab === 'task' ? '还没有任务' : tab === 'file' ? '还没有文件' : '还没有成果',
- '这段对话中的内容会显示在这里。',
- tab === 'task' ? 'check' : 'file',
- );
- sheet(
- '会话详情',
- content[tab] || content.task,
- tabs(
- [
- ['task', '任务'],
- ['file', '文件'],
- ['deliver', '成果'],
- ['state', '状态'],
- ],
- tab,
- 'detail-tab',
- ),
- );
- }
- function previewFile() {
- sheet(
- '文档预览',
- `<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>`,
- );
- }
- function formSheet(title, label, value, submitAction, identifier = '') {
- sheet(
- title,
- `<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>`,
- );
- }
- function confirmation(title, description, action, identifier) {
- sheet(
- title,
- `<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>`,
- );
- }
- function conversationMenu(identifier) {
- const conversation = getConversation(identifier);
- sheet(
- '管理这段对话',
- `<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>`,
- );
- }
- function drawerConversation(conversation) {
- const status = collaboration.get(conversation.id)?.kind || 'idle';
- const workspace =
- workspaces.find((item) => item.id === conversation.workspace)?.name || '日常对话';
- 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>`;
- }
- function activityResults() {
- const rows = activeConversations().filter((conversation) => {
- const status = collaboration.get(conversation.id)?.kind;
- return (
- status &&
- status !== 'idle' &&
- (state.activityFilter === 'all' || status === state.activityFilter) &&
- `${conversation.title} ${getAgent(conversation.agentId).name}`.includes(state.activityKeyword)
- );
- });
- return (
- ['running', 'attention', 'done']
- .map((kind) => {
- const group = rows.filter(
- (conversation) => collaboration.get(conversation.id)?.kind === kind,
- );
- if (!group.length) return '';
- return `<div class="activity-group-label"><span class="inline-activity ${kind}">${activityNames[kind]}</span><span>${group.length}</span></div>${group
- .map((conversation) => {
- const activity = collaboration.get(conversation.id);
- const agent = getAgent(conversation.agentId);
- const workspace =
- workspaces.find((item) => item.id === conversation.workspace)?.name || '日常对话';
- 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>`;
- })
- .join('')}`;
- })
- .join('') || emptyState('这里暂时没有协作动态', '切换筛选,看看其他会话。', 'check')
- );
- }
- function openActivity() {
- const count = (kind) =>
- activeConversations().filter(
- (conversation) => collaboration.get(conversation.id)?.kind === kind,
- ).length;
- sheet(
- '切换协作',
- `<p class="sheet-description">不用退出对话,也能知道每件事的进展。</p>${searchField('搜索正在协作的事', 'activity-search', state.activityKeyword)}${tabs(
- [
- ['all', '全部'],
- ['running', '进行中 ' + count('running')],
- ['attention', '待关注 ' + count('attention')],
- ['done', '已完成 ' + count('done')],
- ],
- state.activityFilter,
- 'activity-filter',
- )}<div id="activity-results">${activityResults()}</div><div class="activity-sheet-footer"><span>会话状态演示 · 不等于数字生命在线状态</span><button data-action="complete-demo">模拟完成提醒</button></div>`,
- );
- overlay.querySelector('.sheet').classList.add('activity-sheet');
- }
- function quickCurrent() {
- if (state.generating) {
- toast('演示回复完成后即可新建');
- return;
- }
- const previous = getConversation();
- saveDraft();
- const identifier = `c${Date.now()}`;
- conversations.unshift({
- id: identifier,
- title: '新对话',
- agentId: previous.agentId,
- preview: '等待你的第一个想法',
- time: '刚刚',
- group: '今天',
- workspace: previous.workspace,
- unread: 0,
- archived: false,
- });
- collaboration.set(identifier, { kind: 'idle', label: '等待新的想法', elapsed: '空闲' });
- messages.set(identifier, []);
- navigate('chat', identifier);
- toast('已在 ' + getAgent(previous.agentId).name + ' 中新建,原对话草稿已保留');
- }
- function editCurrentTitle() {
- const conversation = getConversation();
- formSheet(
- '给这段对话起个名字',
- '会话标题',
- conversation.title,
- 'rename-conversation',
- conversation.id,
- );
- const form = overlay.querySelector('form');
- form.insertAdjacentHTML(
- 'beforeend',
- `<button class="regenerate-title" type="button" data-action="regenerate-title">${icon('spark')}生成一个候选标题<span>演示</span></button><p class="title-protection">${icon('shield')}只有点保存才会更新。手动标题不会被自动覆盖。</p>`,
- );
- }
- function previewListState(mode) {
- saveDraft();
- state.page = 'messages';
- state.keyword = '';
- history.pushState(null, '', '#/messages');
- closeOverlay();
- render();
- const results = document.querySelector('#conversation-results');
- if (mode === 'loading') {
- 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>`;
- setTimeout(() => {
- if (results.isConnected) results.innerHTML = conversationResults();
- }, 1800);
- } else if (mode === 'error') {
- results.innerHTML =
- emptyState('暂时没连上,不是消息丢了', '网络恢复后可以重试,草稿仍然保留。', 'wifi') +
- '<button class="primary-button" data-action="retry-list">重新加载</button>';
- } else
- results.innerHTML =
- emptyState('还没有对话,从一个想法开始', '选择熟悉的数字生命,开始你的第一次协作。', 'chat') +
- '<button class="primary-button" data-action="new-chat">开始新对话</button>';
- }
- function completeDemo() {
- const conversation = getConversation('c4');
- if (!conversation) {
- toast('这条演示会话已删除,刷新可恢复');
- return;
- }
- const activity = collaboration.get(conversation.id);
- if (activity?.kind === 'done') {
- toast('该协作已完成,可在「已完成」中查看');
- return;
- }
- collaboration.set(conversation.id, {
- kind: 'done',
- label: '接口检查已完成,结果已整理',
- elapsed: '刚刚完成',
- });
- conversation.unread = 1;
- closeOverlay();
- render();
- document.querySelector('#completion-banner')?.remove();
- document
- .querySelector('#device')
- .insertAdjacentHTML(
- 'beforeend',
- `<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>`,
- );
- }
- function send() {
- if (state.generating || (!state.draft.trim() && !state.attachments.length)) return;
- if (state.disconnected && state.page === 'chat') {
- toast('连接已断开,请先重连;草稿已保留');
- return;
- }
- if (state.page === 'home' && !state.agentId) {
- pickAgent(true);
- return;
- }
- if (state.page === 'home') {
- drafts.delete('home');
- const identifier = `c${Date.now()}`;
- conversations.unshift({
- id: identifier,
- title: state.draft.trim().slice(0, 18) || '附件对话',
- agentId: state.agentId,
- preview: '正在整理你的想法…',
- time: '刚刚',
- group: '今天',
- workspace: state.newWorkspace,
- unread: 0,
- archived: false,
- });
- messages.set(identifier, []);
- state.currentId = identifier;
- state.newWorkspace = null;
- state.page = 'chat';
- history.pushState(null, '', `#/chat/${identifier}`);
- }
- const conversation = getConversation(),
- rows = messages.get(conversation.id) || sampleMessages(conversation),
- question = state.draft.trim(),
- files = state.attachments.map((file) => file.name);
- rows.push({ role: 'user', text: question || '请查看我添加的附件', files });
- if (conversation.title === '新对话' && !conversation.manuallyNamed)
- conversation.title = (question || '附件对话').slice(0, 18);
- collaboration.set(conversation.id, {
- kind: 'running',
- label: '正在处理你的消息',
- elapsed: '刚刚开始',
- });
- messages.set(conversation.id, rows);
- state.draft = '';
- state.attachments = [];
- drafts.delete(conversation.id);
- state.generating = true;
- state.generatingId = conversation.id;
- render();
- main.scrollTop = main.scrollHeight;
- clearTimeout(generationTimer);
- generationTimer = setTimeout(() => {
- rows.push({
- role: 'assistant',
- html: `<p>收到,我们就从「<strong>${esc(question || '这份附件')}</strong>」开始。</p><p>我会先把目标、已有信息和下一步梳理清楚,再一起把它变成可执行的行动。</p><blockquote>这是一条本地模拟回复,仅用于体验发送、等待和阅读的完整流程${files.length ? ';附件只展示文件名,未读取或上传' : ''}。</blockquote>`,
- });
- conversation.preview = '已整理好思路,可以继续讨论。';
- collaboration.set(conversation.id, {
- kind: 'done',
- label: '演示回复已完成',
- elapsed: '刚刚完成',
- });
- state.generating = false;
- if (state.page === 'chat' && state.currentId === conversation.id) {
- render();
- main.scrollTop = main.scrollHeight;
- } else if (['home', 'messages'].includes(state.page)) render();
- }, 1100);
- }
- function toast(message) {
- const element = document.querySelector('#toast');
- element.textContent = message;
- element.classList.add('visible');
- clearTimeout(toastTimer);
- toastTimer = setTimeout(() => element.classList.remove('visible'), 2700);
- }
- async function copyText(text) {
- try {
- await navigator.clipboard.writeText(text);
- toast('已复制');
- } catch {
- toast('浏览器未开放剪贴板权限,请手动选择内容复制');
- }
- }
- function downloadDemo() {
- const content =
- '产品初体验优化建议(演示文稿)\n\n01 让入口更清楚\n保留现有导航与功能,突出主操作。\n\n02 让阅读更轻松\n减少厚重卡片,扩大段落留白。\n\n03 让操作有回应\n清晰呈现加载、断线与错误状态。\n\n本文件为独立 HTML 原型的演示文稿,并非真实云盘文件。',
- url = URL.createObjectURL(new Blob([content], { type: 'text/plain;charset=utf-8' })),
- link = document.createElement('a');
- link.href = url;
- link.download = '产品初体验优化建议-演示.txt';
- link.click();
- setTimeout(() => URL.revokeObjectURL(url), 1000);
- toast('演示文稿已下载,不是实际 DOCX 文件');
- }
- function showArchived() {
- sheet(
- '已归档对话',
- conversations
- .filter((conversation) => conversation.archived)
- .map(conversationRow)
- .join('') || emptyState('没有归档对话', '归档的对话会保留在这里。', 'archive'),
- );
- }
- function newChat(workspace = null, agentId = null) {
- if (state.generating) {
- toast('演示回复完成后即可新建对话');
- return;
- }
- state.agentId = agentId;
- state.newWorkspace = workspace;
- navigate('home');
- }
- const actions = {
- 'preview-states': () =>
- sheet(
- '加载与反馈状态',
- '<p class="sheet-description">仅切换演示视图,不改变真实数据或权限。</p><button class="sheet-list-button" data-action="list-state" data-value="loading">' +
- icon('more') +
- '加载骨架屏</button><button class="sheet-list-button" data-action="list-state" data-value="empty">' +
- icon('chat') +
- '首次使用空态</button><button class="sheet-list-button" data-action="list-state" data-value="error">' +
- icon('wifi') +
- '断网与重试</button>',
- ),
- 'list-state': (button) => previewListState(button.dataset.value),
- 'retry-list': renderMessages,
- activity: openActivity,
- 'activity-filter': (button) => {
- state.activityFilter = button.dataset.value;
- openActivity();
- },
- 'activity-open': (button) => {
- closeOverlay();
- navigate('chat', button.dataset.id);
- requestAnimationFrame(() => {
- main.scrollTop = main.scrollHeight;
- });
- },
- 'drawer-view': (button) => {
- state.drawerView = button.dataset.value;
- openDrawer();
- },
- 'quick-current': quickCurrent,
- 'agent-new': (button) => {
- newChat(null, button.dataset.id);
- toast('已选中 ' + getAgent(button.dataset.id).name + ',不用再次选择');
- },
- 'edit-current-title': editCurrentTitle,
- 'regenerate-title': () => {
- const conversation = getConversation();
- const rows = messages.get(conversation.id) || [];
- const question = [...rows].reverse().find((message) => message.role === 'user')?.text;
- overlay.querySelector('#form-value').value =
- conversation.id === 'c1'
- ? '移动端第一印象与体验优化'
- : (question || conversation.title).slice(0, 22);
- toast('候选标题已填入,保存后才会更新;未调用 AI');
- },
- 'complete-demo': completeDemo,
- 'dismiss-completion': () => document.querySelector('#completion-banner')?.remove(),
- 'completion-open': (button) => {
- document.querySelector('#completion-banner')?.remove();
- navigate('chat', button.dataset.id);
- requestAnimationFrame(() => {
- main.scrollTop = main.scrollHeight;
- });
- },
- navigate: (button) => navigate(button.dataset.page),
- drawer: openDrawer,
- close: closeOverlay,
- 'new-chat': () => newChat(),
- 'open-chat': (button) => navigate('chat', button.dataset.id),
- 'pick-agent': () => pickAgent(false),
- 'choose-agent': (button) => {
- const pending = state.pendingSend;
- state.agentId = button.dataset.id;
- closeOverlay();
- renderComposer();
- if (pending) send();
- },
- 'agent-info': () => {
- const agent = getAgent(getConversation().agentId);
- sheet(
- '当前数字生命',
- `<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>`,
- );
- },
- prompt: (button) => {
- state.draft = button.dataset.value;
- renderComposer();
- document.querySelector('#draft').focus();
- },
- send,
- attach: () => {
- if (state.generating) return;
- document.querySelector('#file-input').click();
- },
- 'remove-attachment': (button) => {
- state.attachments.splice(Number(button.dataset.index), 1);
- renderComposer();
- },
- 'message-filter': (button) => {
- state.filter = button.dataset.value;
- renderMessages();
- },
- 'contact-filter': (button) => {
- state.contactFilter = button.dataset.value;
- state.keyword = '';
- renderContacts();
- },
- 'agent-filter': (button) => {
- state.agentFilter = button.dataset.value;
- renderWorkbench();
- },
- 'toggle-workspace': (button) => {
- state.expanded.has(button.dataset.id)
- ? state.expanded.delete(button.dataset.id)
- : state.expanded.add(button.dataset.id);
- document.querySelector('#conversation-results').innerHTML = conversationResults();
- },
- 'drawer-workspace': (button) => {
- state.drawerExpanded.has(button.dataset.id)
- ? state.drawerExpanded.delete(button.dataset.id)
- : state.drawerExpanded.add(button.dataset.id);
- document.querySelector('#drawer-results').innerHTML = drawerHistory(
- document.querySelector('[data-input="drawer-search"]').value,
- );
- },
- 'workspace-chat': (button) => newChat(button.dataset.id),
- 'create-workspace': () =>
- formSheet('新建工作区', '工作区名称(最多 24 字)', '', 'create-workspace'),
- 'workspace-menu': (button) => {
- const workspace = workspaces.find((item) => item.id === button.dataset.id);
- sheet(
- esc(workspace.name),
- `<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>`,
- );
- },
- 'rename-workspace': (button) =>
- formSheet(
- '重命名工作区',
- '工作区名称(最多 24 字)',
- workspaces.find((workspace) => workspace.id === button.dataset.id).name,
- 'rename-workspace',
- button.dataset.id,
- ),
- 'delete-workspace': (button) =>
- confirmation(
- '删除工作区?',
- '其中的会话会移到「日常对话」,不会被删除。此操作只影响演示数据。',
- 'confirm-delete-workspace',
- button.dataset.id,
- ),
- 'confirm-delete-workspace': (button) => {
- conversations.forEach((conversation) => {
- if (conversation.workspace === button.dataset.id) conversation.workspace = null;
- });
- workspaces = workspaces.filter((workspace) => workspace.id !== button.dataset.id);
- if (state.newWorkspace === button.dataset.id) state.newWorkspace = null;
- closeOverlay();
- render();
- toast('工作区已删除,会话已移到日常对话');
- },
- 'conversation-menu': (button) => conversationMenu(button.dataset.id),
- 'rename-conversation': (button) =>
- formSheet(
- '重命名对话',
- '对话名称',
- getConversation(button.dataset.id).title,
- 'rename-conversation',
- button.dataset.id,
- ),
- 'move-conversation': (button) =>
- sheet(
- '移动到工作区',
- `<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('')}`,
- ),
- 'choose-workspace': (button) => {
- getConversation(button.dataset.id).workspace = button.dataset.workspace || null;
- closeOverlay();
- render();
- toast('已移动,仅影响本地演示数据');
- },
- 'archive-conversation': (button) => {
- const conversation = getConversation(button.dataset.id);
- conversation.archived = !conversation.archived;
- closeOverlay();
- if (state.page === 'chat' && conversation.archived) navigate('messages');
- else render();
- toast(conversation.archived ? '已归档,可在侧栏中找回' : '已取消归档');
- },
- 'delete-conversation': (button) =>
- confirmation(
- '删除对话?',
- '删除后这条演示对话将从当前预览中移除,刷新页面可恢复。',
- 'confirm-delete-conversation',
- button.dataset.id,
- ),
- 'confirm-delete-conversation': (button) => {
- const index = conversations.findIndex((conversation) => conversation.id === button.dataset.id);
- if (index >= 0) conversations.splice(index, 1);
- messages.delete(button.dataset.id);
- closeOverlay();
- if (state.page === 'chat') navigate('messages');
- else render();
- toast('演示对话已删除');
- },
- 'show-archived': showArchived,
- details: (button) => details(button?.dataset.tab || 'task'),
- 'detail-tab': (button) => details(button.dataset.value),
- 'preview-file': previewFile,
- 'download-demo': downloadDemo,
- 'copy-message': (button) => {
- const message = messages.get(state.currentId)[Number(button.dataset.index)],
- content = document.createElement('div');
- content.innerHTML = message.html;
- copyText(content.textContent);
- },
- disconnect: () => {
- state.disconnected = true;
- closeOverlay();
- renderChat();
- toast('已进入断线演示,草稿不会丢失');
- },
- reconnect: () => {
- state.disconnected = false;
- closeOverlay();
- renderChat();
- toast('演示连接已恢复');
- },
- 'open-agent': (button) => navigate('agent', button.dataset.id),
- 'rename-agent': (button) =>
- formSheet(
- '重命名数字生命',
- '显示名称',
- getAgent(button.dataset.id).name,
- 'rename-agent',
- button.dataset.id,
- ),
- 'agent-chat': (button) => {
- const conversation = activeConversations().find((item) => item.agentId === button.dataset.id);
- conversation ? navigate('chat', conversation.id) : newChat(null, button.dataset.id);
- },
- channels: (button) =>
- sheet(
- '消息通道',
- `<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>`,
- ),
- recharge: (button) =>
- sheet(
- '数字生命充值',
- `<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>`,
- ),
- coworker: (button) =>
- sheet(
- esc(button.dataset.name),
- `<p class="sheet-description">同事的数字生命 · 演示</p>${agents
- .slice(0, 2)
- .map(
- (agent) =>
- `<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>`,
- )
- .join('')}`,
- ),
- theme: () => {
- state.dark = !state.dark;
- const scroll = main.scrollTop;
- renderMine();
- applyPreferences();
- main.scrollTop = scroll;
- },
- palette: (button) => {
- state.palette = button.dataset.value;
- const scroll = main.scrollTop;
- renderMine();
- applyPreferences();
- main.scrollTop = scroll;
- },
- font: () =>
- sheet(
- '舒适地阅读',
- `<p class="sheet-description">仅调整对话正文,沿用现有字号偏好功能。</p><div class="font-options">${[
- [14, '标准'],
- [16, '较大'],
- [18, '大号'],
- ]
- .map(
- ([value, label]) =>
- `<button data-action="choose-font" data-value="${value}" class="${state.font === value ? 'active' : ''}">${label}</button>`,
- )
- .join(
- '',
- )}</div><div class="assistant-body" id="font-preview" style="font-size:${state.font}px;line-height:1.9;padding:14px 0">让每一个想法,都有舒展的空间。<br />好的阅读体验,从恰好的字号开始。</div>`,
- ),
- 'choose-font': (button) => {
- state.font = Number(button.dataset.value);
- applyPreferences();
- renderMine();
- actions.font();
- },
- token: () =>
- sheet(
- '访问 Token',
- `<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>`,
- ),
- 'toggle-token': () => {
- state.tokenVisible = !state.tokenVisible;
- actions.token();
- },
- 'copy-token': () => copyText('DEMO-NOT-A-REAL-TOKEN'),
- notifications: () =>
- sheet(
- '消息与任务通知',
- `<p class="sheet-description">继续保留现有通知权限状态和系统设置入口。</p><div class="empty-state">${icon('bell')}<strong>原型不申请系统权限</strong><p>正式版本仍由现有通知服务检查权限,并引导到系统设置。</p></div>`,
- ),
- logout: () =>
- confirmation('退出登录?', '此处仅演示二次确认,不会退出真实项目账号。', 'confirm-logout'),
- 'confirm-logout': () => {
- closeOverlay();
- navigate('home');
- toast('退出交互演示完成;未操作真实账号');
- },
- };
- document.addEventListener('click', (event) => {
- const experience = event.target.closest('[data-experience]');
- if (experience) {
- const type = experience.dataset.experience;
- closeOverlay();
- if (state.page !== 'chat') {
- saveDraft();
- state.page = 'chat';
- state.currentId = 'c1';
- restoreDraft();
- history.pushState(null, '', '#/chat/c1');
- render();
- }
- if (type === 'activity') openActivity();
- if (type === 'title') editCurrentTitle();
- if (type === 'complete') completeDemo();
- return;
- }
- const scene = event.target.closest('[data-scene]');
- if (scene) {
- navigate(scene.dataset.scene, scene.dataset.scene === 'chat' ? 'c1' : undefined);
- return;
- }
- const button = event.target.closest('[data-action]');
- if (button && !button.disabled) actions[button.dataset.action]?.(button);
- });
- document.addEventListener('input', (event) => {
- const element = event.target;
- if (element.id === 'draft') {
- state.draft = element.value;
- element.style.height = 'auto';
- element.style.height = `${Math.min(element.scrollHeight, 116)}px`;
- document.querySelector('.send-button').disabled =
- state.generating || (!state.draft.trim() && !state.attachments.length);
- return;
- }
- const kind = element.dataset.input;
- if (!kind) return;
- if (kind === 'activity-search') {
- state.activityKeyword = element.value;
- document.querySelector('#activity-results').innerHTML = activityResults();
- return;
- }
- if (kind === 'drawer-search') {
- document.querySelector('#drawer-results').innerHTML = drawerHistory(element.value);
- return;
- }
- state.keyword = element.value;
- if (kind === 'search')
- document.querySelector('#conversation-results').innerHTML = conversationResults();
- if (kind === 'contact-search')
- document.querySelector('#contact-results').innerHTML = contactResults();
- if (kind === 'agent-search') document.querySelector('#agent-results').innerHTML = agentResults();
- });
- document.addEventListener('keydown', (event) => {
- if (event.key === 'Escape' && overlay.childElementCount) {
- event.preventDefault();
- closeOverlay();
- return;
- }
- if (event.key === 'Tab' && overlay.childElementCount) {
- const focusable = [
- ...overlay.querySelectorAll('button:not(:disabled),input,select,a[href],summary'),
- ].filter((element) => element.getClientRects().length),
- first = focusable[0],
- last = focusable.at(-1);
- if (event.shiftKey && document.activeElement === first) {
- event.preventDefault();
- last?.focus();
- } else if (!event.shiftKey && document.activeElement === last) {
- event.preventDefault();
- first?.focus();
- }
- }
- });
- let sheetDrag = null;
- overlay.addEventListener('pointerdown', (event) => {
- const handle = event.target.closest('.sheet-handle');
- if (!handle) return;
- sheetDrag = { start: event.clientY, distance: 0, element: handle.closest('.sheet'), handle };
- handle.setPointerCapture(event.pointerId);
- sheetDrag.element.style.transition = 'none';
- sheetDrag.element.style.animation = 'none';
- });
- overlay.addEventListener('pointermove', (event) => {
- if (!sheetDrag) return;
- sheetDrag.distance = Math.max(0, event.clientY - sheetDrag.start);
- sheetDrag.element.style.transform = `translateY(${sheetDrag.distance}px)`;
- });
- overlay.addEventListener('pointerup', () => {
- if (!sheetDrag) return;
- if (sheetDrag.distance > 85) closeOverlay();
- else {
- sheetDrag.element.style.transition = 'transform .2s ease';
- sheetDrag.element.style.transform = '';
- }
- sheetDrag = null;
- });
- overlay.addEventListener('pointercancel', () => {
- if (sheetDrag) sheetDrag.element.style.transform = '';
- sheetDrag = null;
- });
- document.addEventListener('submit', (event) => {
- const form = event.target.closest('[data-form]');
- if (!form) return;
- event.preventDefault();
- const value = new FormData(form).get('value').trim(),
- kind = form.dataset.form,
- identifier = form.dataset.id,
- error = form.querySelector('.form-error');
- if (!value) {
- error.textContent = '名称不能为空';
- return;
- }
- if (kind.includes('workspace')) {
- if (value.length > 24) {
- error.textContent = '工作区名称最多 24 字';
- return;
- }
- if (workspaces.some((workspace) => workspace.name === value && workspace.id !== identifier)) {
- error.textContent = '已有同名工作区,请换一个名称';
- return;
- }
- }
- if (kind === 'create-workspace') workspaces.push({ id: `w${Date.now()}`, name: value });
- if (kind === 'rename-workspace')
- workspaces.find((workspace) => workspace.id === identifier).name = value;
- if (kind === 'rename-conversation') {
- getConversation(identifier).title = value;
- getConversation(identifier).manuallyNamed = true;
- }
- if (kind === 'rename-agent') getAgent(identifier).name = value;
- closeOverlay();
- render();
- toast('已保存,仅影响本地演示数据');
- });
- document.querySelector('#file-input').addEventListener('change', (event) => {
- state.attachments.push(...Array.from(event.target.files));
- event.target.value = '';
- renderComposer();
- toast('附件仅暂存在本页,不会读取或上传');
- });
- window.addEventListener('hashchange', readRoute);
- function syncVisualViewport() {
- if (window.innerWidth <= 520 && window.visualViewport?.scale === 1) {
- document
- .querySelector('#device')
- .style.setProperty('--visual-height', `${window.visualViewport.height}px`);
- } else document.querySelector('#device').style.removeProperty('--visual-height');
- }
- window.visualViewport?.addEventListener('resize', syncVisualViewport);
- window.addEventListener('resize', syncVisualViewport);
- syncVisualViewport();
- document
- .querySelectorAll('[data-icon]')
- .forEach((element) => (element.innerHTML = icon(element.dataset.icon)));
- readRoute();
- </script>
- </body>
- </html>
|