| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350 |
- <!doctype html>
- <html lang="zh-CN">
- <head>
- <meta charset="UTF-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
- <meta name="color-scheme" content="light" />
- <title>fmode · 现有移动端 UI 精修对照</title>
- <style>
- * {
- box-sizing: border-box;
- }
- :root {
- font-family:
- Inter,
- -apple-system,
- BlinkMacSystemFont,
- 'Segoe UI',
- 'PingFang SC',
- 'Microsoft YaHei',
- sans-serif;
- color: #25272a;
- background: #f1f1f0;
- font-synthesis: none;
- }
- body {
- margin: 0;
- }
- button,
- input,
- textarea {
- font: inherit;
- }
- button {
- cursor: pointer;
- color: inherit;
- border: 0;
- background: none;
- -webkit-tap-highlight-color: transparent;
- }
- button:disabled {
- cursor: default;
- opacity: 0.4;
- }
- button:focus-visible,
- input:focus-visible,
- textarea:focus-visible,
- summary:focus-visible {
- outline: 2px solid #6386af;
- outline-offset: 3px;
- }
- button,
- input,
- textarea {
- touch-action: manipulation;
- }
- svg {
- width: 21px;
- height: 21px;
- fill: none;
- stroke: currentColor;
- stroke-width: 1.65;
- stroke-linecap: round;
- stroke-linejoin: round;
- flex: none;
- }
- h1,
- h2,
- h3,
- p {
- margin: 0;
- }
- button {
- transition:
- background 0.15s,
- transform 0.15s;
- }
- button:active {
- transform: translateY(1px);
- }
- .studio-header {
- height: 72px;
- border-bottom: 1px solid #dededb;
- margin: 0 48px;
- display: flex;
- align-items: center;
- justify-content: space-between;
- }
- .brand {
- display: flex;
- align-items: center;
- gap: 12px;
- font-size: 12px;
- color: #777873;
- }
- .brand strong {
- font-size: 23px;
- letter-spacing: -1.2px;
- color: #25272a;
- }
- .brand-mark {
- width: 27px;
- height: 27px;
- background: #292b2e;
- border-radius: 9px;
- color: white;
- font-size: 25px;
- line-height: 30px;
- font-weight: 700;
- text-align: center;
- font-style: italic;
- }
- .brand-divider {
- height: 17px;
- width: 1px;
- background: #cececa;
- margin: 0 5px;
- }
- .prototype-label {
- font-size: 11px;
- color: #81817c;
- }
- .studio {
- max-width: 1040px;
- margin: 0 auto;
- padding: 34px 28px 24px;
- }
- .studio-heading {
- display: flex;
- justify-content: space-between;
- align-items: center;
- gap: 24px;
- }
- .eyebrow {
- font-size: 10px;
- font-weight: 600;
- color: #777872;
- letter-spacing: 2px;
- margin-bottom: 9px;
- }
- h1 {
- font-size: 25px;
- font-weight: 600;
- letter-spacing: -0.6px;
- }
- .studio-heading p {
- font-size: 12px;
- color: #777872;
- margin-top: 10px;
- line-height: 1.8;
- }
- .view-control {
- display: flex;
- padding: 4px;
- border: 1px solid #d9d9d5;
- border-radius: 10px;
- flex: none;
- }
- .view-control button {
- font-size: 11px;
- padding: 8px 12px;
- border-radius: 7px;
- color: #777872;
- }
- .view-control button.selected {
- background: #fff;
- color: #26272a;
- box-shadow: 0 1px 4px #00000008;
- }
- .scene-nav {
- display: flex;
- gap: 6px;
- margin: 27px 0 22px;
- border-bottom: 1px solid #dededb;
- overflow: auto;
- }
- .scene-nav button {
- font-size: 12px;
- white-space: nowrap;
- padding: 13px 15px 14px;
- color: #83847e;
- border-bottom: 2px solid transparent;
- display: flex;
- align-items: center;
- gap: 7px;
- }
- .scene-nav svg {
- width: 15px;
- height: 15px;
- }
- .scene-nav button.selected {
- color: #25272a;
- border-bottom-color: #25272a;
- }
- .comparison {
- display: flex;
- justify-content: center;
- gap: 54px;
- align-items: flex-start;
- }
- .specimen {
- width: 390px;
- min-width: 0;
- }
- .specimen-caption {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 14px;
- gap: 8px;
- font-size: 10px;
- color: #82837c;
- }
- .specimen-caption > div {
- display: flex;
- align-items: center;
- gap: 8px;
- }
- .specimen-caption strong {
- font-size: 12px;
- font-weight: 600;
- color: #3a3b3c;
- }
- .version-number {
- font-size: 10px;
- border: 1px solid #cececa;
- width: 22px;
- height: 22px;
- border-radius: 6px;
- display: grid;
- place-items: center;
- }
- .live-label {
- display: flex;
- gap: 5px;
- align-items: center;
- }
- .live-label i {
- width: 5px;
- height: 5px;
- background: #4e7461;
- border-radius: 50%;
- }
- .phone {
- --canvas: #f2f3f5;
- --surface: #fff;
- --surface-2: #f7f7f8;
- --ink: #202124;
- --ink-2: #45474b;
- --muted: #62666d;
- --edge: #dfe1e4;
- --primary: #25272a;
- --primary-content: #fff;
- --subtle: #e8e9eb;
- --avatar: #e9eaec;
- --shadow: 0 1px 2px #17243c0a, 0 4px 12px #17243c0f;
- --chat-size: 14px;
- isolation: isolate;
- position: relative;
- background: var(--canvas);
- color: var(--ink);
- height: 792px;
- border-radius: 38px;
- overflow: hidden;
- box-shadow:
- 0 0 0 1px #d5d5d1,
- 0 0 0 5px #fafaf8,
- 0 18px 38px -15px #24262622;
- display: flex;
- flex-direction: column;
- font-size: 14px;
- }
- .phone.dark {
- --canvas: #18191b;
- --surface: #222426;
- --surface-2: #292b2e;
- --ink: #f2f3f4;
- --ink-2: #d0d2d5;
- --muted: #a7abb1;
- --edge: #383b3f;
- --primary: #f1f2f3;
- --primary-content: #202124;
- --subtle: #34373b;
- --avatar: #34383c;
- }
- .phone[data-palette='ice']:not(.dark) {
- --canvas: #f6f8fc;
- --ink: #202a3c;
- --primary: #4056c7;
- --subtle: #e8ecfb;
- --avatar: #e6ebf7;
- }
- .phone[data-palette='clay']:not(.dark) {
- --canvas: #f3f0eb;
- --surface: #fffdfa;
- --ink: #2a2623;
- --primary: #af482b;
- --subtle: #f6e8e1;
- --avatar: #f0e5dc;
- }
- .phone[data-palette='slate']:not(.dark) {
- --canvas: #f1f0f5;
- --ink: #282633;
- --primary: #6952a3;
- --subtle: #efebf8;
- --avatar: #e7e2f0;
- }
- .specimen-note {
- font-size: 11px;
- color: #82837c;
- margin-top: 20px;
- line-height: 1.8;
- text-align: center;
- }
- .studio-footer {
- display: flex;
- justify-content: space-between;
- border-top: 1px solid #dededb;
- margin-top: 28px;
- padding-top: 18px;
- color: #8b8c85;
- font-size: 10px;
- }
- .mobile-review {
- display: none;
- }
- body[data-view='polished'] .baseline-specimen,
- body[data-view='baseline'] .polished-specimen {
- display: none;
- }
- .statusbar {
- height: 40px;
- flex: none;
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 11px 27px 0;
- font-size: 13px;
- font-weight: 650;
- letter-spacing: 0.2px;
- }
- .status-icons {
- display: flex;
- gap: 5px;
- align-items: center;
- }
- .status-icons svg {
- width: 15px;
- height: 15px;
- stroke-width: 1.9;
- }
- .status-icons svg:last-child {
- width: 23px;
- }
- .appbar {
- height: 68px;
- flex: none;
- display: flex;
- align-items: center;
- gap: 10px;
- padding: 0 16px;
- }
- .round-button {
- width: 44px;
- height: 44px;
- display: grid;
- place-items: center;
- border-radius: 50%;
- background: var(--surface);
- box-shadow: var(--shadow);
- flex: none;
- }
- .appbar-title {
- flex: 1;
- min-width: 0;
- text-align: center;
- }
- .appbar-title h2 {
- font-size: 16px;
- font-weight: 600;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- line-height: 24px;
- }
- .appbar-title p {
- font-size: 11px;
- color: var(--muted);
- line-height: 19px;
- }
- .appbar-title button {
- max-width: 100%;
- padding: 0;
- display: block;
- width: 100%;
- }
- .appbar-title button h2 {
- padding: 0 3px;
- }
- .appbar-right {
- display: flex;
- gap: 8px;
- }
- .header-spacer {
- width: 44px;
- flex: none;
- }
- .page-content {
- flex: 1;
- min-height: 0;
- overflow-y: auto;
- overscroll-behavior: contain;
- scrollbar-width: none;
- padding-bottom: 20px;
- }
- .page-content::-webkit-scrollbar {
- display: none;
- }
- .filter-area {
- padding: 0 20px 0;
- flex: none;
- }
- .segmented {
- display: flex;
- background: var(--surface-2);
- border: 1px solid var(--edge);
- border-radius: 99px;
- padding: 4px;
- max-width: 300px;
- margin: 0 auto 14px;
- }
- .segmented button {
- flex: 1;
- min-height: 36px;
- font-size: 13px;
- border-radius: 99px;
- color: var(--muted);
- }
- .segmented button.selected {
- background: var(--surface);
- box-shadow: var(--shadow);
- color: var(--ink);
- font-weight: 550;
- }
- .search {
- display: flex;
- align-items: center;
- gap: 9px;
- height: 44px;
- background: var(--surface);
- border: 1px solid var(--edge);
- border-radius: 10px;
- padding: 0 12px;
- color: var(--muted);
- }
- .search svg {
- width: 18px;
- height: 18px;
- }
- .search input {
- background: none;
- border: 0;
- outline: none;
- min-width: 0;
- width: 100%;
- color: var(--ink);
- font-size: 13px;
- height: 100%;
- }
- .search input::placeholder {
- color: var(--muted);
- opacity: 0.8;
- }
- .list {
- margin: 12px 20px 0;
- background: var(--surface);
- border: 1px solid var(--edge);
- border-radius: 16px;
- overflow: hidden;
- }
- .conversation {
- position: relative;
- display: flex;
- align-items: center;
- gap: 12px;
- padding: 14px 16px;
- min-height: 76px;
- width: 100%;
- text-align: left;
- }
- .conversation + .conversation {
- border-top: 1px solid var(--edge);
- }
- .conversation:hover {
- background: var(--surface-2);
- }
- .avatar {
- width: 40px;
- height: 40px;
- border-radius: 50%;
- flex: none;
- display: grid;
- place-items: center;
- background: var(--avatar);
- color: var(--muted);
- font-size: 16px;
- font-weight: 550;
- position: relative;
- }
- .presence {
- position: absolute;
- right: 0;
- bottom: 0;
- width: 9px;
- height: 9px;
- border: 2px solid var(--surface);
- border-radius: 50%;
- background: #4d8c6b;
- }
- .presence.off {
- background: #b4b7bb;
- }
- .row-body {
- min-width: 0;
- flex: 1;
- }
- .row-title {
- display: block;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- font-size: 14px;
- font-weight: 550;
- line-height: 22px;
- }
- .row-preview {
- display: block;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- font-size: 12px;
- line-height: 20px;
- color: var(--muted);
- }
- .row-tail {
- align-self: stretch;
- display: flex;
- flex-direction: column;
- align-items: flex-end;
- justify-content: center;
- gap: 8px;
- flex: none;
- font-size: 10px;
- color: var(--muted);
- }
- .unread {
- background: #c33f42;
- color: #fff;
- border-radius: 99px;
- min-width: 17px;
- height: 17px;
- display: grid;
- place-items: center;
- font-size: 10px;
- padding: 0 5px;
- }
- .row-meta {
- display: none;
- }
- .list-footer {
- text-align: center;
- color: var(--muted);
- opacity: 0.7;
- font-size: 10px;
- padding: 20px;
- }
- .tabbar {
- height: 70px;
- flex: none;
- display: flex;
- align-items: center;
- background: color-mix(in srgb, var(--surface) 88%, transparent);
- border-top: 1px solid var(--edge);
- backdrop-filter: blur(16px);
- padding: 5px 10px 2px;
- position: relative;
- }
- .tabbar button {
- display: flex;
- align-items: center;
- justify-content: center;
- flex-direction: column;
- gap: 4px;
- flex: 1;
- font-size: 10px;
- color: var(--muted);
- min-height: 48px;
- position: relative;
- }
- .tab-icon {
- display: grid;
- place-items: center;
- height: 28px;
- width: 48px;
- border-radius: 12px;
- position: relative;
- }
- .tabbar button.selected {
- color: var(--primary);
- font-weight: 650;
- }
- .tabbar .unread {
- position: absolute;
- top: -3px;
- right: 2px;
- min-width: 15px;
- height: 15px;
- font-size: 9px;
- }
- .home-indicator {
- height: 18px;
- background: var(--surface);
- display: flex;
- justify-content: center;
- align-items: center;
- flex: none;
- }
- .home-indicator:after {
- content: '';
- height: 4px;
- width: 116px;
- background: var(--ink);
- border-radius: 9px;
- opacity: 0.8;
- }
- .group-toggle {
- display: flex;
- align-items: center;
- gap: 9px;
- width: 100%;
- min-height: 58px;
- padding: 12px 16px;
- text-align: left;
- }
- .group-toggle strong {
- font-size: 13px;
- flex: 1;
- font-weight: 550;
- }
- .group-toggle span {
- font-size: 11px;
- color: var(--muted);
- }
- .group-toggle svg {
- width: 18px;
- height: 18px;
- }
- .group-actions {
- display: flex;
- padding: 0 12px 12px;
- gap: 6px;
- }
- .group-actions button {
- font-size: 11px;
- color: var(--muted);
- padding: 8px;
- min-height: 36px;
- }
- .section-label {
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin: 21px 22px 10px;
- font-size: 12px;
- color: var(--muted);
- font-weight: 500;
- }
- .text-button {
- color: var(--muted);
- font-size: 12px;
- padding: 10px 0;
- min-height: 40px;
- display: inline-flex;
- align-items: center;
- gap: 5px;
- }
- .text-button svg {
- width: 15px;
- height: 15px;
- }
- .empty {
- padding: 50px 24px;
- text-align: center;
- color: var(--muted);
- }
- .empty svg {
- width: 30px;
- height: 30px;
- margin-bottom: 14px;
- }
- .empty h3 {
- font-size: 15px;
- color: var(--ink);
- margin-bottom: 8px;
- }
- .empty p {
- font-size: 12px;
- line-height: 1.8;
- }
- .empty button {
- margin-top: 18px;
- }
- .primary-button {
- background: var(--primary);
- color: var(--primary-content);
- border-radius: 10px;
- min-height: 44px;
- padding: 10px 17px;
- font-size: 13px;
- font-weight: 550;
- }
- .secondary-button {
- background: var(--surface-2);
- border: 1px solid var(--edge);
- border-radius: 10px;
- min-height: 44px;
- padding: 10px 16px;
- font-size: 13px;
- }
- .chat-scroll {
- padding: 8px 16px 22px;
- scroll-behavior: smooth;
- }
- .chat-date {
- text-align: center;
- color: var(--muted);
- font-size: 10px;
- margin: 8px 0 21px;
- }
- .user-message {
- background: var(--subtle);
- border-radius: 16px 16px 4px 16px;
- margin-left: 35px;
- padding: 12px 15px;
- line-height: 1.75;
- font-size: var(--chat-size);
- white-space: pre-wrap;
- overflow-wrap: anywhere;
- }
- .agent-line {
- display: flex;
- align-items: center;
- gap: 8px;
- margin: 20px 0 10px;
- font-size: 12px;
- font-weight: 600;
- }
- .agent-line .avatar {
- width: 26px;
- height: 26px;
- font-size: 11px;
- }
- .agent-line .agent-status {
- margin-left: auto;
- color: var(--muted);
- font-size: 10px;
- font-weight: 400;
- }
- .process {
- margin-bottom: 8px;
- }
- .process summary {
- cursor: pointer;
- list-style: none;
- min-height: 32px;
- padding: 6px 10px;
- display: flex;
- align-items: center;
- gap: 6px;
- font-size: 10px;
- color: var(--muted);
- background: var(--surface-2);
- border: 1px solid var(--edge);
- border-radius: 99px;
- width: fit-content;
- max-width: 100%;
- }
- .process summary::-webkit-details-marker {
- display: none;
- }
- .process summary svg {
- width: 13px;
- height: 13px;
- }
- .process summary span {
- margin-left: 4px;
- }
- .process[open] summary svg:last-child {
- transform: rotate(180deg);
- }
- .process ol {
- font-size: 11px;
- color: var(--muted);
- line-height: 2.1;
- padding-left: 30px;
- margin: 10px 0;
- }
- .assistant-card {
- background: var(--surface);
- border: 1px solid var(--edge);
- border-radius: 16px;
- padding: 16px;
- font-size: var(--chat-size);
- line-height: 1.85;
- overflow-wrap: anywhere;
- }
- .assistant-card h3 {
- font-size: 16px;
- font-weight: 650;
- margin-bottom: 7px;
- line-height: 1.65;
- }
- .assistant-card p {
- color: var(--ink-2);
- margin: 0 0 12px;
- }
- .assistant-card p:last-child {
- margin-bottom: 0;
- }
- .insight {
- border-left: 2px solid var(--edge);
- padding: 0 0 0 11px;
- margin: 14px 0;
- }
- .insight p {
- margin: 0 0 6px;
- font-size: 13px;
- }
- .insight b {
- color: var(--ink);
- font-weight: 600;
- }
- .files {
- display: grid;
- grid-template-columns: 1fr 1fr;
- gap: 8px;
- margin-top: 15px;
- }
- .file-card {
- background: var(--surface-2);
- border: 1px solid var(--edge);
- border-radius: 10px;
- padding: 11px;
- text-align: left;
- min-width: 0;
- display: flex;
- flex-direction: column;
- gap: 6px;
- }
- .file-type {
- display: grid;
- place-items: center;
- width: 29px;
- height: 34px;
- border: 1px solid #e2c2b7;
- background: #fff0e9;
- color: #ae5737;
- border-radius: 5px;
- font-size: 8px;
- font-weight: 700;
- letter-spacing: 0.3px;
- }
- .file-type.sheet {
- background: #eef5ee;
- color: #487556;
- border-color: #c8dccb;
- }
- .file-card strong {
- font-size: 11px;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- max-width: 100%;
- font-weight: 550;
- }
- .file-card small {
- font-size: 9px;
- color: var(--muted);
- }
- .response-actions {
- display: flex;
- gap: 2px;
- margin-top: 5px;
- }
- .response-actions button {
- min-width: 38px;
- min-height: 36px;
- display: grid;
- place-items: center;
- color: var(--muted);
- }
- .response-actions svg {
- width: 15px;
- height: 15px;
- }
- .composer-wrap {
- padding: 6px 16px 9px;
- flex: none;
- background: var(--canvas);
- }
- .activity-entry {
- display: none;
- align-items: center;
- gap: 7px;
- font-size: 11px;
- min-height: 35px;
- color: var(--muted);
- padding: 0 5px;
- margin-bottom: 3px;
- }
- .activity-entry span {
- flex: 1;
- text-align: left;
- }
- .activity-entry svg {
- width: 15px;
- height: 15px;
- }
- .activity-entry .activity-dot {
- width: 6px;
- height: 6px;
- background: #b78332;
- border-radius: 50%;
- }
- .composer {
- background: var(--surface);
- border: 1px solid var(--edge);
- border-radius: 16px;
- padding: 12px 14px;
- box-shadow:
- 0 4px 8px #17243c14,
- 0 16px 32px #17243c1f;
- }
- .composer textarea {
- resize: none;
- border: 0;
- outline: none !important;
- background: none;
- color: var(--ink);
- font-size: 16px;
- width: 100%;
- height: 48px;
- min-height: 48px;
- max-height: 112px;
- line-height: 1.6;
- display: block;
- padding: 0;
- }
- .composer textarea::placeholder {
- color: var(--muted);
- opacity: 0.75;
- }
- .composer-tools {
- display: flex;
- align-items: center;
- gap: 2px;
- min-height: 40px;
- }
- .tool-button {
- width: 40px;
- height: 40px;
- display: grid;
- place-items: center;
- color: var(--muted);
- border-radius: 50%;
- }
- .agent-tool {
- display: flex;
- align-items: center;
- gap: 5px;
- font-size: 11px;
- color: var(--muted);
- min-height: 40px;
- padding: 0 8px;
- }
- .agent-tool svg {
- width: 14px;
- height: 14px;
- }
- .send-button {
- margin-left: auto;
- background: var(--primary);
- color: var(--primary-content);
- width: 36px;
- height: 36px;
- border-radius: 50%;
- display: grid;
- place-items: center;
- }
- .input-hint {
- display: none;
- text-align: center;
- font-size: 9px;
- color: var(--muted);
- margin-top: 8px;
- opacity: 0.85;
- }
- .attachment-chip {
- background: var(--surface-2);
- font-size: 11px;
- display: flex;
- align-items: center;
- gap: 6px;
- padding: 6px 9px;
- border-radius: 7px;
- margin-bottom: 8px;
- overflow: hidden;
- }
- .attachment-chip span {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .attachment-chip button {
- margin-left: auto;
- flex: none;
- min-width: 32px;
- min-height: 32px;
- }
- .attachment-chip svg {
- width: 15px;
- height: 15px;
- }
- .home-hero {
- text-align: center;
- padding: 60px 20px 35px;
- }
- .home-logo {
- font-size: 49px;
- font-weight: 650;
- letter-spacing: -3px;
- }
- .home-hero h3 {
- font-weight: 500;
- font-size: 18px;
- margin: 15px 0 10px;
- }
- .home-hero p {
- font-size: 11px;
- color: var(--muted);
- }
- .overview {
- display: flex;
- margin: 8px 20px 18px;
- background: var(--surface);
- border: 1px solid var(--edge);
- border-radius: 16px;
- padding: 19px 8px;
- }
- .overview > div {
- flex: 1;
- text-align: center;
- border-right: 1px solid var(--edge);
- }
- .overview > div:last-child {
- border: 0;
- }
- .overview strong {
- font-size: 25px;
- font-weight: 600;
- display: block;
- line-height: 1.3;
- }
- .overview span {
- font-size: 10px;
- color: var(--muted);
- display: block;
- margin-top: 5px;
- }
- .life-card {
- margin: 12px 20px 0;
- background: var(--surface);
- border: 1px solid var(--edge);
- border-radius: 16px;
- padding: 14px 16px;
- box-shadow: var(--shadow);
- }
- .life-head {
- display: flex;
- align-items: center;
- gap: 10px;
- }
- .life-head .row-body strong {
- font-size: 14px;
- display: block;
- }
- .life-head small {
- font-size: 11px;
- color: var(--muted);
- display: block;
- margin-top: 4px;
- }
- .state-tag {
- font-size: 10px;
- border-radius: 5px;
- padding: 4px 6px;
- background: #edf7f1;
- color: #207550;
- white-space: nowrap;
- }
- .state-tag.busy {
- background: #fff7e8;
- color: #91600e;
- }
- .state-tag.offline {
- background: var(--surface-2);
- color: var(--muted);
- }
- .task-line {
- font-size: 11px;
- background: var(--surface-2);
- padding: 10px;
- border-radius: 7px;
- display: flex;
- align-items: center;
- gap: 7px;
- margin: 13px 0;
- }
- .task-line svg {
- width: 14px;
- height: 14px;
- color: var(--muted);
- }
- .task-line span {
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- .metrics {
- display: flex;
- gap: 18px;
- margin: 13px 0 15px;
- }
- .metric {
- flex: 1;
- font-size: 10px;
- color: var(--muted);
- }
- .metric > div {
- display: flex;
- justify-content: space-between;
- }
- .metric-track {
- height: 5px;
- border-radius: 5px;
- background: var(--subtle);
- margin-top: 7px;
- overflow: hidden;
- }
- .metric-track i {
- height: 100%;
- display: block;
- border-radius: 5px;
- background: var(--primary);
- opacity: 0.55;
- }
- .life-actions {
- display: flex;
- gap: 8px;
- border-top: 1px solid var(--edge);
- padding-top: 12px;
- }
- .life-actions button {
- flex: 1;
- min-height: 34px;
- font-size: 11px;
- border-radius: 7px;
- background: var(--surface-2);
- }
- .life-actions button:first-child {
- background: var(--primary);
- color: var(--primary-content);
- }
- .profile-card {
- margin: 8px 20px 0;
- padding: 20px 16px;
- border: 1px solid var(--edge);
- border-radius: 16px;
- background: var(--surface);
- display: flex;
- gap: 13px;
- align-items: center;
- }
- .profile-card .avatar {
- width: 54px;
- height: 54px;
- font-size: 21px;
- }
- .profile-card h3 {
- font-size: 17px;
- font-weight: 600;
- }
- .profile-card p {
- font-size: 11px;
- color: var(--muted);
- margin-top: 7px;
- }
- .settings-card {
- margin: 0 20px;
- background: var(--surface);
- border: 1px solid var(--edge);
- border-radius: 16px;
- overflow: hidden;
- }
- .setting-row {
- display: flex;
- align-items: center;
- gap: 10px;
- padding: 13px 16px;
- min-height: 58px;
- width: 100%;
- text-align: left;
- font-size: 13px;
- }
- .setting-row + .setting-row {
- border-top: 1px solid var(--edge);
- }
- .setting-row > svg {
- width: 17px;
- height: 17px;
- color: var(--muted);
- }
- .setting-row .row-body {
- display: block;
- }
- .setting-row small {
- display: block;
- color: var(--muted);
- font-size: 10px;
- margin-top: 4px;
- }
- .setting-row > span:last-child {
- font-size: 11px;
- color: var(--muted);
- }
- .setting-row .tool-button {
- width: 34px;
- height: 34px;
- }
- .setting-row .tool-button svg {
- width: 17px;
- height: 17px;
- }
- .danger {
- color: #c33f42;
- }
- .palette-label {
- padding: 16px 16px 10px;
- font-size: 12px;
- }
- .palette-grid {
- display: grid;
- grid-template-columns: 1fr 1fr;
- gap: 8px;
- padding: 0 16px 15px;
- }
- .palette-grid button {
- border: 1px solid var(--edge);
- border-radius: 9px;
- text-align: left;
- min-height: 45px;
- padding: 8px;
- display: flex;
- gap: 7px;
- align-items: center;
- font-size: 10px;
- }
- .palette-grid button.selected {
- border-color: var(--primary);
- background: var(--surface-2);
- }
- .palette-swatch {
- width: 17px;
- height: 24px;
- border-radius: 5px;
- box-shadow: inset -6px 0 #ffffffaa;
- flex: none;
- }
- .switch {
- height: 25px;
- width: 43px;
- border-radius: 99px;
- background: var(--edge);
- position: relative;
- flex: none;
- }
- .switch:after {
- content: '';
- position: absolute;
- left: 3px;
- top: 3px;
- width: 19px;
- height: 19px;
- border-radius: 50%;
- background: white;
- box-shadow: 0 1px 3px #0002;
- }
- .switch[aria-checked='true'] {
- background: var(--primary);
- }
- .switch[aria-checked='true']:after {
- left: 21px;
- background: var(--primary-content);
- }
- .font-slider {
- padding: 15px 16px;
- border-top: 1px solid var(--edge);
- font-size: 12px;
- }
- .font-slider label {
- display: flex;
- justify-content: space-between;
- }
- .font-slider input {
- width: 100%;
- accent-color: var(--primary);
- margin-top: 17px;
- }
- .overlay {
- position: absolute;
- inset: 40px 0 0;
- background: #11121465;
- z-index: 20;
- display: flex;
- align-items: flex-end;
- backdrop-filter: blur(2px);
- }
- .sheet {
- background: var(--surface);
- border-radius: 24px 24px 0 0;
- width: 100%;
- max-height: 90%;
- overflow: auto;
- overscroll-behavior: contain;
- padding: 9px 20px 26px;
- box-shadow: 0 -5px 35px #0000000b;
- animation: sheet-in 0.2s ease-out;
- }
- .sheet-handle {
- width: 34px;
- height: 4px;
- background: var(--edge);
- border-radius: 4px;
- margin: 0 auto 14px;
- }
- .sheet-heading {
- display: flex;
- align-items: center;
- gap: 10px;
- margin-bottom: 8px;
- }
- .sheet-heading h3 {
- flex: 1;
- font-size: 17px;
- font-weight: 600;
- }
- .close-button {
- width: 36px;
- height: 36px;
- border-radius: 50%;
- background: var(--surface-2);
- display: grid;
- place-items: center;
- flex: none;
- }
- .close-button svg {
- width: 18px;
- height: 18px;
- }
- .sheet-description {
- font-size: 12px;
- color: var(--muted);
- line-height: 1.8;
- margin-bottom: 20px;
- }
- .sheet .list {
- margin: 10px 0 0;
- }
- .sheet .conversation {
- padding: 13px 12px;
- }
- .sheet .row-meta {
- display: flex;
- font-size: 10px;
- gap: 4px;
- color: var(--muted);
- }
- .sheet .row-meta.running {
- color: #91600e;
- }
- .sheet .row-meta.done {
- color: #207550;
- }
- .sheet .row-meta.error {
- color: #c33f42;
- }
- .sheet .primary-button {
- width: 100%;
- margin-top: 20px;
- }
- .field-label {
- display: block;
- font-size: 12px;
- color: var(--muted);
- margin-bottom: 8px;
- }
- .form-field {
- min-height: 46px;
- border: 1px solid var(--edge);
- border-radius: 10px;
- padding: 12px;
- background: var(--surface-2);
- color: var(--ink);
- width: 100%;
- font-size: 14px;
- }
- .form-error {
- min-height: 24px;
- font-size: 11px;
- color: #c33f42;
- line-height: 24px;
- }
- .candidate {
- border: 1px solid var(--edge);
- border-radius: 9px;
- padding: 12px;
- text-align: left;
- font-size: 12px;
- display: block;
- width: 100%;
- margin-top: 8px;
- }
- .drawer-overlay {
- align-items: stretch;
- }
- .drawer {
- width: 84%;
- max-width: 330px;
- background: var(--surface);
- padding: 22px 16px 20px;
- overflow: auto;
- display: flex;
- flex-direction: column;
- animation: drawer-in 0.2s ease-out;
- }
- .drawer-head {
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-bottom: 22px;
- padding: 0 5px;
- }
- .drawer-head strong {
- font-size: 25px;
- letter-spacing: -1.5px;
- }
- .drawer-new {
- display: flex;
- align-items: center;
- gap: 12px;
- background: var(--primary);
- color: var(--primary-content);
- padding: 13px;
- border-radius: 12px;
- text-align: left;
- }
- .drawer-new strong {
- display: block;
- font-size: 13px;
- }
- .drawer-new small {
- display: block;
- opacity: 0.7;
- font-size: 10px;
- margin-top: 4px;
- }
- .drawer-quick {
- margin: 8px 0;
- padding: 12px 9px;
- background: var(--surface-2);
- border-radius: 10px;
- text-align: left;
- display: flex;
- align-items: center;
- gap: 10px;
- font-size: 12px;
- }
- .drawer-nav {
- padding: 15px 0;
- border-bottom: 1px solid var(--edge);
- }
- .drawer-nav button {
- display: flex;
- align-items: center;
- gap: 11px;
- width: 100%;
- text-align: left;
- min-height: 44px;
- padding: 9px 12px;
- font-size: 13px;
- border-radius: 9px;
- }
- .drawer-nav button.selected {
- background: var(--subtle);
- }
- .drawer-section {
- font-size: 10px;
- color: var(--muted);
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin: 15px 9px 5px;
- }
- .drawer-section button {
- min-width: 32px;
- min-height: 32px;
- }
- .drawer-item {
- display: flex;
- align-items: center;
- gap: 9px;
- text-align: left;
- width: 100%;
- min-height: 42px;
- font-size: 12px;
- padding: 8px 11px;
- border-radius: 8px;
- }
- .drawer-item svg {
- width: 16px;
- height: 16px;
- color: var(--muted);
- }
- .drawer-item span {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .drawer-footer {
- margin-top: auto;
- border-top: 1px solid var(--edge);
- padding-top: 15px;
- display: flex;
- align-items: center;
- gap: 10px;
- font-size: 12px;
- }
- .drawer-footer small {
- display: block;
- color: var(--muted);
- font-size: 10px;
- margin-top: 4px;
- }
- .toast {
- position: absolute;
- left: 16px;
- right: 16px;
- top: 110px;
- z-index: 40;
- background: var(--ink);
- color: var(--surface);
- border-radius: 12px;
- padding: 13px 15px;
- box-shadow: 0 8px 25px #0002;
- font-size: 12px;
- line-height: 1.6;
- display: flex;
- align-items: center;
- gap: 8px;
- animation: sheet-in 0.2s ease-out;
- }
- .toast span {
- flex: 1;
- }
- .toast button {
- font-size: 11px;
- border: 1px solid currentColor;
- border-radius: 7px;
- padding: 5px 8px;
- }
- .preview-document {
- aspect-ratio: 1.42;
- background: #eeeee9;
- color: #262926;
- border-radius: 10px;
- padding: 24px 22px;
- margin: 18px 0;
- display: flex;
- flex-direction: column;
- border: 1px solid #deded6;
- }
- .preview-document .doc-brand {
- font-size: 9px;
- letter-spacing: 2px;
- color: #7b7d74;
- }
- .preview-document h2 {
- font-size: 28px;
- font-weight: 500;
- line-height: 1.5;
- margin: 22px 0 10px;
- letter-spacing: -1px;
- }
- .preview-document p {
- font-size: 11px;
- color: #777a71;
- }
- .preview-document footer {
- font-size: 8px;
- border-top: 1px solid #cecec5;
- padding-top: 10px;
- margin-top: auto;
- }
- .preview-table {
- border-collapse: collapse;
- width: 100%;
- font-size: 12px;
- margin: 24px 0;
- }
- .preview-table td,
- .preview-table th {
- text-align: left;
- border-bottom: 1px solid var(--edge);
- padding: 13px 8px;
- }
- .preview-table th {
- background: var(--surface-2);
- font-size: 11px;
- color: var(--muted);
- }
- .loading-dots {
- display: flex;
- gap: 5px;
- padding: 12px 0;
- }
- .loading-dots i {
- width: 5px;
- height: 5px;
- border-radius: 50%;
- background: var(--muted);
- animation: pulse 1s infinite alternate;
- }
- .loading-dots i:nth-child(2) {
- animation-delay: 0.2s;
- }
- .loading-dots i:nth-child(3) {
- animation-delay: 0.4s;
- }
- .skeleton {
- height: 10px;
- border-radius: 5px;
- background: var(--subtle);
- margin: 13px 0;
- animation: pulse 1s infinite alternate;
- }
- .skeleton.short {
- width: 65%;
- }
- .notification-option {
- display: flex;
- align-items: center;
- gap: 10px;
- font-size: 12px;
- min-height: 44px;
- margin-top: 12px;
- }
- .notification-option input {
- accent-color: var(--primary);
- width: 16px;
- height: 16px;
- }
- .polished {
- --canvas: #f5f5f7;
- --edge: #e8e9ec;
- --shadow: 0 2px 5px #17243c04;
- --muted: #7a7d84;
- }
- .polished .appbar {
- height: 70px;
- padding: 0 20px;
- }
- .polished .round-button {
- border: 1px solid color-mix(in srgb, var(--edge) 65%, transparent);
- box-shadow: 0 2px 3px #20212403;
- }
- .polished .appbar-title h2 {
- font-size: 17px;
- font-weight: 650;
- letter-spacing: 0.2px;
- }
- .polished .appbar-title p {
- font-size: 10px;
- }
- .polished .segmented {
- background: var(--subtle);
- border: 0;
- padding: 3px;
- max-width: none;
- margin: 3px 0 14px;
- }
- .polished .segmented button {
- min-height: 34px;
- font-size: 12px;
- }
- .polished .segmented button.selected {
- box-shadow: 0 1px 4px #17243c0c;
- font-weight: 600;
- }
- .polished .search {
- border: 1px solid var(--edge);
- border-radius: 13px;
- height: 44px;
- }
- .polished .list {
- border-color: color-mix(in srgb, var(--edge) 65%, transparent);
- border-radius: 19px;
- margin-top: 16px;
- box-shadow: 0 3px 10px #20212402;
- }
- .polished .conversation {
- padding: 16px 14px;
- gap: 12px;
- min-height: 81px;
- }
- .polished .conversation + .conversation {
- border-top: 0;
- }
- .polished .conversation + .conversation:before {
- content: '';
- position: absolute;
- left: 68px;
- right: 14px;
- height: 1px;
- top: 0;
- background: var(--edge);
- opacity: 0.75;
- }
- .polished .avatar {
- background: linear-gradient(145deg, var(--surface-2), var(--avatar));
- color: var(--ink-2);
- border: 1px solid color-mix(in srgb, var(--edge) 80%, transparent);
- font-size: 16px;
- font-weight: 500;
- width: 42px;
- height: 42px;
- }
- .polished .presence {
- width: 8px;
- height: 8px;
- right: 1px;
- bottom: 1px;
- }
- .polished .row-title {
- font-size: 14px;
- font-weight: 600;
- line-height: 23px;
- letter-spacing: 0.05px;
- }
- .polished .row-preview {
- font-size: 11px;
- line-height: 20px;
- }
- .polished .row-tail {
- font-size: 9px;
- gap: 9px;
- }
- .polished .unread {
- background: #bc555a;
- min-width: 16px;
- height: 16px;
- font-size: 9px;
- }
- .polished .row-meta {
- display: flex;
- align-items: center;
- gap: 4px;
- font-size: 9px;
- color: #987128;
- margin-top: 3px;
- line-height: 15px;
- }
- .polished .row-meta svg {
- width: 11px;
- height: 11px;
- }
- .polished .row-meta.done {
- color: #487c5e;
- }
- .polished .row-meta.error {
- color: #b35858;
- }
- .polished .tabbar {
- height: 72px;
- border-top-color: color-mix(in srgb, var(--edge) 85%, transparent);
- padding-top: 7px;
- }
- .polished .tabbar .tab-icon {
- height: 29px;
- transition: background 0.2s;
- }
- .polished .tabbar .selected .tab-icon {
- background: var(--subtle);
- }
- .polished .tabbar button {
- font-size: 10px;
- gap: 4px;
- }
- .polished .tabbar svg {
- width: 21px;
- height: 21px;
- }
- .polished .chat-scroll {
- padding: 6px 20px 14px;
- }
- .polished .chat-date {
- margin: 5px 0 20px;
- }
- .polished .user-message {
- font-size: 13px;
- padding: 11px 14px;
- border-radius: 16px 16px 5px 16px;
- background: var(--subtle);
- }
- .polished .agent-line {
- margin: 18px 0 10px;
- gap: 7px;
- font-size: 11px;
- }
- .polished .agent-line .avatar {
- height: 25px;
- width: 25px;
- font-size: 10px;
- }
- .polished .process summary {
- font-size: 9px;
- min-height: 30px;
- background: transparent;
- border-color: var(--edge);
- }
- .polished .assistant-card {
- padding: 16px;
- border-radius: 17px;
- border-color: var(--edge);
- box-shadow: 0 2px 5px #20212402;
- font-size: 13px;
- line-height: 1.9;
- }
- .polished .assistant-card h3 {
- font-size: 16px;
- letter-spacing: -0.1px;
- margin-bottom: 8px;
- }
- .polished .assistant-card p {
- margin-bottom: 11px;
- }
- .polished .insight {
- margin: 14px 0;
- }
- .polished .insight p {
- font-size: 12px;
- margin-bottom: 7px;
- }
- .polished .file-card {
- background: var(--surface-2);
- border-color: var(--edge);
- padding: 10px;
- border-radius: 11px;
- }
- .polished .file-card strong {
- font-size: 10px;
- }
- .polished .composer-wrap {
- padding: 0 16px 7px;
- }
- .polished .activity-entry {
- display: flex;
- width: 100%;
- padding: 0 6px;
- }
- .polished .composer {
- border-radius: 20px;
- padding: 12px 12px 8px;
- box-shadow: 0 3px 12px #20212405;
- border: 1px solid var(--edge);
- }
- .polished .composer textarea {
- padding: 1px 3px;
- min-height: 42px;
- height: 42px;
- font-size: 14px;
- }
- .polished .input-hint {
- display: block;
- }
- .polished .send-button {
- width: 36px;
- height: 36px;
- }
- .polished .agent-tool {
- border-radius: 99px;
- background: var(--surface-2);
- min-height: 29px;
- padding: 0 9px;
- font-size: 10px;
- }
- .polished .tool-button {
- width: 36px;
- height: 36px;
- }
- .polished .overview {
- border-radius: 18px;
- padding: 19px 8px;
- margin-top: 10px;
- border-color: var(--edge);
- }
- .polished .overview strong {
- font-size: 26px;
- letter-spacing: -0.5px;
- font-weight: 550;
- }
- .polished .life-card {
- box-shadow: none;
- padding: 16px;
- border-radius: 18px;
- }
- .polished .life-head .avatar {
- width: 40px;
- height: 40px;
- }
- .polished .life-actions button {
- min-height: 38px;
- border-radius: 9px;
- }
- .polished .task-line {
- padding: 11px 10px;
- border-radius: 9px;
- margin-top: 16px;
- }
- .polished .profile-card {
- border-radius: 20px;
- padding: 22px 18px;
- }
- .polished .profile-card .avatar {
- width: 54px;
- height: 54px;
- font-size: 21px;
- }
- .polished .settings-card {
- border-radius: 18px;
- }
- .polished .setting-row {
- min-height: 62px;
- }
- .polished .setting-row + .setting-row {
- border-top-color: var(--edge);
- }
- .polished .home-hero {
- padding-top: 54px;
- }
- .polished .home-logo {
- font-size: 55px;
- }
- .polished .sheet .list {
- margin: 10px 0 0;
- }
- .polished .sheet .conversation {
- padding: 14px 11px;
- }
- .polished .sheet .row-meta {
- display: flex;
- }
- .polished .chat-scroll .assistant-card {
- font-size: var(--chat-size);
- }
- .baseline .row-meta {
- display: none;
- }
- .baseline .sheet .row-meta {
- display: flex;
- }
- .baseline .agent-tool {
- padding-left: 4px;
- }
- .baseline .agent-tool span {
- display: none;
- }
- .baseline .input-hint {
- display: none;
- }
- .baseline .life-actions button {
- min-height: 34px;
- }
- .baseline .chat-scroll .assistant-card {
- font-size: var(--chat-size);
- }
- :root {
- font-family:
- -apple-system, BlinkMacSystemFont, 'Noto Sans SC', 'Segoe UI', 'Microsoft YaHei', sans-serif;
- }
- .app-shell {
- display: flex;
- flex-direction: column;
- flex: 1;
- min-height: 0;
- }
- .file-card small {
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 3px;
- }
- .file-card small svg {
- width: 10px;
- height: 10px;
- }
- .empty > .avatar {
- margin: 0 auto 17px;
- }
- .person-children {
- background: var(--surface-2);
- padding-left: 24px;
- }
- .person-children .conversation {
- min-height: 65px;
- padding-top: 10px;
- padding-bottom: 10px;
- }
- .person-children .avatar {
- width: 32px;
- height: 32px;
- font-size: 13px;
- }
- .sheet .profile-card p {
- line-height: 1.8;
- }
- .polished .conversation {
- padding-top: 11px;
- padding-bottom: 11px;
- min-height: 76px;
- }
- .polished .row-title {
- font-size: 15px;
- font-weight: 550;
- }
- .polished .row-preview {
- font-size: 12px;
- }
- .overview strong {
- margin-top: 5px;
- }
- .overview span {
- margin-top: 0;
- }
- @keyframes sheet-in {
- from {
- transform: translateY(16px);
- opacity: 0;
- }
- to {
- transform: translateY(0);
- opacity: 1;
- }
- }
- .activity-entry .activity-dot.idle {
- background: var(--muted);
- }
- .send-button,
- .close-button {
- position: relative;
- }
- .send-button:before,
- .close-button:before {
- content: '';
- position: absolute;
- inset: -4px;
- }
- @keyframes drawer-in {
- from {
- transform: translateX(-20px);
- opacity: 0;
- }
- to {
- transform: translateX(0);
- opacity: 1;
- }
- }
- @keyframes pulse {
- from {
- opacity: 0.35;
- }
- to {
- opacity: 1;
- }
- }
- @media (min-width: 1500px) {
- .studio {
- padding-top: 42px;
- }
- .comparison {
- gap: 70px;
- }
- .phone {
- height: 820px;
- }
- }
- @media (max-width: 1000px) and (min-width: 701px) {
- .studio {
- padding: 25px 25px;
- }
- .comparison {
- gap: 28px;
- }
- .specimen {
- width: min(390px, calc((100vw - 78px) / 2));
- }
- .phone {
- height: 780px;
- }
- .studio-header {
- margin: 0 25px;
- }
- .studio-heading {
- align-items: flex-start;
- }
- .studio-heading p {
- max-width: 360px;
- }
- .view-control button {
- padding: 8px;
- }
- .specimen-caption > span {
- display: none;
- }
- }
- @media (max-width: 700px) {
- html,
- body {
- height: 100%;
- overflow: hidden;
- background: #f5f5f7;
- }
- .studio-header,
- .studio-heading,
- .scene-nav,
- .studio-footer,
- .specimen-caption,
- .specimen-note {
- display: none;
- }
- .studio {
- padding: 0;
- height: 100dvh;
- width: 100%;
- max-width: none;
- display: flex;
- flex-direction: column;
- }
- .mobile-review {
- height: 35px;
- flex: none;
- display: flex;
- align-items: center;
- gap: 3px;
- padding: 0 12px;
- background: #e9eaed;
- color: #777c83;
- font-size: 10px;
- border-bottom: 1px solid #dfe1e4;
- }
- .mobile-review > span {
- margin-right: auto;
- letter-spacing: 0.3px;
- }
- .mobile-review button {
- padding: 4px 11px;
- border-radius: 5px;
- font-size: 10px;
- }
- .mobile-review button.selected {
- background: white;
- color: #25272a;
- box-shadow: 0 1px 2px #00000008;
- }
- .comparison {
- display: block;
- min-height: 0;
- flex: 1;
- }
- .specimen {
- width: 100%;
- height: 100%;
- }
- .baseline-specimen {
- display: none;
- }
- .phone {
- height: 100%;
- border-radius: 0;
- box-shadow: none;
- padding-top: env(safe-area-inset-top);
- }
- .statusbar {
- display: none;
- }
- .home-indicator {
- height: env(safe-area-inset-bottom);
- min-height: 8px;
- }
- .home-indicator:after {
- display: none;
- }
- .overlay {
- top: 0;
- }
- .sheet {
- padding-bottom: max(24px, env(safe-area-inset-bottom));
- }
- .toast {
- top: 74px;
- }
- body[data-view='baseline'] .baseline-specimen {
- display: block;
- }
- body[data-view='compare'] .polished-specimen {
- display: block;
- }
- .polished .appbar-title h2 {
- font-size: 16px;
- }
- .studio .specimen {
- margin: 0;
- }
- .polished .appbar {
- padding: 0 16px;
- }
- }
- @media (max-width: 350px) {
- .filter-area {
- padding: 0 14px;
- }
- .list,
- .life-card,
- .overview,
- .settings-card,
- .profile-card {
- margin-left: 14px;
- margin-right: 14px;
- }
- .appbar,
- .polished .appbar {
- padding: 0 12px;
- gap: 6px;
- }
- .appbar-right {
- gap: 5px;
- }
- .round-button {
- width: 40px;
- height: 40px;
- }
- .polished .conversation,
- .conversation {
- padding-left: 12px;
- padding-right: 12px;
- gap: 9px;
- }
- .row-title,
- .polished .row-title {
- font-size: 13px;
- }
- .row-preview,
- .polished .row-preview {
- font-size: 10px;
- }
- .chat-scroll,
- .polished .chat-scroll {
- padding-left: 14px;
- padding-right: 14px;
- }
- .sheet {
- padding-left: 16px;
- padding-right: 16px;
- }
- .appbar-title h2,
- .polished .appbar-title h2 {
- font-size: 14px;
- }
- .polished .avatar {
- width: 38px;
- height: 38px;
- }
- }
- @media (prefers-reduced-motion: reduce) {
- *,
- *:before,
- *:after {
- animation: none !important;
- transition: none !important;
- scroll-behavior: auto !important;
- }
- }
- </style>
- </head>
- <body>
- <header class="studio-header">
- <div class="brand">
- <span class="brand-mark">f</span><strong>fmode</strong><span class="brand-divider"></span
- ><span>Mobile UI refinement</span>
- </div>
- <span class="prototype-label">独立 HTML 原型 · 未接入业务</span>
- </header>
- <main class="studio">
- <section class="studio-heading">
- <div>
- <div class="eyebrow">保留熟悉感,只打磨细节</div>
- <h1>现有界面,轻一点。清楚一点。</h1>
- <p>不换产品语言,不改业务流程。以项目现有移动端为底稿精修。</p>
- </div>
- <div class="view-control" aria-label="对照模式">
- <button data-view="compare" class="selected">前后对照</button
- ><button data-view="polished">只看精修</button
- ><button data-view="baseline">只看原版</button>
- </div>
- </section>
- <nav class="scene-nav" aria-label="预览页面"></nav>
- <div class="mobile-review">
- <span>fmode · UI 预览</span><button data-view="polished" class="selected">精修</button
- ><button data-view="baseline">原版</button>
- </div>
- <section class="comparison" aria-label="移动端界面对照">
- <article class="specimen baseline-specimen">
- <header class="specimen-caption">
- <div><span class="version-number">01</span><strong>现有 UI · HTML 复刻</strong></div>
- <span>按当前源码还原</span>
- </header>
- <div class="phone baseline" id="baseline"></div>
- <p class="specimen-note">保留当前配色、尺寸与布局;非生产页面截图。</p>
- </article>
- <article class="specimen polished-specimen">
- <header class="specimen-caption">
- <div><span class="version-number">02</span><strong>同一套 UI · 细节精修</strong></div>
- <span class="live-label"><i></i> 可交互</span>
- </header>
- <div class="phone polished" id="polished"></div>
- <p class="specimen-note" id="design-note"></p>
- </article>
- </section>
- <footer class="studio-footer">
- <span>同一份演示数据 · 页面切换同步对照</span
- ><span>点击会话进入聊天,体验输入、切换与文件预览</span>
- </footer>
- </main>
- <script>
- (() => {
- 'use strict';
- const paths = {
- menu: 'M4 6h16M4 12h12M4 18h16',
- edit: 'M14 4l6 6M4 20l4-1L20 7a2.1 2.1 0 0 0-3-3L5 16zM13 4H5a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h13a2 2 0 0 0 2-2v-7',
- chat: 'M21 11.5a8.5 8.5 0 0 1-8.5 8.5H5l-3 2 1.5-5A8.5 8.5 0 1 1 21 11.5zM7 10h10M7 14h6',
- people:
- 'M15 20H3v-2a5 5 0 0 1 10 0v2M21 20v-2a5 5 0 0 0-4-4M17 3a4 4 0 0 1 0 8M12 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0',
- grid: 'M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h6v6h-6z',
- user: 'M16 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0M4 21v-2a8 8 0 0 1 16 0v2',
- search: 'M16.5 16.5L21 21M18 10.5a7.5 7.5 0 1 1-15 0 7.5 7.5 0 0 1 15 0',
- plus: 'M12 5v14M5 12h14',
- back: 'M15 5l-7 7 7 7',
- chevron: 'M9 5l7 7-7 7',
- down: 'M6 9l6 6 6-6',
- close: 'M6 6l12 12M6 18L18 6',
- folder: 'M3 7V5a2 2 0 0 1 2-2h5l2 3h7a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2zM3 9h18',
- switch: 'M4 5h12M8 12h12M4 19h12M20 3v4M4 10v4M20 17v4',
- arrow: 'M12 19V5M6 11l6-6 6 6',
- attach: 'M8 13l7-7a3 3 0 0 1 4 4l-9 9a5 5 0 0 1-7-7l9-9M7 14l7-7',
- target:
- 'M12 3v4M12 17v4M3 12h4M17 12h4M19 12a7 7 0 1 1-14 0 7 7 0 0 1 14 0M14 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0',
- check: 'M5 12l4 4L19 6',
- clock: 'M12 7v5l3 2M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0',
- copy: 'M8 8h12v13H8zM16 8V3H3v13h5',
- refresh: 'M20 7a9 9 0 1 0 1 8M20 3v5h-5',
- eye: 'M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0',
- bell: 'M18 8a6 6 0 0 0-12 0c0 9-3 9-3 10h18c0-1-3-1-3-10M9 21h6',
- archive: 'M3 3h18v5H3zM5 8v13h14V8M9 12h6',
- file: 'M14 2H5v20h14V7zM14 2v5h5M8 12h8M8 16h6',
- signal: 'M4 18v-3M9 18v-6M14 18V9M19 18V5',
- wifi: 'M3 8a15 15 0 0 1 18 0M6 12a10 10 0 0 1 12 0M9 16a5 5 0 0 1 6 0M12 20h.01',
- battery: 'M2 6h17v12H2zM22 10v4M5 9h11v6H5z',
- moon: 'M20 14a8 8 0 0 1-10-10 9 9 0 1 0 10 10',
- logout: 'M10 3H3v18h7M8 12h13M17 8l4 4-4 4',
- home: 'M3 10l9-7 9 7v11h-7v-7h-4v7H3z',
- info: 'M12 11v6M12 7h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0',
- };
- const icon = (name) =>
- `<svg viewBox="0 0 24 24" aria-hidden="true"><path d="${paths[name] || paths.chat}"/></svg>`;
- const escape = (value) =>
- String(value ?? '').replace(
- /[&<>"']/g,
- (char) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[char],
- );
- const tabs = [
- ['messages', '会话', 'chat'],
- ['contacts', '通讯录', 'people'],
- ['workbench', '工作台', 'grid'],
- ['mine', '我的', 'user'],
- ];
- const scenes = [
- ...tabs.slice(0, 1),
- ['chat/c1', '会话详情', 'edit'],
- ...tabs.slice(1),
- ['home', '新建会话', 'plus'],
- ];
- const agents = [
- { id: 'nova', name: 'Nova', job: '数据分析 · 商业洞察', state: '在线', cpu: 24, memory: 38 },
- {
- id: 'orbit',
- name: 'Orbit',
- job: '产品设计 · 前端开发',
- state: '运行中',
- cpu: 68,
- memory: 52,
- },
- { id: 'atlas', name: 'Atlas', job: '项目管理 · 进度协同', state: '在线', cpu: 12, memory: 26 },
- { id: 'echo', name: 'Echo', job: '内容创作 · 品牌文案', state: '在线', cpu: 8, memory: 21 },
- {
- id: 'pilot',
- name: 'Pilot',
- job: '工程开发 · 自动化',
- state: '离线',
- cpu: null,
- memory: null,
- },
- ];
- const sessions = [
- {
- id: 'c1',
- title: '季度经营复盘报告',
- agent: 'nova',
- preview: '已生成 12 页 PPT 与数据附录',
- time: '09:42',
- unread: 3,
- status: 'done',
- workspace: 'w1',
- },
- {
- id: 'c2',
- title: '移动端首页改版',
- agent: 'orbit',
- preview: '首页骨架已完成,正在调整细节',
- time: '09:15',
- unread: 2,
- status: 'running',
- workspace: 'w2',
- },
- {
- id: 'c3',
- title: 'Q3 里程碑对齐',
- agent: 'atlas',
- preview: '本周 3 个阻塞项需要人工确认',
- time: '昨天',
- unread: 0,
- status: 'waiting',
- workspace: 'w1',
- },
- {
- id: 'c4',
- title: '产品发布会通稿润色',
- agent: 'echo',
- preview: '第二版已整理,等待你的反馈',
- time: '昨天',
- unread: 0,
- status: 'idle',
- workspace: null,
- },
- {
- id: 'c5',
- title: '构建流水线排障',
- agent: 'pilot',
- preview: '构建中断,需要检查环境配置',
- time: '周五',
- unread: 0,
- status: 'error',
- workspace: 'w2',
- },
- {
- id: 'c6',
- title: '上半年客户满意度分析',
- agent: 'nova',
- preview: '分析结果已保存至文件夹',
- time: '周四',
- unread: 0,
- status: 'idle',
- workspace: null,
- },
- ];
- const workspaces = [
- { id: 'w1', name: '经营与增长' },
- { id: 'w2', name: '产品与研发' },
- ];
- const colleagues = [
- { id: 'p1', name: '陈晓', mobile: '138****2608', agents: ['nova', 'atlas'] },
- { id: 'p2', name: '林悦', mobile: '139****5316', agents: ['orbit', 'echo', 'pilot'] },
- ];
- const openPeople = new Set();
- const storageKey = 'fmode-current-polish-v1';
- let saved = {};
- try {
- saved = JSON.parse(localStorage.getItem(storageKey) || '{}');
- } catch {}
- const state = {
- route: 'messages',
- filter: 'all',
- query: '',
- contactFilter: 'all',
- workFilter: 'all',
- openGroups: new Set(),
- overlay: null,
- overlayData: null,
- toast: null,
- drafts: saved.drafts && typeof saved.drafts === 'object' ? saved.drafts : {},
- palette: ['platinum', 'ice', 'clay', 'slate'].includes(saved.palette)
- ? saved.palette
- : 'platinum',
- dark: !!saved.dark,
- font: Math.max(12, Math.min(20, Number(saved.font) || 14)),
- notify: saved.notify !== false,
- tokenShown: false,
- view: 'compare',
- turns: {},
- attachments: {},
- returnRoute: 'messages',
- };
- let toastTimer;
- let sourcePanel = 'polished';
- let restoreAction = null;
- const phones = [...document.querySelectorAll('.phone')];
- const getAgent = (id) => agents.find((agent) => agent.id === id) || agents[0];
- const current = () => sessions.find((session) => session.id === state.route.split('/')[1]);
- const persist = () => {
- try {
- localStorage.setItem(
- storageKey,
- JSON.stringify({
- drafts: state.drafts,
- palette: state.palette,
- dark: state.dark,
- font: state.font,
- notify: state.notify,
- }),
- );
- } catch {}
- };
- const button = (name, label, action, extra = '') =>
- `<button class="round-button" aria-label="${escape(label)}" title="${escape(label)}" data-action="${action}" ${extra}>${icon(name)}</button>`;
- const avatar = (agent, online = true) =>
- `<span class="avatar" aria-hidden="true">${escape(agent.name[0])}${online ? `<i class="presence ${agent.state === '离线' ? 'off' : ''}"></i>` : ''}</span>`;
- const stateLabel = (session) =>
- ({ running: '正在处理', done: '已完成', waiting: '待你确认', error: '需要处理' })[
- session.status
- ] || '';
- const row = (session, activity = false) => {
- const agent = getAgent(session.agent);
- return `<button class="conversation" data-action="chat" data-id="${session.id}">${avatar(agent)}<span class="row-body"><span class="row-title">${escape(session.title)}</span><span class="row-preview">${escape(agent.name)} · ${escape(session.preview)}</span>${activity || ['running', 'waiting', 'error'].includes(session.status) ? `<span class="row-meta ${session.status}">${icon(session.status === 'done' ? 'check' : session.status === 'error' ? 'info' : 'clock')}${stateLabel(session) || '随时继续'}${activity && state.drafts[session.id] ? ' · 有草稿' : ''}</span>` : ''}</span><span class="row-tail"><time>${escape(session.time)}</time>${session.unread ? `<span class="unread">${session.unread}</span>` : ''}</span></button>`;
- };
- const statusbar = () =>
- `<div class="statusbar" aria-hidden="true"><span>9:41</span><span class="status-icons">${icon('signal')}${icon('wifi')}${icon('battery')}</span></div>`;
- function appbar() {
- if (state.route.startsWith('agent/'))
- return `<header class="appbar">${button('back', '返回通讯录', 'contacts')}<div class="appbar-title"><h2>容器设置</h2></div><span class="header-spacer"></span></header>`;
- const session = current();
- if (session)
- return `<header class="appbar">${button('back', '返回会话', 'back')}<div class="appbar-title"><button data-action="title" aria-label="编辑会话标题"><h2>${escape(session.title)}</h2><p>${escape(getAgent(session.agent).name)} · ${session.status === 'running' ? '正在处理' : '会话可追踪'}</p></button></div><div class="appbar-right">${button('switch', '切换会话', 'activity')}${button('folder', '会话文件', 'files')}</div></header>`;
- const title = tabs.find((tab) => tab[0] === state.route)?.[1] || '';
- return `<header class="appbar">${button('menu', '打开导航', 'drawer')}<div class="appbar-title"><h2>${title}</h2></div>${state.route === 'messages' ? button('edit', '新建对话', 'new') : state.route === 'home' ? button('chat', '查看会话', 'messages') : '<span class="header-spacer"></span>'}</header>`;
- }
- const tabbar = () =>
- `<nav class="tabbar" aria-label="主导航">${tabs.map(([route, label, name]) => `<button class="${state.route === route ? 'selected' : ''}" data-action="route" data-route="${route}" ${state.route === route ? 'aria-current="page"' : ''}><span class="tab-icon">${icon(name)}${route === 'messages' && sessions.some((session) => session.unread) ? `<span class="unread">${sessions.reduce((total, session) => total + session.unread, 0)}</span>` : ''}</span>${label}</button>`).join('')}</nav>`;
- const segmented = (options, value, action) =>
- `<div class="segmented" aria-label="筛选">${options.map(([key, label]) => `<button class="${value === key ? 'selected' : ''}" data-action="${action}" data-value="${key}" aria-pressed="${value === key}">${label}</button>`).join('')}</div>`;
- const search = (placeholder) =>
- `<label class="search">${icon('search')}<input data-field="search" aria-label="${placeholder}" type="search" value="${escape(state.query)}" placeholder="${placeholder}" autocomplete="off" /></label>`;
- const empty = (title, description) =>
- `<div class="empty">${icon('search')}<h3>${title}</h3><p>${description}</p></div>`;
- function messages() {
- const filtered = sessions.filter(
- (session) =>
- !session.archived &&
- `${session.title} ${getAgent(session.agent).name} ${session.preview}`
- .toLowerCase()
- .includes(state.query.toLowerCase()),
- );
- let body;
- if (state.filter === 'workspace') {
- body =
- `<div class="section-label"><span>工作区</span><button class="text-button" data-action="workspace-new">${icon('plus')}新建</button></div>` +
- workspaces
- .map((workspace) => {
- const items = filtered.filter((session) => session.workspace === workspace.id);
- return `<div class="list"><button class="group-toggle" data-action="group" data-id="${workspace.id}" aria-expanded="${state.openGroups.has(workspace.id)}">${icon('folder')}<strong>${escape(workspace.name)}</strong><span>${items.length} 个会话</span>${icon(state.openGroups.has(workspace.id) ? 'down' : 'chevron')}</button>${state.openGroups.has(workspace.id) ? items.map((session) => row(session)).join('') + `<div class="group-actions"><button data-action="workspace-rename" data-id="${workspace.id}">重命名</button><button data-action="workspace-delete" data-id="${workspace.id}">删除工作区</button></div>` : ''}</div>`;
- })
- .join('');
- const daily = filtered.filter((session) => !session.workspace);
- body += `<h3 class="section-label">日常会话</h3>${daily.length ? `<div class="list">${daily.map((session) => row(session)).join('')}</div>` : empty('暂无日常会话', '未归入工作区的会话将显示在这里')}`;
- } else
- body = filtered.length
- ? `<div class="list">${filtered.map((session) => row(session)).join('')}</div><p class="list-footer">所有会话均已同步</p>`
- : empty('没有找到相关会话', '试试会话标题或数字生命的名字');
- return `<div class="filter-area">${segmented(
- [
- ['all', '全部'],
- ['workspace', '工作区'],
- ],
- state.filter,
- 'filter',
- )}${search('搜索会话')}</div><main class="page-content">${body}</main>`;
- }
- const fileCards = () =>
- `<div class="files"><button class="file-card" data-action="preview" data-id="ppt"><span class="file-type">PPT</span><strong>季度经营复盘.pptx</strong><small>12 页 · 2.4 MB ${icon('chevron')}</small></button><button class="file-card" data-action="preview" data-id="xlsx"><span class="file-type sheet">XLS</span><strong>经营数据附录.xlsx</strong><small>3 个工作表 · 128 KB ${icon('chevron')}</small></button></div>`;
- const process = () =>
- `<details class="process"><summary>${icon('check')}运行了 3 步 · terminal · 4s<span>已完成</span>${icon('down')}</summary><ol><li>读取并核对季度经营数据</li><li>整理核心指标与趋势</li><li>生成报告与数据附录</li></ol></details>`;
- function initialTurn(session) {
- const agent = getAgent(session.agent);
- if (session.fresh)
- return `<div class="empty">${avatar(agent, false)}<h3>和 ${escape(agent.name)} 开始新对话</h3><p>告诉我你想完成什么。<br>这条会话的过程与结果都会留在这里。</p></div>`;
- if (session.id !== 'c1')
- return `<p class="chat-date">今天 · ${escape(session.time)}</p><div class="user-message">${escape(session.title)},请帮我继续推进。</div><div class="agent-line">${avatar(agent, false)}${escape(agent.name)}<span class="agent-status">${stateLabel(session)}</span></div><div class="assistant-card"><h3>${escape(session.title)}</h3><p>${escape(session.preview)}</p><p>这是用于预览当前移动端布局的演示内容。</p>${session.status === 'running' ? '<div class="skeleton"></div><div class="skeleton short"></div>' : ''}</div>`;
- return `<p class="chat-date">今天 · 09:41</p><div class="user-message">帮我整理本季度的经营数据,做一份复盘报告,重点看收入增长和客户留存。</div><div class="agent-line">${avatar(agent, false)}${escape(agent.name)}<span class="agent-status">09:42</span></div>${process()}<section class="assistant-card"><h3>季度复盘,已经整理好了。</h3><p>我梳理了本季度的经营表现,三个值得关注的变化:</p><div class="insight"><p><b>收入稳步增长</b><br>环比增长 18.6%,核心产品持续拉动。</p><p><b>客户留存改善</b><br>续费率达到 92%,较上季度提升 4 个百分点。</p><p><b>下一步的重点</b><br>优化新客转化,持续跟进高价值客户。</p></div><p>完整结论和数据已放进报告,可以直接预览。</p>${fileCards()}</section><div class="response-actions"><button aria-label="复制回复" data-action="copy">${icon('copy')}</button><button aria-label="会话更多操作" data-action="chat-menu">${icon('switch')}</button></div>`;
- }
- function composer(session) {
- const key = session?.id || 'home';
- const attachment = state.attachments[key];
- const busy = session?.sending;
- const count = sessions.filter((item) => item.status === 'running').length;
- return `<footer class="composer-wrap">${session ? `<button class="activity-entry" data-action="activity"><i class="activity-dot ${count ? '' : 'idle'}"></i><span>${count ? `${count} 个会话进行中` : '暂无运行中的会话'} · 随时切换,不丢草稿</span>${icon('chevron')}</button>` : ''}<div class="composer">${attachment ? `<div class="attachment-chip">${icon('file')}<span>${escape(attachment)}</span><button data-action="remove-attachment" aria-label="移除附件">${icon('close')}</button></div>` : ''}<textarea data-field="draft" aria-label="消息输入框" rows="2" placeholder="${session ? '发送消息,继续一起推进…' : '想做什么?从这里开始…'}">${escape(state.drafts[key] || '')}</textarea><div class="composer-tools"><button class="tool-button" data-action="attach" aria-label="添加附件">${icon('attach')}</button><button class="agent-tool" data-action="${session ? 'chat-menu' : 'new'}" aria-label="${session ? '当前数字生命操作' : '选择数字生命'}">${icon('target')}<span>${session ? escape(getAgent(session.agent).name) : '选择数字生命'}</span>${session ? icon('down') : ''}</button><button class="send-button" aria-label="发送消息" data-action="send" ${busy || (!state.drafts[key]?.trim() && !attachment) ? 'disabled' : ''}>${icon('arrow')}</button></div><input type="file" data-field="attachment" hidden /></div><p class="input-hint">Enter 换行 · 点击箭头发送</p></footer>`;
- }
- function chat() {
- const session = current();
- if (!session)
- return `<main class="page-content">${empty('会话不存在', '请返回会话列表重新选择。')}<button class="primary-button" data-action="messages">返回会话</button></main>`;
- const turns = state.turns[session.id] || [];
- return `<main class="page-content chat-scroll">${initialTurn(session)}${turns.map((turn) => `<div class="user-message">${escape(turn.text)}${turn.attachment ? `<br>附件:${escape(turn.attachment)}` : ''}</div><div class="agent-line">${avatar(getAgent(session.agent), false)}${escape(getAgent(session.agent).name)}</div><div class="assistant-card">${turn.done ? '<p>收到,已记录这次补充。实际项目中会继续调用原有会话流程。</p><p>这是本地原型的演示回复,未请求 AI 或业务接口。</p>' : '<div class="loading-dots" aria-label="处理中"><i></i><i></i><i></i></div>'}</div>`).join('')}</main>${composer(session)}`;
- }
- function contacts() {
- const filtered = agents.filter((agent) =>
- `${agent.name} ${agent.job}`.toLowerCase().includes(state.query.toLowerCase()),
- );
- const people = colleagues.filter((person) =>
- `${person.name} ${person.mobile} ${person.agents.map((id) => getAgent(id).name).join(' ')}`
- .toLowerCase()
- .includes(state.query.toLowerCase()),
- );
- const agentRow = (agent) =>
- `<button class="conversation" data-action="agent" data-id="${agent.id}">${avatar(agent)}<span class="row-body"><strong class="row-title">${escape(agent.name)}</strong><span class="row-preview">${escape(agent.job)}</span></span><span class="row-tail">${icon('chevron')}</span></button>`;
- let body = '';
- if (state.contactFilter !== 'agents' && people.length)
- body += `<h3 class="section-label">同事 · ${people.length}</h3><div class="list">${people.map((person) => `<button class="conversation" data-action="person" data-id="${person.id}" aria-expanded="${openPeople.has(person.id)}">${avatar(person, false)}<span class="row-body"><span class="row-title">${person.name}</span><span class="row-preview">${person.mobile} · ${person.agents.length} 个容器</span></span>${icon(openPeople.has(person.id) ? 'down' : 'chevron')}</button>${openPeople.has(person.id) ? `<div class="person-children">${person.agents.map((id) => agentRow(getAgent(id))).join('')}</div>` : ''}`).join('')}</div>`;
- if (state.contactFilter !== 'people' && filtered.length)
- body += `<h3 class="section-label">数字生命 · ${filtered.length}</h3><div class="list">${filtered.map(agentRow).join('')}</div>`;
- return `<div class="filter-area">${segmented(
- [
- ['all', '全部'],
- ['agents', '数字生命'],
- ['people', '同事'],
- ],
- state.contactFilter,
- 'contact-filter',
- )}${search('搜索名称或专长')}</div><main class="page-content">${body || empty('没有匹配的联系人', '试试名称或专长')}</main>`;
- }
- function agentPage() {
- const agent = getAgent(state.route.split('/')[1]);
- return `<main class="page-content"><section class="settings-card" style="margin-top:16px"><div class="setting-row"><span class="row-body">当前名称</span><strong>${escape(agent.name)}</strong></div><button class="setting-row" data-action="rename-agent" data-id="${agent.id}">${icon('edit')}<span class="row-body">重命名</span>${icon('chevron')}</button><button class="setting-row" data-action="create-chat" data-id="${agent.id}">${icon('chat')}<span class="row-body">进入会话</span>${icon('chevron')}</button></section><p class="list-footer">演示管理员操作 · 仅修改本地示例</p></main>`;
- }
- function lifeCard(agent) {
- const session = sessions.find((item) => item.agent === agent.id);
- return `<article class="life-card"><div class="life-head">${avatar(agent)}<div class="row-body"><strong>${escape(agent.name)}</strong><small>${escape(agent.job)}</small></div><span class="state-tag ${agent.state === '运行中' ? 'busy' : agent.state === '离线' ? 'offline' : ''}">${agent.state}</span></div><div class="task-line">${icon('chat')}<span>${session ? escape(session.title) : '暂无进行中的会话'}</span></div>${
- agent.cpu === null
- ? '<p class="task-line">指标未上报</p>'
- : `<div class="metrics">${[
- ['CPU', agent.cpu],
- ['内存', agent.memory],
- ]
- .map(
- ([label, value]) =>
- `<div class="metric"><div><span>${label}</span><span>${value}%</span></div><div class="metric-track"><i style="width:${value}%"></i></div></div>`,
- )
- .join('')}</div>`
- }<div class="life-actions"><button data-action="enter-agent" data-id="${agent.id}">进入</button><button data-action="channel" data-id="${agent.id}">通道</button><button data-action="recharge" data-id="${agent.id}">充值</button></div></article>`;
- }
- function workbench() {
- const filtered = agents.filter(
- (agent) =>
- (state.workFilter === 'all' ||
- (state.workFilter === 'online' ? agent.state !== '离线' : agent.state === '离线')) &&
- `${agent.name} ${agent.job}`.toLowerCase().includes(state.query.toLowerCase()),
- );
- return `<div class="filter-area">${segmented(
- [
- ['all', '全部'],
- ['online', '在线'],
- ['offline', '离线'],
- ],
- state.workFilter,
- 'work-filter',
- )}${search('搜索数字生命')}</div><main class="page-content"><div class="overview"><div><span>数字生命</span><strong>5</strong></div><div><span>在线</span><strong>4</strong></div><div><span>离线</span><strong>1</strong></div></div>${filtered.length ? filtered.map(lifeCard).join('') : empty('暂无匹配的数字生命', '切换筛选或试试其他关键词')}</main>`;
- }
- function mine() {
- return `<main class="page-content"><section class="profile-card"><span class="avatar">F</span><div><h3>fmode 体验账号</h3><p>演示资料 · 人机共生中枢</p></div></section><h3 class="section-label">账号</h3><section class="settings-card"><div class="setting-row"><span class="row-body">访问 Token<small>${state.tokenShown ? 'DEMO-TOKEN-NOT-A-REAL-CREDENTIAL' : '•••• •••• •••• ••••'}</small></span><button class="tool-button" data-action="token" aria-label="${state.tokenShown ? '隐藏' : '显示'} Token">${icon('eye')}</button><button class="tool-button" data-action="copy-token" aria-label="复制 Token" ${state.tokenShown ? '' : 'disabled'}>${icon('copy')}</button></div><button class="setting-row" data-action="logout"><span class="row-body danger">退出登录</span>${icon('chevron')}</button></section><h3 class="section-label">通知</h3><section class="settings-card"><button class="setting-row" data-action="notifications">${icon('bell')}<span class="row-body">消息与任务通知<small>原生端入口 · 此处仅演示提醒</small></span>${icon('chevron')}</button></section><h3 class="section-label">外观</h3><section class="settings-card"><p class="palette-label">整体配色</p><div class="palette-grid">${[
- ['platinum', '铂金曜黑', '#25272a'],
- ['ice', '冰白靛蓝', '#4056c7'],
- ['clay', '暖瓷陶橘', '#af482b'],
- ['slate', '岩灰鸢紫', '#6952a3'],
- ]
- .map(
- ([id, name, color]) =>
- `<button data-action="palette" data-id="${id}" aria-pressed="${state.palette === id}" class="${state.palette === id ? 'selected' : ''}"><span class="palette-swatch" style="background:${color}"></span>${name}</button>`,
- )
- .join(
- '',
- )}</div><div class="setting-row"><span class="row-body">深色模式<small>跟随手动切换</small></span><button class="switch" role="switch" aria-checked="${state.dark}" aria-label="深色模式" data-action="dark"></button></div><div class="font-slider"><label>正文字号<span>${state.font}px</span></label><input data-field="font" type="range" min="12" max="20" value="${state.font}" aria-label="正文字号" /></div></section></main>`;
- }
- function home() {
- return `<main class="page-content"><section class="home-hero"><div class="home-logo">fmode</div><h3>人机共生中枢</h3><p>和数字生命一起干活 · 每条会话都可追踪</p></section><div class="section-label"><span>最近会话</span><button class="text-button" data-action="messages">全部${icon('chevron')}</button></div><div class="list">${sessions
- .filter((session) => !session.archived)
- .slice(0, 2)
- .map((session) => row(session))
- .join('')}</div></main>${composer(null)}`;
- }
- function drawer() {
- return `<div class="overlay drawer-overlay" data-action="dismiss"><aside class="drawer" role="dialog" aria-modal="true" aria-label="导航菜单"><div class="drawer-head"><strong>fmode</strong><button class="close-button" data-action="close" aria-label="关闭导航">${icon('close')}</button></div><button class="drawer-new" data-action="new">${icon('plus')}<span><strong>新建对话</strong><small>选择数字生命</small></span></button>${current() ? `<button class="drawer-quick" data-action="quick-new">${icon('edit')}在本容器新建 · ${escape(getAgent(current().agent).name)}</button>` : ''}<nav class="drawer-nav">${tabs.map(([route, label, name]) => `<button data-action="route" data-route="${route}" class="${state.route === route ? 'selected' : ''}">${icon(name)}${label}</button>`).join('')}</nav><div class="drawer-section">工作区<button data-action="workspace-new" aria-label="新建工作区">${icon('plus')}</button></div>${workspaces.map((workspace) => `<button class="drawer-item" data-action="workspace-open" data-id="${workspace.id}">${icon('folder')}<span>${escape(workspace.name)}</span></button>`).join('')}<div class="drawer-section">日常会话</div>${sessions
- .filter((session) => !session.archived)
- .slice(0, 4)
- .map(
- (session) =>
- `<button class="drawer-item" data-action="chat" data-id="${session.id}">${icon('chat')}<span>${escape(session.title)}</span></button>`,
- )
- .join(
- '',
- )}<button class="drawer-item" data-action="archived">${icon('archive')}已归档会话</button><div class="drawer-footer"><span class="avatar">F</span><span>fmode 体验账号<small>独立预览 · 不影响真实数据</small></span></div></aside></div>`;
- }
- function sheet(title, content) {
- return `<div class="overlay" data-action="dismiss"><section class="sheet" role="dialog" aria-modal="true" aria-label="${escape(title)}"><div class="sheet-handle"></div><header class="sheet-heading"><h3>${escape(title)}</h3><button class="close-button" data-action="close" aria-label="关闭弹层">${icon('close')}</button></header>${content}</section></div>`;
- }
- function overlay() {
- const data = state.overlayData;
- switch (state.overlay) {
- case 'drawer':
- return drawer();
- case 'activity':
- return sheet(
- '切换会话',
- `<p class="sheet-description">任务在后台继续,输入草稿留在各自会话。</p><div class="list">${sessions
- .filter((session) => !session.archived)
- .map((session) => row(session, true))
- .join(
- '',
- )}</div><button class="text-button" data-action="demo-complete">${icon('bell')}演示:让后台任务完成</button>`,
- );
- case 'title':
- return sheet(
- '会话标题',
- `<p class="sheet-description">一个清楚的标题,让下次继续更容易。</p><form data-form="title"><label class="field-label">标题</label><input class="form-field" data-field="title" aria-label="会话标题" maxlength="60" value="${escape(current()?.title)}" /><p class="form-error" aria-live="polite"></p><button type="button" class="text-button" data-action="suggest-title">${icon('refresh')}看看其他标题建议</button><div class="candidates"></div><button class="primary-button" type="submit">保存标题</button></form>`,
- );
- case 'new':
- return sheet(
- '选择数字生命',
- `<p class="sheet-description">开启一条新会话,原有会话和草稿不受影响。</p><div class="list">${agents.map((agent) => `<button class="conversation" data-action="create-chat" data-id="${agent.id}">${avatar(agent)}<span class="row-body"><strong class="row-title">${escape(agent.name)}</strong><span class="row-preview">${escape(agent.job)}</span></span>${icon('chevron')}</button>`).join('')}</div>`,
- );
- case 'chat-menu':
- return sheet(
- getAgent(current()?.agent).name,
- `<p class="sheet-description">当前数字生命 · ${escape(getAgent(current()?.agent).job)}</p><button class="setting-row" data-action="quick-new">${icon('plus')}<span class="row-body">在本容器新建会话</span>${icon('chevron')}</button><button class="setting-row" data-action="title">${icon('edit')}<span class="row-body">编辑会话标题</span>${icon('chevron')}</button><button class="setting-row" data-action="archive">${icon('archive')}<span class="row-body">归档当前会话</span>${icon('chevron')}</button>`,
- );
- case 'files':
- return sheet(
- '会话文件',
- `<p class="sheet-description">${current()?.id === 'c1' ? '本次会话生成的 2 个文件' : '当前会话暂无文件'} · 演示预览</p>${current()?.id === 'c1' ? fileCards() : empty('还没有文件', '会话生成的文件会集中保存在这里')}`,
- );
- case 'preview':
- return sheet(
- data === 'ppt' ? '季度经营复盘.pptx' : '经营数据附录.xlsx',
- `<p class="sheet-description">演示文件 · ${data === 'ppt' ? '第 1 / 12 页' : '工作表 1 / 3'}</p>${data === 'ppt' ? '<div class="preview-document"><span class="doc-brand">FMODE / QUARTERLY REVIEW</span><h2>每一份增长,<br>都有迹可循。</h2><p>季度经营复盘报告</p><footer>BUSINESS INSIGHTS / 01</footer></div>' : '<table class="preview-table"><thead><tr><th>核心指标</th><th>本季度</th><th>变化</th></tr></thead><tbody><tr><td>营收增长</td><td>18.6%</td><td>↑ 6.2%</td></tr><tr><td>客户续费率</td><td>92%</td><td>↑ 4%</td></tr><tr><td>满意度</td><td>4.8 / 5</td><td>↑ 0.3</td></tr></tbody></table>'}<p class="sheet-description">仅展示文件预览的视觉样式;未生成真实 PPT / Excel 文件。</p>`,
- );
- case 'workspace-new':
- case 'workspace-rename':
- return sheet(
- state.overlay === 'workspace-new' ? '新建工作区' : '重命名工作区',
- `<p class="sheet-description">将同一场景的会话整理在一起。</p><form data-form="workspace"><label class="field-label">工作区名称</label><input class="form-field" data-field="workspace" aria-label="工作区名称" maxlength="30" value="${escape(data?.name || '')}"/><p class="form-error" aria-live="polite"></p><button type="submit" class="primary-button">保存工作区</button></form>`,
- );
- case 'workspace-delete':
- return sheet(
- '删除工作区',
- `<p class="sheet-description">删除「${escape(data.name)}」后,里面的会话会移至日常会话,不会被删除。</p><button class="primary-button" data-action="confirm-workspace-delete" data-id="${data.id}">删除工作区,保留会话</button>`,
- );
- case 'agent': {
- const agent = getAgent(data);
- return sheet(
- agent.name,
- `<div class="profile-card" style="margin:12px 0 20px">${avatar(agent)}<div><h3>${escape(agent.name)}</h3><p>${escape(agent.job)}</p></div></div><button class="setting-row" data-action="rename-agent" data-id="${agent.id}">${icon('edit')}<span class="row-body">修改名称</span>${icon('chevron')}</button><button class="primary-button" data-action="create-chat" data-id="${agent.id}">开始新会话</button>`,
- );
- }
- case 'rename-agent':
- return sheet(
- '修改数字生命名称',
- `<form data-form="agent"><label class="field-label">名称</label><input class="form-field" aria-label="数字生命名称" data-field="agent-name" maxlength="30" value="${escape(getAgent(data).name)}"/><p class="form-error" aria-live="polite"></p><button type="submit" class="primary-button">保存名称</button></form>`,
- );
- case 'channel':
- return sheet(
- '通道',
- `<p class="sheet-description">${escape(getAgent(data).name)} 的通道入口</p><div class="setting-row">${icon('chat')}<span class="row-body">fmode 应用内会话<small>演示状态 · 已连接</small></span><span class="state-tag">在线</span></div><p class="sheet-description">此稿保留原入口,不修改通道配置或接入逻辑。</p>`,
- );
- case 'recharge':
- return sheet(
- '充值',
- `<p class="sheet-description">${escape(getAgent(data).name)} 的充值入口</p><div class="empty">${icon('info')}<h3>这里仅预览界面</h3><p>未创建订单,也不会产生支付。<br>迁移时继续使用项目原有充值流程。</p></div>`,
- );
- case 'notifications':
- return sheet(
- '消息与任务通知',
- `<p class="sheet-description">完成提醒不会打断当前输入。真实系统权限仍由原项目负责。</p><div class="setting-row"><span class="row-body">原型内完成提醒</span><button role="switch" class="switch" aria-checked="${state.notify}" aria-label="完成提醒" data-action="notify"></button></div><button class="primary-button" data-action="demo-complete">演示一次完成提醒</button>`,
- );
- case 'archived': {
- const archived = sessions.filter((session) => session.archived);
- return sheet(
- '已归档会话',
- archived.length
- ? `<div class="list">${archived.map((session) => `<div class="setting-row"><span class="row-body">${escape(session.title)}</span><button class="text-button" data-action="restore" data-id="${session.id}">恢复</button></div>`).join('')}</div>`
- : empty('没有已归档会话', '归档的会话会保留在这里,随时可以恢复'),
- );
- }
- case 'logout':
- return sheet(
- '退出登录',
- `<p class="sheet-description">这是一份独立的 HTML 原型。确认后只展示未登录状态,不会退出你的真实账号。</p><button class="primary-button" data-action="confirm-logout">确认退出(演示)</button>`,
- );
- case 'logged-out':
- return sheet(
- '已退出演示账号',
- `<div class="empty">${icon('user')}<h3>随时回来,继续对话。</h3><p>没有改动真实项目的登录状态。</p></div><button class="primary-button" data-action="close">返回预览</button>`,
- );
- default:
- return '';
- }
- }
- function render(keepScroll = true) {
- const focused = document.activeElement;
- const activeField = focused?.dataset?.field;
- const focusedPanel = focused?.closest('.phone')?.id;
- const selection = activeField && focused.type !== 'range' ? focused.selectionStart : null;
- const notes = {
- messages: '更柔和的边界 · 内缩分割线 · 清晰的任务状态',
- chat: '保留回复卡片 · 降低输入区重量 · 草稿随会话保留',
- contacts: '沿用字母头像 · 更有层次的名称与能力描述',
- workbench: '保留运行指标和三个操作 · 统一卡片节奏',
- mine: '保留四套配色与设置项 · 更轻的设置分组',
- home: '保留 fmode 品牌和文案 · 收紧首屏节奏',
- };
- document.querySelector('.scene-nav').innerHTML = scenes
- .map(
- ([route, label, name]) =>
- `<button data-action="route" data-route="${route}" class="${state.route === route || (route === 'chat/c1' && state.route.startsWith('chat/')) ? 'selected' : ''}">${icon(name)}${label}</button>`,
- )
- .join('');
- document.querySelector('#design-note').textContent = notes[state.route.split('/')[0]] || '';
- phones.forEach((phone) => {
- const scroll = keepScroll ? phone.querySelector('.page-content')?.scrollTop || 0 : 0;
- const sheetScroll = keepScroll ? phone.querySelector('.sheet')?.scrollTop || 0 : 0;
- phone.classList.toggle('dark', state.dark);
- phone.dataset.palette = state.palette;
- phone.style.setProperty('--chat-size', `${state.font}px`);
- const content = state.route.startsWith('chat/')
- ? chat()
- : state.route.startsWith('agent/')
- ? agentPage()
- : ({ messages, contacts, workbench, mine, home }[state.route] || messages)();
- phone.innerHTML = `${statusbar()}<div class="app-shell" ${state.overlay ? 'inert' : ''}>${appbar()}${content}${tabs.some((tab) => tab[0] === state.route) ? tabbar() : ''}<div class="home-indicator" aria-hidden="true"></div></div>${overlay()}${state.toast ? `<div class="toast" role="status">${icon('check')}<span>${escape(state.toast.text)}</span>${state.toast.session ? `<button data-action="chat" data-id="${state.toast.session}">查看</button>` : ''}</div>` : ''}`;
- const contentElement = phone.querySelector('.page-content');
- if (contentElement) contentElement.scrollTop = scroll;
- const sheetElement = phone.querySelector('.sheet');
- if (sheetElement) sheetElement.scrollTop = sheetScroll;
- const textarea = phone.querySelector('textarea');
- if (textarea) resizeTextarea(textarea);
- });
- if (activeField && focusedPanel) {
- const field = document.querySelector(`#${focusedPanel} [data-field="${activeField}"]`);
- if (field) {
- field.focus({ preventScroll: true });
- if (selection !== null && field.setSelectionRange)
- field.setSelectionRange(selection, selection);
- }
- }
- }
- function resizeTextarea(textarea) {
- textarea.style.height = 'auto';
- textarea.style.height = `${Math.min(112, Math.max(textarea.closest('.polished') ? 42 : 48, textarea.scrollHeight))}px`;
- }
- function go(route) {
- state.query = '';
- state.overlay = null;
- state.overlayData = null;
- state.toast = null;
- if (!route.startsWith('chat/')) state.returnRoute = route;
- state.route = route;
- const session = current();
- if (session) session.unread = 0;
- if (location.hash !== `#/${route}`) history.replaceState(null, '', `#/${route}`);
- render(false);
- }
- function showOverlay(name, data = null) {
- restoreAction = document.activeElement?.dataset?.action || restoreAction;
- state.overlay = name;
- state.overlayData = data;
- render();
- const panel = document.getElementById(sourcePanel);
- const field = panel.querySelector('.overlay input:not([type=checkbox])');
- (field || panel.querySelector('.overlay button'))?.focus({ preventScroll: true });
- if (field?.select) field.select();
- }
- function closeOverlay() {
- state.overlay = null;
- state.overlayData = null;
- render();
- const panel = document.getElementById(sourcePanel);
- panel.querySelector(`[data-action="${restoreAction}"]`)?.focus({ preventScroll: true });
- }
- function toast(text, session = null) {
- state.toast = { text, session };
- render();
- clearTimeout(toastTimer);
- toastTimer = setTimeout(() => {
- state.toast = null;
- phones.forEach((phone) => phone.querySelector('.toast')?.remove());
- }, 4200);
- }
- function createChat(agentId) {
- if (getAgent(agentId).state === '离线') {
- toast('该数字生命当前离线,请恢复在线后再开始会话');
- return;
- }
- const id = `c${Date.now()}${sessions.length}`;
- sessions.unshift({
- id,
- title: '新对话',
- agent: agentId,
- preview: '从一个想法开始',
- time: '刚刚',
- unread: 0,
- status: 'idle',
- workspace: null,
- fresh: true,
- });
- if (state.drafts.home) {
- state.drafts[id] = state.drafts.home;
- delete state.drafts.home;
- }
- if (state.attachments.home) {
- state.attachments[id] = state.attachments.home;
- delete state.attachments.home;
- }
- persist();
- go(`chat/${id}`);
- }
- function send() {
- const session = current();
- if (!session) {
- showOverlay('new');
- return;
- }
- if (getAgent(session.agent).state === '离线') {
- toast('该数字生命当前离线,草稿已保留');
- return;
- }
- const text = (state.drafts[session.id] || '').trim();
- const attachment = state.attachments[session.id];
- if ((!text && !attachment) || session.sending) return;
- const turn = { text, attachment, done: false };
- (state.turns[session.id] ||= []).push(turn);
- state.drafts[session.id] = '';
- delete state.attachments[session.id];
- session.status = 'running';
- session.sending = true;
- session.preview = text || attachment;
- persist();
- render();
- phones.forEach((phone) => {
- const scroll = phone.querySelector('.chat-scroll');
- if (scroll) scroll.scrollTop = scroll.scrollHeight;
- });
- setTimeout(() => {
- turn.done = true;
- session.status = 'done';
- session.sending = false;
- session.preview = '已完成这次补充 · 原型演示';
- session.time = '刚刚';
- if (current()?.id !== session.id) {
- session.unread += 1;
- if (state.notify)
- toast(`${getAgent(session.agent).name} 已完成「${session.title}」`, session.id);
- else render();
- } else {
- render();
- phones.forEach((phone) => {
- const scroll = phone.querySelector('.chat-scroll');
- if (scroll) scroll.scrollTop = scroll.scrollHeight;
- });
- }
- }, 1200);
- }
- async function copy(text) {
- try {
- await navigator.clipboard.writeText(text);
- toast('已复制');
- } catch {
- toast('浏览器未授权复制,可在实际项目中使用原有复制功能');
- }
- }
- document.addEventListener('click', (event) => {
- const view = event.target.closest('button[data-view]');
- if (view) {
- state.view = view.dataset.view;
- document.body.dataset.view = state.view;
- document
- .querySelectorAll('button[data-view]')
- .forEach((control) =>
- control.classList.toggle('selected', control.dataset.view === state.view),
- );
- return;
- }
- const control = event.target.closest('[data-action]');
- if (!control) return;
- if (control.closest('.phone')) sourcePanel = control.closest('.phone').id;
- const { action, id, value, route } = control.dataset;
- if (action === 'dismiss') {
- if (event.target === control) closeOverlay();
- return;
- }
- switch (action) {
- case 'route':
- go(route);
- break;
- case 'messages':
- go('messages');
- break;
- case 'contacts':
- go('contacts');
- break;
- case 'back':
- go(tabs.some((tab) => tab[0] === state.returnRoute) ? state.returnRoute : 'messages');
- break;
- case 'chat':
- if (sessions.some((session) => session.id === id)) go(`chat/${id}`);
- break;
- case 'filter':
- state.filter = value;
- render(false);
- break;
- case 'contact-filter':
- state.contactFilter = value;
- render(false);
- break;
- case 'work-filter':
- state.workFilter = value;
- render(false);
- break;
- case 'group':
- state.openGroups.has(id) ? state.openGroups.delete(id) : state.openGroups.add(id);
- render();
- break;
- case 'workspace-open':
- state.filter = 'workspace';
- state.openGroups.add(id);
- go('messages');
- break;
- case 'workspace-new':
- showOverlay(action);
- break;
- case 'workspace-rename':
- case 'workspace-delete':
- showOverlay(
- action,
- workspaces.find((workspace) => workspace.id === id),
- );
- break;
- case 'confirm-workspace-delete':
- workspaces.splice(
- workspaces.findIndex((workspace) => workspace.id === id),
- 1,
- );
- sessions.forEach((session) => {
- if (session.workspace === id) session.workspace = null;
- });
- closeOverlay();
- toast('工作区已删除,会话已保留至日常会话');
- break;
- case 'close':
- closeOverlay();
- break;
- case 'drawer':
- case 'title':
- case 'activity':
- case 'new':
- case 'files':
- case 'chat-menu':
- case 'notifications':
- case 'archived':
- case 'logout':
- showOverlay(action);
- break;
- case 'agent':
- go(`agent/${id}`);
- break;
- case 'enter-agent': {
- if (getAgent(id).state === '离线') {
- toast('该数字生命当前离线,请恢复在线后再进入');
- break;
- }
- const session = sessions.find((item) => item.agent === id && !item.archived);
- if (session) go(`chat/${session.id}`);
- else createChat(id);
- break;
- }
- case 'person':
- openPeople.has(id) ? openPeople.delete(id) : openPeople.add(id);
- render();
- break;
- case 'rename-agent':
- case 'channel':
- case 'recharge':
- case 'preview':
- showOverlay(action, id);
- break;
- case 'create-chat':
- createChat(id);
- break;
- case 'quick-new':
- createChat(current()?.agent || 'nova');
- break;
- case 'send':
- send();
- break;
- case 'attach':
- document.getElementById(sourcePanel).querySelector('[data-field="attachment"]').click();
- break;
- case 'remove-attachment':
- delete state.attachments[current()?.id || 'home'];
- render();
- break;
- case 'copy':
- copy(
- '季度复盘,已经整理好了。收入环比增长 18.6%,客户续费率达到 92%。下一步优化新客转化,持续跟进高价值客户。',
- );
- break;
- case 'token':
- state.tokenShown = !state.tokenShown;
- render();
- break;
- case 'copy-token':
- copy('DEMO-TOKEN-NOT-A-REAL-CREDENTIAL');
- break;
- case 'palette':
- state.palette = id;
- persist();
- render();
- break;
- case 'dark':
- state.dark = !state.dark;
- persist();
- render();
- break;
- case 'notify':
- state.notify = !state.notify;
- persist();
- render();
- break;
- case 'confirm-logout':
- showOverlay('logged-out');
- break;
- case 'archive':
- if (current()) current().archived = true;
- go('messages');
- toast('会话已归档,可在侧栏恢复');
- break;
- case 'restore': {
- const session = sessions.find((item) => item.id === id);
- if (session) session.archived = false;
- render();
- break;
- }
- case 'demo-complete': {
- const session =
- sessions.find((item) => item.status === 'running' && !item.sending) ||
- sessions.find((item) => !item.sending && item.id !== current()?.id) ||
- sessions[0];
- session.status = 'done';
- session.preview = '任务已完成,可以查看结果';
- session.unread += current()?.id === session.id ? 0 : 1;
- closeOverlay();
- if (state.notify) toast(`${getAgent(session.agent).name} 的任务已完成(演示)`, session.id);
- else toast('提醒已关闭,状态已更新');
- break;
- }
- case 'suggest-title': {
- const title = current()?.title || '新对话';
- phones.forEach((phone) => {
- const candidates = phone.querySelector('.candidates');
- if (candidates)
- candidates.innerHTML = `<p class="sheet-description">本地预设建议,不会调用 AI。</p>${[`${title.replace(/报告$/, '')} · 关键结论`, `${getAgent(current()?.agent).name} 的工作记录`].map((candidate) => `<button type="button" class="candidate" data-action="use-title" data-value="${escape(candidate)}">${escape(candidate)}</button>`).join('')}`;
- });
- break;
- }
- case 'use-title':
- phones.forEach((phone) => {
- const field = phone.querySelector('[data-field="title"]');
- if (field) field.value = value;
- });
- break;
- }
- });
- document.addEventListener('input', (event) => {
- const field = event.target;
- const type = field.dataset.field;
- if (type === 'search') {
- state.query = field.value;
- render(false);
- }
- if (type === 'draft') {
- const key = current()?.id || 'home';
- state.drafts[key] = field.value;
- persist();
- phones.forEach((phone) => {
- const textarea = phone.querySelector('[data-field="draft"]');
- if (textarea) {
- if (textarea !== field) textarea.value = field.value;
- resizeTextarea(textarea);
- }
- const sendButton = phone.querySelector('[data-action="send"]');
- if (sendButton)
- sendButton.disabled =
- !!current()?.sending || (!field.value.trim() && !state.attachments[key]);
- });
- }
- if (type === 'font') {
- state.font = Number(field.value);
- persist();
- phones.forEach((phone) => {
- phone.style.setProperty('--chat-size', `${state.font}px`);
- const range = phone.querySelector('[data-field="font"]');
- if (range) range.value = state.font;
- const label = phone.querySelector('.font-slider label span');
- if (label) label.textContent = `${state.font}px`;
- });
- }
- });
- document.addEventListener('change', (event) => {
- if (event.target.dataset.field === 'attachment' && event.target.files[0]) {
- state.attachments[current()?.id || 'home'] = event.target.files[0].name;
- render();
- toast('附件已加入演示草稿,文件内容未上传');
- }
- });
- document.addEventListener('submit', (event) => {
- const form = event.target.closest('[data-form]');
- if (!form) return;
- event.preventDefault();
- const field = form.querySelector('.form-field');
- const value = field.value.trim();
- if (!value) {
- form.querySelector('.form-error').textContent = '名称不能为空';
- field.focus();
- return;
- }
- if (form.dataset.form === 'title' && current()) current().title = value;
- if (form.dataset.form === 'workspace') {
- if (
- workspaces.some(
- (workspace) => workspace.name === value && workspace.id !== state.overlayData?.id,
- )
- ) {
- form.querySelector('.form-error').textContent = '已有同名工作区,请换一个名称';
- return;
- }
- if (state.overlayData) state.overlayData.name = value;
- else {
- const workspace = { id: `w${Date.now()}`, name: value };
- workspaces.push(workspace);
- state.openGroups.add(workspace.id);
- state.filter = 'workspace';
- state.route = 'messages';
- history.replaceState(null, '', '#/messages');
- }
- }
- if (form.dataset.form === 'agent') getAgent(state.overlayData).name = value;
- closeOverlay();
- toast('已保存(仅此原型)');
- });
- document.addEventListener('keydown', (event) => {
- if (event.key === 'Escape' && state.overlay) {
- event.preventDefault();
- closeOverlay();
- return;
- }
- const dialog = event.target.closest('[role="dialog"]');
- if (event.key === 'Tab' && dialog) {
- const focusable = [
- ...dialog.querySelectorAll('button:not(:disabled),input:not(:disabled),textarea,a[href]'),
- ].filter((element) => element.getClientRects().length);
- const first = focusable[0];
- const 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();
- }
- }
- if (
- event.target.dataset.field === 'draft' &&
- event.key === 'Enter' &&
- !event.shiftKey &&
- !event.isComposing &&
- event.target.closest('.baseline')
- ) {
- event.preventDefault();
- send();
- }
- });
- const readHash = () => {
- let route = '';
- try {
- route = decodeURIComponent(location.hash.replace(/^#\/?/, ''));
- } catch {}
- return /^(messages|contacts|workbench|mine|home|chat\/[\w-]+|agent\/[\w-]+)$/.test(route)
- ? route
- : 'messages';
- };
- window.addEventListener('hashchange', () => go(readHash()));
- go(readHash());
- })();
- </script>
- </body>
- </html>
|