| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958 |
- <!DOCTYPE html>
- <html lang="zh-CN">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width,initial-scale=1.0">
- <title>保额计算器 v5.1 · 7 险种 · 意外险定位伤残保障 · 与定寿差异化 · Benchmark Wealth</title>
- <link rel="preconnect" href="https://fonts.googleapis.com">
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
- <link href="https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Inter:wght@300;400;500;600;700;800&family=Noto+Sans+SC:wght@300;400;500;600;700&family=Noto+Serif+SC:wght@500;600;700;900&family=Cormorant+Garamond:wght@500;600;700;800&family=EB+Garamond:wght@500;600;700&family=Playfair+Display:wght@500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet">
- <!-- Fraunces 品牌字体 base64 内嵌兜底(Google Fonts 访问不到时仍显示 · 2026-07-16) -->
- <link href="data/cy-font-fraunces.css" rel="stylesheet">
- <style>
- /* Insurance Calculator v4.5 · 60 年生命周期净现金流 · Canvas 双向柱(支出向上+领取向下) · 养老月领 + 教育金返还 · 退休点垂直分割线 · 净现金流 tooltip · 对齐 Benchmark Wealth Platform */
- :root{
- --accent:#9B7C3A; --accent-light:#B89A52; --accent-deep:#7A6028;
- --accent-dim:rgba(155,124,58,.08); --gold-pale:#ECEEE9;
- --bg:#FAFAF7; --bg2:#FFFFFF; --bg3:#E7E9E3;
- --text:#1A0F05; --text-dim:#6B5239; --text-bright:#0A0908;
- --card:#FFFFFF;
- --card-bg:#FFFFFF;
- --border:#E8DFC8; --border-strong:#C8BC9F;
- --c-red:#A61C2B; --c-red-light:#E87070;
- --c-yellow:#B88B40; --c-yellow-light:#D4A040;
- --c-blue:#3D6F8C; --c-blue-light:#6DA3C0;
- --c-green:#2D6A4F; --c-green-light:#5DB890;
- --c-purple:#6B4A7C;
- --radius:8px;
- /* [v4.8] 方案 A 全宽 band 配套 token */
- --gold-soft:rgba(90,105,120,0.05); /* [2026-07-12 转冷] L2 段落底 · 原暖金 rgba(155,124,58,.05) → 冷灰蓝,对齐 FAV 冷调 */
- --gold-mid:rgba(155,124,58,0.18); /* L2 段落上下金线 */
- /* ════════════════════════════════════════════════════════════════════
- [v4.8 · 2026-06-26] 三档 band 底色调色板(Jack 调试后定版)
- 用法:在任何 .ic-section / wrap 类元素的 background 上引用
- ──────────────────────────────────────────────────────────────────
- | 提示词 | Token | 色值 | 体感 |
- |------------------|--------------------|--------------|------------|
- | 白带 / 白底 | --band-white | #FFFFFF | 纯白 |
- | 奶白带 / 极浅金带 | --band-cream | #F7F1E6 | 几乎纯白+暖底 |
- | 浅金带 / 香槟带 | --band-pale-gold | #F3EDE2 | 可识别浅金 |
- ──────────────────────────────────────────────────────────────────
- 之外仍可用 var(--bg) #FAF8F4 默认 L0 暖底 / var(--gold-soft) §4 L2 金调
- ════════════════════════════════════════════════════════════════════ */
- --band-white: #FFFFFF;
- --band-cream: #F4F5F1;
- --band-pale-gold:#EDEFE9;
- /* === 字体系统(Benchmark Wealth Platform 对齐 v2026-06-12) === */
- --font-sans: 'Inter', 'Noto Sans SC', 'PingFang SC', system-ui, sans-serif;
- --font-serif: 'Cormorant Garamond', 'Noto Serif SC', Georgia, serif;
- --font-brand: 'Fraunces', 'Cormorant Garamond', 'Noto Serif SC', Georgia, serif;
- --font-display: 'Playfair Display', 'Noto Serif SC', Georgia, serif;
- --font-eb: 'EB Garamond', 'Cormorant Garamond', 'Noto Serif SC', Georgia, serif;
- --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
- --font-num: 'Cormorant Garamond', 'Noto Serif SC', Georgia, serif;
- }
- *,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
- html{font-size:16px;-webkit-text-size-adjust:100%}
- body{font-family:var(--font-sans);
- background:var(--bg);color:var(--text);min-height:100vh;line-height:1.7;letter-spacing:.2px}
- /* === 数字渲染 · Benchmark Wealth 对齐(900 + -0.04em + lining-nums tabular-nums) === */
- .num-luxury,
- .pc-amount,
- .life-track-amount,
- .rc-tile-value,
- .gap-amount,
- .gap-amount .gap-num,
- .hero-stat .num,
- .metric-num{
- font-family:var(--font-num);
- font-feature-settings:'lnum' 1,'tnum' 1;
- font-variant-numeric:lining-nums tabular-nums;
- font-weight:900;
- letter-spacing:-0.04em;
- line-height:1;
- }
- /* 中等字号数字(同样 OpenType 但字重 700) */
- .gc-pct,.le-age,.ce-age,.product-meta .v,.dual-track-summary .ratio,
- .bar-meta .v,.pc-bar-meta .v,.r-tile .num,
- .timeline-day,.tl-stat .num,.ctx-meta,
- .cet-meta strong,.lt-count{
- font-family:var(--font-num);
- font-feature-settings:'lnum' 1,'tnum' 1;
- font-variant-numeric:lining-nums tabular-nums;
- font-weight:700;
- letter-spacing:-0.02em;
- }
- /* === 标题层级 · Playfair Display + Inter === */
- .hero h1{
- font-family:var(--font-display);
- font-weight:800;
- letter-spacing:-1.2px;
- line-height:1.12;
- }
- .persona-title,
- .gap-chart-title,
- .uhnw-title,
- .brand-text .t1{
- font-family:var(--font-display);
- font-weight:700;
- letter-spacing:-0.3px;
- }
- .section-head .sh-title,
- .pc-title{
- font-family:var(--font-sans);
- font-weight:600;
- letter-spacing:-0.2px;
- }
- .brand-text .t2,
- .pc-tag,
- .persona-eyebrow,
- .hero-eyebrow,
- .rc-eyebrow{
- font-family:var(--font-sans);
- font-weight:700;
- letter-spacing:1.5px;
- }
- /* === 顶栏 === */
- .topbar{position:sticky;top:0;z-index:100;background:#FFFFFF;
- border-bottom:1px solid var(--border);padding:14px 32px;
- display:flex;align-items:center;justify-content:space-between;
- box-shadow:0 2px 8px rgba(196,151,58,.06)}
- .brand{display:flex;align-items:center;gap:12px}
- .brand-logo{width:34px;height:34px;flex-shrink:0;display:flex;align-items:center;justify-content:center}
- .brand-logo svg{width:100%;height:100%;display:block}
- .brand-text{display:flex;flex-direction:column}
- .brand-text .t1{font-size:14px;font-weight:600;color:var(--text);font-family:var(--font-brand)}
- .brand-text .t2{font-size:10px;color:var(--text-dim);letter-spacing:2px;text-transform:uppercase}
- .agent-badge{background:linear-gradient(135deg,#A61C2B,#8B1C15);color:#fff;
- padding:3px 10px;border-radius:100px;font-size:10px;font-weight:700;letter-spacing:1px;
- margin-left:10px}
- .topbar-right{display:flex;align-items:center;gap:12px;font-size:12px;color:var(--text-dim)}
- .back-link{color:var(--accent);text-decoration:none;font-weight:500;padding:6px 12px;
- border-radius:6px;border:1px solid var(--border);transition:all .2s;cursor:pointer}
- .back-link:hover{background:var(--accent-dim);border-color:var(--accent)}
- .ah-nav-btn{background:#0A0908;color:#fff;border:1px solid #0A0908;border-radius:6px;padding:6px 13px;font-size:12.5px;font-weight:600;cursor:pointer;font-family:inherit;margin-right:6px}
- .ah-nav-btn:hover{opacity:.88}
- /* === ctx-bar 当前客户 === */
- .ctx-bar{background:linear-gradient(90deg,rgba(196,151,58,.08),rgba(196,151,58,.02));
- border-bottom:1px solid var(--border);padding:12px 32px;
- display:none;align-items:center;gap:12px;font-size:13px;color:var(--text-dim);flex-wrap:wrap}
- .ctx-bar.active{display:flex}
- .ctx-icon{font-size:16px}
- .ctx-name{font-weight:600;color:var(--text)}
- .ctx-portrait{font-size:11px;color:#fff;background:linear-gradient(135deg,#A61C2B,#8B1C15);
- padding:2px 8px;border-radius:8px;letter-spacing:.5px;display:none}
- .ctx-meta{color:var(--accent);font-weight:600;font-family:'Cormorant Garamond',serif;
- font-feature-settings:"lnum","tnum"}
- .ctx-actions{margin-left:auto;display:flex;gap:8px}
- .ctx-btn{font-size:12px;padding:5px 10px;border-radius:6px;border:1px solid var(--border);
- background:#fff;color:var(--text-dim);cursor:pointer;transition:all .15s;
- font-family:'Noto Serif SC',serif}
- .ctx-btn:hover{border-color:var(--accent);color:var(--accent)}
- .ctx-btn.primary{background:var(--accent);color:#fff;border-color:var(--accent)}
- .ctx-btn.primary:hover{background:var(--accent-deep)}
- /* === 容器 === */
- /* [2026-07-12 左固定向右铺满 · 参照 Dashboard v2.4 但去上限]
- 改总闸:全界面卡片统一贴主区左侧,向右铺满整个主区(右侧仅留 32px padding 边距),不居中、无宽度上限。
- .container 是 .cy-main(grid 1fr 列)直接子级,margin:0 → 左贴侧栏右沿、宽度自动=主区可用宽,
- 永远不钻侧栏;屏幕越宽卡片越宽,右侧不再有大留白。
- 如需回到"最宽封顶"模式,把 max-width:none 改成具体像素即可(如 1600px)。 */
- .container{max-width:none;margin:0;padding:32px 32px 60px}
- /* === Hero v3.0 旗舰风格(横线 eyebrow + italic gold span + 4rem h1 · 同源 Benchmark Wealth HTML v3.0)=== */
- .hero{text-align:center;padding:64px 0 40px;border-bottom:1px solid var(--border);margin-bottom:32px;position:relative}
- .hero-eyebrow{display:inline-flex;align-items:center;gap:14px;
- font-size:10.5px;letter-spacing:3.5px;text-transform:uppercase;
- color:var(--accent);font-weight:600;margin-bottom:24px;font-family:var(--font-sans);
- background:none;padding:0;border-radius:0}
- .hero-eyebrow::before,
- .hero-eyebrow::after{content:'';width:32px;height:1px;background:var(--accent-light);opacity:.5}
- .hero h1{font-family:var(--font-display);font-size:4rem;
- font-weight:800;line-height:1.12;letter-spacing:-1.5px;margin-bottom:18px;
- color:var(--text-bright);
- background:none;-webkit-text-fill-color:initial;background-clip:initial;-webkit-background-clip:initial}
- .hero h1 .gold{
- font-family:var(--font-eb);font-style:italic;color:var(--accent);font-weight:700}
- .hero h1 .hero-h1-strong{
- background:none;-webkit-background-clip:initial;background-clip:initial;
- -webkit-text-fill-color:var(--text-bright);color:var(--text-bright);
- font-feature-settings:'lnum' 1,'tnum' 1;font-variant-numeric:lining-nums tabular-nums}
- .hero h2{font-family:var(--font-eb);font-style:italic;font-size:18px;
- color:var(--text-dim);margin-bottom:24px;letter-spacing:.2px;font-weight:500}
- .hero-pills{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin-top:6px}
- .hero-pill{padding:5px 14px;border-radius:100px;border:1px solid var(--border);
- font-size:11.5px;color:var(--text-dim);background:#fff;font-family:var(--font-sans);font-weight:500;transition:all .2s}
- .hero-pill:hover{border-color:var(--accent);color:var(--accent);background:var(--accent-dim)}
- /* === 段标题 === */
- .section-head{display:flex;align-items:baseline;gap:14px;margin:32px 0 18px;
- border-bottom:1px solid var(--border);padding-bottom:8px}
- /* === 段 0 · 预设画像快速导入 === */
- /* === v3.5.2 · CTA 整体黑色渐变(机构级 UHNW · 香槟金边 · 同源 Benchmark Wealth sidebar/Demo Portal)
- v3.5.5 · 反转色序: 左上深→右下暖(暗角在左,光在右下)· 三段 stops · 已上升为 Skill 默认 === */
- .persona-section{background:linear-gradient(135deg,#080503 0%,#1A1208 50%,#2D2010 100%);
- border:1px solid rgba(155,124,58,0.18);border-left:5px solid var(--accent);
- border-radius:var(--radius);padding:20px 26px;margin-bottom:20px;
- box-shadow:0 6px 24px rgba(0,0,0,0.35),inset 0 0 0 1px rgba(155,124,58,0.05);
- transition:padding .2s ease}
- .persona-section.collapsed{padding-bottom:18px}
- .persona-section.collapsed .persona-subtitle,
- .persona-section.collapsed .persona-tier-row,
- .persona-section.collapsed .persona-section-tip{display:none}
- .persona-toggle{margin-left:auto;background:rgba(255,255,255,0.04);
- border:1px solid rgba(155,124,58,0.30);
- color:#C8B988;padding:5px 14px;border-radius:6px;font-size:11.5px;cursor:pointer;
- transition:all .15s;font-family:var(--font-sans);font-weight:600;letter-spacing:.5px;
- display:inline-flex;align-items:center;gap:6px}
- .persona-toggle:hover{border-color:var(--accent-light);color:#F5E6B8;background:rgba(155,124,58,0.10)}
- .persona-toggle .caret{transition:transform .2s;display:inline-block}
- .persona-section:not(.collapsed) .persona-toggle .caret{transform:rotate(180deg)}
- .persona-section.collapsed .persona-meta{display:none}
- .persona-section.collapsed .persona-toggle{margin-left:auto}
- .persona-head{display:flex;align-items:baseline;gap:12px;margin-bottom:6px;flex-wrap:wrap}
- .persona-eyebrow{display:inline-block;padding:3px 12px;border-radius:100px;
- background:linear-gradient(135deg,var(--accent),var(--accent-deep));
- color:#fff;font-size:10.5px;letter-spacing:1.5px;
- text-transform:uppercase;font-weight:600;
- box-shadow:0 1px 4px rgba(155,124,58,0.40)}
- .persona-title{font-family:var(--font-display),'Noto Serif SC',serif;font-size:1.3rem;
- font-weight:700;color:#F5E6B8;letter-spacing:-0.3px;
- font-feature-settings:'lnum' 1,'tnum' 1;font-variant-numeric:lining-nums tabular-nums}
- .persona-meta{font-size:11.5px;color:rgba(229,220,196,0.62);margin-left:auto}
- .persona-subtitle{font-size:12px;color:rgba(229,220,196,0.70);margin-bottom:14px;line-height:1.6}
- .persona-tier-row{margin-bottom:10px}
- .persona-tier-label{font-size:10.5px;color:#C8B988;font-weight:600;letter-spacing:.5px;
- margin-right:8px}
- .persona-chips{display:flex;flex-wrap:wrap;gap:8px}
- /* === v3.5.2 · chip 改为暖米卡片(在黑底 CTA 上形成清晰对比 · UHNW 机构感)=== */
- .persona-chip{background:linear-gradient(135deg,#FAF7EE 0%,#F3EDE2 100%);
- border:1.5px solid rgba(155,124,58,0.28);border-radius:8px;
- padding:8px 14px;font-size:12.5px;color:var(--text);cursor:pointer;transition:all .18s;
- display:inline-flex;flex-direction:column;gap:2px;font-family:'Noto Serif SC',serif;
- min-width:140px;text-align:left;box-shadow:0 2px 6px rgba(0,0,0,0.20)}
- .persona-chip:hover{border-color:var(--accent);
- background:linear-gradient(135deg,#FFFEF8 0%,#F3EDE2 100%);
- transform:translateY(-1px);
- box-shadow:0 6px 16px rgba(155,124,58,0.35)}
- .persona-chip.selected{background:linear-gradient(135deg,#F5E6B8 0%,#E5C77A 100%);
- border-color:var(--accent-deep);color:var(--text-bright);font-weight:600;
- box-shadow:0 4px 14px rgba(155,124,58,0.55),inset 0 0 0 1px rgba(255,255,255,0.30)}
- .persona-chip.selected::after{content:'✓';position:absolute;top:4px;right:6px;
- font-size:14px;color:var(--accent-deep);font-weight:700}
- .persona-chip{position:relative}
- .pc-name{font-size:13px;font-weight:600;color:var(--text);display:flex;align-items:center;gap:6px;
- font-family:var(--font-display),'Noto Serif SC',serif;
- font-feature-settings:'lnum' 1,'tnum' 1;font-variant-numeric:lining-nums tabular-nums}
- .pc-icon-em{font-size:14px}
- .pc-tag-color{display:inline-block;width:8px;height:8px;border-radius:50%;flex-shrink:0;
- box-shadow:0 0 0 1.5px rgba(255,255,255,0.85)}
- .pc-tag-color.std{background:#5DB890}
- .pc-tag-color.mid{background:#D4A040}
- .pc-tag-color.hnw{background:#A61C2B}
- .pc-desc{font-size:10.5px;color:var(--text-dim);line-height:1.5;
- font-family:var(--font-display),'Noto Serif SC',serif;
- font-feature-settings:'lnum' 1,'tnum' 1;font-variant-numeric:lining-nums tabular-nums}
- .section-head{display:flex;align-items:baseline;gap:14px;margin:32px 0 18px;
- border-bottom:1px solid var(--border);padding-bottom:8px}
- .section-head .sh-num{font-family:var(--font-display);font-size:1.8rem;color:var(--accent);font-weight:700;
- font-feature-settings:'lnum' 1,'tnum' 1;font-variant-numeric:lining-nums tabular-nums;letter-spacing:-0.02em}
- .section-head .sh-title{font-size:18px;font-weight:600;color:var(--text)}
- .section-head .sh-meta{font-size:12px;color:var(--text-dim);margin-left:auto}
- /* ════════════════════════════════════════════════════════════════════
- [v4.8 · 方案 A · 全宽 band] 2026-06-24
- 5 段表单 / 现金流 / HNW 共 7 块"通屏色条"——破容器 max-width:1200px
- 约束,box-shadow + clip-path 让 band 从浏览器左边到右边
- 保持黑岛(persona-section / result-cover)居中嵌入卡形态(Q1·A 选项)
- ════════════════════════════════════════════════════════════════════ */
- /* container 加 z-index 防止 band box-shadow 打架 */
- .container{position:relative;z-index:1}
- /* body overflow-x 保护(防 100vmax 触发横向滚动条)*/
- body{overflow-x:hidden}
- /* 通用 ic-section 基础(消除卡片决策:无圆角、无边框、无阴影、无 margin)*/
- .ic-section{position:relative;padding:32px 0;margin:0;
- border:none;border-radius:0;box-shadow:none}
- /* 包裹容器内的 section-head / form-grid 重置 margin · 让 band padding 接管间距 */
- .ic-section > .section-head{margin:0 0 18px}
- .ic-section > .form-grid{margin-bottom:0}
- .ic-section > .form-grid + *{margin-top:14px}
- /* L0 暖底 band(段 2 / 段 5 · 不设 bg,body --bg #FAF8F4 透出)*/
- .ic-section--L0{background:transparent}
- /* L1 白色 band(段 1 / 段 3) */
- .ic-section--L1{
- background:var(--card);
- box-shadow:0 0 0 100vmax var(--card);
- clip-path:inset(0 -100vmax)
- }
- /* [v4.8 · 2026-06-26] 奶白带 #F7F1E6 · 应用到 §3 */
- .ic-section--cream{
- background:var(--band-cream);
- box-shadow:0 0 0 100vmax var(--band-cream);
- clip-path:inset(0 -100vmax)
- }
- /* [v4.8 · 2026-06-26] 浅金带 #F3EDE2 · 应用到 §5 */
- .ic-section--pale-gold{
- background:var(--band-pale-gold);
- box-shadow:0 0 0 100vmax var(--band-pale-gold);
- clip-path:inset(0 -100vmax)
- }
- /* L2 金调 band(段 4 · 上下金线 + 浅金底)*/
- .ic-section--L2{
- background:var(--gold-soft);
- box-shadow:0 0 0 100vmax var(--gold-soft);
- clip-path:inset(0 -100vmax);
- /* [v4.8 · 2026-06-26] 去掉上下金线(2026-06-26 Jack 决议)*/
- padding:32px 0
- }
- /* L2 段标题强化(主菜锚定)*/
- .ic-section--L2 > .section-head .sh-title{color:var(--accent)}
- .ic-section--L2 > .section-head .sh-meta{color:var(--accent);font-weight:600}
- /* ════════════════════════════════════════════════════════════════════
- [v4.8 · 方案 A · 2026-06-26] §4 三层风险层 · 三卡分组(居中白卡)
- §4 ic-section--L2 金带内 · 3 张居中白卡(不破容器,无嵌套 clip-path bug)
- 每卡左侧色条对应 hero pill 三色(橙/黄/金)· 标题 + 字段全部默认可见
- ════════════════════════════════════════════════════════════════════ */
- .form-grid--risk-tiers{
- background:transparent;
- border:none;
- border-radius:0;
- padding:0;
- margin-bottom:0;
- display:block
- }
- .risk-layer-group{
- background:var(--card);
- border:1px solid var(--border);
- border-radius:var(--radius);
- padding:16px 20px;
- margin-bottom:14px;
- box-shadow:0 1px 3px rgba(15,14,12,0.04)
- }
- .risk-layer-group:last-child{margin-bottom:0}
- .risk-layer-head{
- display:flex; align-items:center; gap:8px;
- font-size:13px; font-weight:700;
- color:var(--text);
- margin-bottom:12px;
- padding-bottom:8px;
- border-bottom:1px dashed var(--border);
- font-family:var(--font-display);
- letter-spacing:-0.2px
- }
- .risk-layer-head .rl-meta{
- margin-left:auto;
- font-size:10.5px;
- font-weight:500;
- color:var(--text-dim);
- letter-spacing:0.5px;
- font-family:var(--font-sans);
- text-transform:uppercase
- }
- .risk-layer-fields{
- display:grid;
- grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
- gap:14px
- }
- /* 三层左色条对应 hero pill */
- .risk-layer--basic{border-left:4px solid #E07A3B}
- .risk-layer--mid{border-left:4px solid #D4A93A}
- .risk-layer--high{border-left:4px solid #C9A84C}
- /* 三层 head 颜色 hint */
- .risk-layer--basic .risk-layer-head{color:#9B4D1F}
- .risk-layer--mid .risk-layer-head{color:#5A4912}
- .risk-layer--high .risk-layer-head{color:#5C4810}
- /* HNW Tabs 全宽 L2 金调 band(承接 .ic-section--L2 的视觉规则) */
- #hnwTabsWrap.ic-hnw-wrap{
- position:relative;
- /* [v4.8 · 2026-06-26 修正] 嵌套在 policy-card 内时,box-shadow 全宽技巧会覆盖 card 边框
- · 导致"终身寿"卡片出现横向断层。改为普通内嵌容器(去 box-shadow / clip-path)
- · bg 保留 var(--bg) 暖底 · 视觉上是 white 卡内的暖底 inset 区,无断层 */
- background:var(--bg);
- border-radius:8px;
- padding:20px 24px;
- margin:14px 0 0
- }
- /* 印刷模式:band 保持背景色,clip-path 失效就退回常规卡片 */
- @media print{
- .ic-section,.cashflow-section,#hnwTabsWrap.ic-hnw-wrap{
- -webkit-print-color-adjust:exact;
- print-color-adjust:exact;
- page-break-inside:avoid;
- break-inside:avoid;
- box-shadow:none;
- clip-path:none
- }
- }
- /* === 输入表单 === */
- .form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px;
- background:var(--card-bg);border:1px solid var(--border);border-radius:var(--radius);
- padding:20px 24px;margin-bottom:18px}
- .form-field{display:flex;flex-direction:column;gap:6px}
- .form-field label{font-size:11.5px;color:var(--text-dim);font-weight:600;letter-spacing:.5px}
- .form-field label .hint{color:var(--accent);font-size:10px;font-weight:500;margin-left:4px}
- .form-field input,.form-field select{padding:10px 14px;border:1.5px solid var(--border);border-radius:6px;
- font-size:14px;font-family:'Noto Serif SC','PingFang SC',serif;outline:none;transition:border-color .15s;
- background:#fff;color:var(--text)}
- .form-field input:focus,.form-field select:focus{border-color:var(--accent)}
- .form-field input[type="number"]::-webkit-inner-spin-button{opacity:.4}
- /* === 按钮 === */
- .calc-row{display:flex;justify-content:center;gap:12px;margin:28px 0 8px}
- .btn{padding:14px 32px;border-radius:6px;font-size:14px;font-weight:600;
- border:none;cursor:pointer;transition:all .2s;font-family:'Noto Serif SC',serif;letter-spacing:.06em}
- .btn-primary{background:var(--accent);color:#fff;box-shadow:0 2px 8px rgba(196,151,58,.25)}
- .btn-primary:hover{background:var(--accent-deep);transform:translateY(-1px);box-shadow:0 4px 14px rgba(196,151,58,.4)}
- .btn-ghost{background:transparent;color:var(--text-dim);border:1px solid var(--border)}
- .btn-ghost:hover{border-color:var(--accent);color:var(--accent)}
- /* === 输出区 === */
- #result{display:none;margin-top:32px;padding-top:32px;border-top:2px solid var(--accent)}
- /* ════════════════════════════════════════════════════════════════════
- [2026-07-12 移植] 客户家庭档案卡 · Client Profile passport
- 源自「家庭保障体检报告 v0.1」· 替代原「保险配置诊断」result-cover 展示位
- 设计灵感:私人银行 client passport · 大字 Cormorant Garamond + 金箔细节
- ════════════════════════════════════════════════════════════════════ */
- .v01-family-card{
- /* [2026-07-12] 跟随 .container(左固定·1480 封顶)填满宽度,不再自设 max-width */
- width:100%;
- margin:0 0 24px;
- padding:0;
- background:linear-gradient(135deg, #FFFFFF 0%, #FDFBF6 100%);
- border:1px solid rgba(155,124,58,.28);
- border-radius:14px;
- position:relative;overflow:hidden;
- box-shadow:0 8px 30px rgba(122,96,40,.10), inset 0 0 0 1px rgba(155,124,58,.05);
- font-family:'Noto Sans SC',sans-serif
- }
- .v01-family-card::before{
- content:'';position:absolute;
- top:-60px;right:-40px;
- width:240px;height:240px;
- background:radial-gradient(circle, rgba(155,124,58,.10) 0%, transparent 70%);
- pointer-events:none
- }
- .v01-family-card::after{
- content:'';position:absolute;
- bottom:-50px;left:-30px;
- width:200px;height:200px;
- background:radial-gradient(circle, rgba(155,124,58,.06) 0%, transparent 70%);
- pointer-events:none
- }
- /* —— 顶部 Header(左文字 · 右金环) —— */
- .v01-fc-header{
- padding:26px 40px 24px;
- /* [2026-07-12] 文字整卡居中 + CFPI 金环绝对定位靠右(位置不变) */
- display:flex;align-items:center;justify-content:center;gap:32px;
- text-align:center;
- min-height:182px; /* 预留金环高度,防其绝对定位后溢出到下方区块 */
- border-bottom:1px solid rgba(155,124,58,.18);
- position:relative;z-index:1
- }
- .v01-fc-head-text{flex:0 1 auto;min-width:0;text-align:center}
- .v01-fc-eyebrow{
- display:flex;align-items:center;justify-content:center;
- gap:14px;margin-bottom:14px
- }
- .v01-fc-eyebrow-line{
- flex:0 0 60px;height:1px;
- background:linear-gradient(90deg, transparent, rgba(155,124,58,.45))
- }
- .v01-fc-eyebrow-line:last-child{
- background:linear-gradient(90deg, rgba(155,124,58,.45), transparent)
- }
- .v01-fc-eyebrow-text{
- font-size:10.5px;letter-spacing:3.5px;
- color:#7A6028;
- text-transform:uppercase;font-weight:600;
- font-family:'Cormorant Garamond','Noto Serif SC',serif
- }
- .v01-fc-title{
- font-family:'Cormorant Garamond','Noto Serif SC',serif;
- font-size:2.4rem;font-weight:700;
- color:#1A0F05;letter-spacing:-0.5px;line-height:1.1;
- margin:0 0 10px 0
- }
- .v01-fc-subtitle{
- font-size:12.5px;
- color:rgba(61,41,20,.65);
- letter-spacing:.5px;line-height:1.7;
- font-family:'EB Garamond','Cormorant Garamond',serif;
- font-style:italic;
- margin:0
- }
- /* —— CFPI 金环仪表盘(右侧·绝对定位,位置不变) —— */
- .v01-cfpi-gauge{
- display:inline-flex;align-items:center;gap:18px;
- /* [2026-07-12] 绝对定位靠右垂直居中 → 文字块可相对整卡居中,金环视觉位置不动。
- 用 top/bottom:0 + margin:auto 居中,不用 transform(避让入场动画 scale 关键帧)。 */
- position:absolute;right:40px;top:0;bottom:0;margin-top:auto;margin-bottom:auto;
- height:fit-content;
- /* [2026-07-12] 去掉胶囊外壳:无背景/无边框/无圆角/无内边距,只留金环本体 */
- padding:0;
- background:none;
- border:none;
- border-radius:0
- }
- .v01-cfpi-ring{position:relative;width:104px;height:104px;flex:0 0 auto}
- .v01-cfpi-ring svg{transform:rotate(-90deg)}
- .v01-cfpi-ring-track{fill:none;stroke:rgba(155,124,58,.16);stroke-width:9}
- .v01-cfpi-ring-fill{fill:none;stroke:url(#cfpiGrad);stroke-width:9;stroke-linecap:round;transition:stroke-dashoffset 1s cubic-bezier(.2,.7,.3,1)}
- .v01-cfpi-ring-center{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center}
- .v01-cfpi-ring-num{font-family:'Cormorant Garamond',serif;font-size:2rem;font-weight:900;color:#3D2914;line-height:1;letter-spacing:-0.03em}
- .v01-cfpi-ring-max{font-size:9.5px;color:rgba(61,41,20,.5);letter-spacing:.5px;margin-top:2px}
- .v01-cfpi-meta{display:flex;flex-direction:column;align-items:flex-start;gap:7px;text-align:left}
- .v01-cfpi-meta-eyebrow{font-size:9px;letter-spacing:2px;color:rgba(155,124,58,.75);text-transform:uppercase;font-weight:600}
- .v01-cfpi-badge{display:inline-flex;align-items:center;gap:5px;padding:5px 14px;border-radius:100px;font-size:13.5px;font-weight:700;font-family:'Noto Serif SC',serif;background:rgba(45,106,79,.10);color:#2D6A4F;border:1px solid rgba(45,106,79,.28)}
- .v01-cfpi-badge.is-warn{background:rgba(166,102,16,.10);color:#A66610;border-color:rgba(166,102,16,.30)}
- .v01-cfpi-badge.is-bad{background:rgba(166,28,43,.10);color:#A61C2B;border-color:rgba(166,28,43,.30)}
- .v01-cfpi-meta-desc{font-size:11px;color:rgba(61,41,20,.6);line-height:1.5;max-width:180px}
- /* —— 三柱核心指标 —— */
- .v01-fc-metrics{
- display:flex;align-items:stretch;
- padding:22px 40px;
- border-bottom:1px solid rgba(155,124,58,.14);
- position:relative;z-index:1
- }
- .v01-fc-metric{
- flex:1;text-align:center;
- padding:0 12px; /* [2026-07-12 5柱化] 18px→12px 让 5 柱更从容 */
- min-width:0
- }
- .v01-fc-metric-label{
- font-size:9.5px;letter-spacing:2.5px;
- color:rgba(155,124,58,.75);
- text-transform:uppercase;font-weight:600;
- margin-bottom:10px
- }
- .v01-fc-metric-value{
- font-family:'Cormorant Garamond','Noto Serif SC',serif;
- font-size:2.4rem;font-weight:900;
- color:#3D2914;
- letter-spacing:-0.04em;line-height:1;
- font-feature-settings:'lnum' 1,'tnum' 1;
- font-variant-numeric:lining-nums tabular-nums;
- margin-bottom:8px
- }
- .v01-fc-metric-value-text{font-size:1.6rem;letter-spacing:-0.02em}
- .v01-fc-metric-sub{
- font-size:11px;
- color:rgba(61,41,20,.55);
- letter-spacing:.5px
- }
- .v01-fc-metric-divider{
- width:1px;
- background:linear-gradient(180deg, transparent, rgba(155,124,58,.30), transparent);
- margin:6px 0
- }
- /* —— 资产 4 盘 chip 行 —— */
- .v01-fc-assets{
- display:flex;flex-wrap:wrap;gap:8px;
- padding:18px 40px;
- border-bottom:1px solid rgba(155,124,58,.14);
- position:relative;z-index:1;
- justify-content:center
- }
- .v01-fc-asset-chip{
- display:inline-flex;align-items:center;gap:8px;
- padding:7px 14px;
- background:rgba(155,124,58,.07);
- border:1px solid rgba(155,124,58,.25);
- border-radius:100px;
- font-size:11.5px;color:rgba(61,41,20,.85);
- font-family:'Noto Sans SC',sans-serif;
- transition:all .18s ease
- }
- .v01-fc-asset-chip:hover{
- background:rgba(155,124,58,.16);
- border-color:rgba(155,124,58,.55);
- transform:translateY(-1px);
- box-shadow:0 4px 14px rgba(155,124,58,.15)
- }
- .v01-fc-asset-chip-icon{font-size:13px}
- .v01-fc-asset-chip-val{
- color:#9B7C3A;font-weight:700;
- font-family:'Cormorant Garamond',serif;
- font-feature-settings:'lnum' 1,'tnum' 1;
- letter-spacing:-0.02em
- }
- /* —— 7 险种保单网格 —— */
- .v01-fc-policies-head{
- display:flex;align-items:center;gap:10px;
- padding:16px 40px 12px;
- font-size:11.5px;color:rgba(155,124,58,.8);
- letter-spacing:1.5px;text-transform:uppercase;font-weight:600
- }
- .v01-fc-policies-icon{font-size:14px}
- .v01-fc-policies-grid{
- display:grid;grid-template-columns:repeat(7, 1fr);
- gap:0;
- margin:0 40px 24px;
- background:#FFFDF7;
- border-radius:8px;overflow:hidden;
- position:relative;z-index:1
- }
- .v01-fc-policy{
- background:#FFFDF7;
- padding:14px 8px;
- text-align:center;
- transition:transform .2s ease, background .2s ease
- }
- /* 每个险种间加分隔线(第 1 个之外均加左线) · 无外框 */
- .v01-fc-policy + .v01-fc-policy{
- border-left:1px solid rgba(155,124,58,.20)
- }
- .v01-fc-policy:hover{
- transform:translateY(-2px);
- background:rgba(155,124,58,.06)
- }
- .v01-fc-policy-icon{font-size:18px;margin-bottom:6px;line-height:1}
- .v01-fc-policy-name{
- font-size:10.5px;color:rgba(61,41,20,.62);
- letter-spacing:1px;margin-bottom:6px;font-weight:600
- }
- .v01-fc-policy-val{
- font-family:'Cormorant Garamond',serif;
- font-size:14px;font-weight:700;
- color:#3D2914;letter-spacing:-0.02em;
- font-feature-settings:'lnum' 1,'tnum' 1
- }
- .v01-fc-policy.is-empty .v01-fc-policy-icon{opacity:.35}
- .v01-fc-policy.is-empty .v01-fc-policy-val{color:#A61C2B;font-family:'Noto Sans SC';font-size:13px;font-weight:600}
- .v01-fc-policy.is-covered .v01-fc-policy-val{color:#2D6A4F}
- /* —— 进场动画 —— */
- @keyframes v01fcFadeUp{from{opacity:0;transform:translateY(28px)}to{opacity:1;transform:translateY(0)}}
- @keyframes v01fcSlideRight{from{opacity:0;transform:translateX(-32px)}to{opacity:1;transform:translateX(0)}}
- @keyframes v01fcFadeIn{from{opacity:0;transform:scale(0.96)}to{opacity:1;transform:scale(1)}}
- @keyframes v01fcEyebrowExpand{from{opacity:0;letter-spacing:0px;transform:scale(0.85)}to{opacity:1;letter-spacing:5px;transform:scale(1)}}
- @keyframes v01fcGlow{
- 0%, 100%{box-shadow:0 8px 30px rgba(122,96,40,.10), inset 0 0 0 1px rgba(155,124,58,.05)}
- 50%{box-shadow:0 12px 40px rgba(155,124,58,.28), inset 0 0 0 1px rgba(155,124,58,.18)}
- }
- .v01-family-card{animation:v01fcFadeUp .45s cubic-bezier(.2,.7,.3,1) both, v01fcGlow 3.5s ease-in-out .8s infinite}
- .v01-fc-eyebrow{animation:v01fcEyebrowExpand .45s ease-out .12s both}
- .v01-fc-title{animation:v01fcFadeUp .4s cubic-bezier(.2,.7,.3,1) .24s both}
- .v01-fc-subtitle{animation:v01fcFadeUp .35s cubic-bezier(.2,.7,.3,1) .34s both}
- .v01-cfpi-gauge{animation:v01fcFadeIn .4s ease-out .42s both}
- .v01-fc-metrics > .v01-fc-metric:nth-child(1){animation:v01fcSlideRight .38s cubic-bezier(.2,.7,.3,1) .46s both}
- .v01-fc-metrics > .v01-fc-metric:nth-child(3){animation:v01fcSlideRight .38s cubic-bezier(.2,.7,.3,1) .54s both}
- .v01-fc-metrics > .v01-fc-metric:nth-child(5){animation:v01fcSlideRight .38s cubic-bezier(.2,.7,.3,1) .62s both}
- /* [2026-07-12 提案① 5柱化] 已配置保额(7)/保障缺口(9) 续接 stagger */
- .v01-fc-metrics > .v01-fc-metric:nth-child(7){animation:v01fcSlideRight .38s cubic-bezier(.2,.7,.3,1) .70s both}
- .v01-fc-metrics > .v01-fc-metric:nth-child(9){animation:v01fcSlideRight .38s cubic-bezier(.2,.7,.3,1) .78s both}
- .v01-fc-asset-chip{animation:v01fcFadeIn .35s ease-out both}
- .v01-fc-asset-chip:nth-child(1){animation-delay:.74s}
- .v01-fc-asset-chip:nth-child(2){animation-delay:.80s}
- .v01-fc-asset-chip:nth-child(3){animation-delay:.86s}
- .v01-fc-asset-chip:nth-child(4){animation-delay:.92s}
- .v01-fc-policy{animation:v01fcFadeIn .35s ease-out both}
- .v01-fc-policy:nth-child(1){animation-delay:1.00s}
- .v01-fc-policy:nth-child(2){animation-delay:1.06s}
- .v01-fc-policy:nth-child(3){animation-delay:1.12s}
- .v01-fc-policy:nth-child(4){animation-delay:1.18s}
- .v01-fc-policy:nth-child(5){animation-delay:1.24s}
- .v01-fc-policy:nth-child(6){animation-delay:1.30s}
- .v01-fc-policy:nth-child(7){animation-delay:1.36s}
- @media (max-width:900px){
- .v01-fc-title{font-size:1.8rem}
- .v01-fc-metrics{flex-direction:column;gap:18px}
- .v01-fc-metric-divider{display:none}
- .v01-fc-metric-value{font-size:1.8rem}
- .v01-fc-policies-grid{grid-template-columns:repeat(4, 1fr)}
- /* [2026-07-12] 窄屏金环回归文档流,改上下堆叠,避免绝对定位盖住居中文字 */
- .v01-fc-header{flex-direction:column;min-height:0}
- .v01-cfpi-gauge{position:static;margin:16px auto 0}
- }
- /* === v3.5.3 · 计算结果 HERO 改深机构黑(对齐 CTA + Demo Portal 黑金调性)
- v3.5.5 · 反转色序: 左上深→右下暖 · 三段 stops · 已上升为 Skill 默认 === */
- .result-cover{background:linear-gradient(135deg,#080503 0%,#1A1208 50%,#2D2010 100%);border-radius:12px;
- padding:28px 32px;margin-bottom:24px;color:#fff;
- box-shadow:0 12px 40px rgba(0,0,0,0.40),inset 0 0 0 1px rgba(155,124,58,0.10)}
- .rc-eyebrow{font-size:11px;letter-spacing:2.5px;text-transform:uppercase;opacity:.55;margin-bottom:8px}
- .rc-title{font-family:var(--font-display),'Noto Serif SC',serif;font-size:1.7rem;font-weight:700;
- color:#F5E6B8;margin-bottom:6px;line-height:1.3;letter-spacing:-0.3px;
- font-feature-settings:'lnum' 1,'tnum' 1;font-variant-numeric:lining-nums tabular-nums}
- .rc-subtitle{font-size:13px;opacity:.7;margin-bottom:20px}
- .rc-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:14px;
- padding-top:18px;border-top:1px solid rgba(196,151,58,.2)}
- .rc-tile{}
- .rc-tile-label{font-size:10.5px;color:#C4973A;letter-spacing:1.5px;text-transform:uppercase;
- font-weight:600;margin-bottom:6px}
- .rc-tile-value{font-family:'Cormorant Garamond',serif;font-size:2.2rem;font-weight:900;
- color:#F5E6B8;font-feature-settings:"lnum","tnum";line-height:1;letter-spacing:-0.04em}
- .rc-tile-sub{font-size:11px;opacity:.55;margin-top:4px}
- /* === v4.0 三栏汇总 · 颜色区分(口径分离) === */
- .rc-summary-v4{grid-template-columns:repeat(auto-fit,minmax(180px,1fr))}
- .rc-tile-onetime .rc-tile-label{color:#C4973A}
- .rc-tile-onetime .rc-tile-value{color:#F5E6B8}
- .rc-tile-longterm .rc-tile-label{color:#8FB9D6}
- .rc-tile-longterm .rc-tile-value{color:#B8D4E8}
- .rc-tile-cost .rc-tile-label{color:#E5827A;font-weight:700}
- .rc-tile-cost .rc-tile-value{color:#F5B0A8}
- .rc-tile-leverage .rc-tile-label{color:#A0C9A8}
- .rc-tile-leverage .rc-tile-value{color:#C8E0CC}
- /* [v4.7 + Jack 2026-06-21] 保障缺口 tile · 暖琥珀强调差距语义 */
- .rc-tile-gap .rc-tile-label{color:#E5A654;font-weight:700;letter-spacing:.5px}
- .rc-tile-gap .rc-tile-value{color:#F5C988;text-shadow:0 0 12px rgba(229,166,84,.25)}
- .rc-tile-gap{position:relative}
- .rc-tile-gap::before{content:"⚠";position:absolute;top:8px;right:10px;font-size:14px;color:rgba(229,166,84,.5)}
- /* === 7 险种卡片 · v3.0 v1.2 嵌套 grid 让金字塔三层强制分行 === */
- .policy-grid{display:flex;flex-direction:column;gap:20px;margin-bottom:24px}
- .tier-row{display:grid;gap:16px}
- .tier-row.tier-base,.tier-row.tier-mid{grid-template-columns:repeat(3,1fr)}
- .tier-row.tier-high{grid-template-columns:1fr}
- /* P2.3 中间屏(900-1200)2+1 布局 · 大屏 3 列 · 小屏 1 列 */
- @media (max-width:1200px) and (min-width:901px){
- .tier-row.tier-base,.tier-row.tier-mid{grid-template-columns:repeat(2,1fr)}
- /* 第三张卡片(单独一行,占满)·横向居中 */
- .tier-row.tier-base > .policy-card:nth-child(3),
- .tier-row.tier-mid > .policy-card:nth-child(3){
- grid-column:span 2;max-width:680px;margin-left:auto;margin-right:auto;width:100%;
- }
- }
- @media (max-width:900px){
- .tier-row.tier-base,.tier-row.tier-mid{grid-template-columns:1fr}
- }
- .tier-banner-row{
- display:flex;align-items:center;gap:14px;
- padding:10px 16px;border-radius:8px;
- font-size:12.5px;font-weight:600;letter-spacing:0.5px;
- border-left:4px solid;
- margin-bottom:-6px;
- }
- .tier-banner-row .tb-emoji{font-size:18px}
- .tier-banner-row .tb-meta{font-size:10.5px;opacity:0.8;font-weight:400}
- .tier-banner-row.tb-base{background:#FBE3D2;border-color:#E07A3B;color:#6B3416}
- .tier-banner-row.tb-mid{background:#F5EBC8;border-color:#D4A93A;color:#5A4912}
- .tier-banner-row.tb-high{background:#EFE3F5;border-color:#7A3FA0;color:#3B1A52}
- /* === v2026-06-13 v1.4 · 三层 banner 覆盖率进度条 === */
- .tier-banner-row .tb-progress{
- margin-left:auto;display:flex;align-items:center;gap:10px;
- min-width:200px;
- }
- .tier-banner-row .tb-bar-track{
- flex:1;height:8px;background:rgba(0,0,0,0.08);border-radius:100px;overflow:hidden;
- box-shadow:inset 0 1px 2px rgba(0,0,0,0.06);
- }
- .tier-banner-row .tb-bar-fill{
- height:100%;border-radius:100px;
- transition:width 0.8s cubic-bezier(0.22,1,0.36,1);
- position:relative;
- }
- .tier-banner-row.tb-base .tb-bar-fill{background:linear-gradient(90deg,#D54E42,#962C24)}
- .tier-banner-row.tb-mid .tb-bar-fill{background:linear-gradient(90deg,#E5BB3D,#B58A21)}
- .tier-banner-row.tb-high .tb-bar-fill{background:linear-gradient(90deg,#7A3FA0,#4A1F70)}
- .tier-banner-row .tb-pct{
- font-family:'JetBrains Mono','Cormorant Garamond',monospace;
- font-size:14px;font-weight:800;letter-spacing:-0.02em;
- min-width:48px;text-align:right;
- }
- .tier-banner-row .tb-status-icon{
- font-size:13px;font-weight:700;
- }
- /* 移动端优化:窄屏隐藏 banner 副标 + 进度条收紧 */
- @media (max-width:760px){
- .tier-banner-row .tb-meta{display:none}
- .tier-banner-row .tb-progress{min-width:140px}
- }
- /* 终身寿险整行卡片视觉强化 */
- .policy-card.whole-life{
- background:linear-gradient(135deg,rgba(201,168,76,0.06) 0%,#fff 50%,rgba(201,168,76,0.04) 100%);
- border-left-width:6px;
- }
- .policy-card.whole-life .pc-amount{font-size:32px}
- .policy-card{background:var(--card-bg);border:1px solid var(--border);border-radius:var(--radius);
- padding:20px 24px;transition:all .2s}
- .policy-card:hover{border-color:var(--accent);box-shadow:0 4px 16px rgba(196,151,58,.1)}
- .policy-card.med{border-left:4px solid var(--c-green)}
- .policy-card.life{border-left:4px solid var(--accent)}
- .policy-card.retirement{border-left:4px solid var(--c-blue)}
- .policy-card.education{border-left:4px solid var(--c-purple)}
- /* === v3.0 风险金字塔三层着色(覆盖原 5 卡颜色,统一为金字塔色系) === */
- .policy-card[data-tier="base"]{border-left:4px solid #E07A3B; background:linear-gradient(90deg,rgba(224,122,59,0.04) 0%,#fff 30%)}
- .policy-card[data-tier="mid"]{border-left:4px solid #D4A93A; background:linear-gradient(90deg,rgba(212,169,58,0.04) 0%,#fff 30%)}
- .policy-card[data-tier="high"]{border-left:4px solid #C9A84C; background:linear-gradient(90deg,rgba(201,168,76,0.05) 0%,#fff 30%)}
- /* === P3.1 v2026-06-13 v1.4 · 100% 覆盖卡片折叠态(显示概要 · 点击展开)=== */
- .policy-card.is-collapsed{
- cursor:pointer;padding:14px 24px 16px;
- }
- .policy-card.is-collapsed:hover{background:linear-gradient(90deg,rgba(45,106,79,0.04) 0%,#fff 50%)}
- .policy-card.is-collapsed .pc-amount{font-size:1.6rem}
- .policy-card.is-collapsed .pc-amount-sub,
- .policy-card.is-collapsed .pc-bar,
- .policy-card.is-collapsed .pc-formula,
- .policy-card.is-collapsed .hnw-hl-box,
- .policy-card.is-collapsed .life-tabs,
- .policy-card.is-collapsed .life-track-pane,
- .policy-card.is-collapsed .ppli-table,
- .policy-card.is-collapsed .dual-track-summary,
- .policy-card.is-collapsed #wlNonHnwHint{display:none !important}
- .policy-card.is-collapsed .pc-meta{
- border-top:none;padding-top:8px;margin-top:6px;font-size:11.5px;
- }
- .policy-card.is-collapsed::after{
- content:'▾ 点击展开';position:absolute;bottom:8px;right:14px;
- font-size:10px;color:var(--text-dim);letter-spacing:0.5px;font-weight:600;opacity:0.6;
- pointer-events:none;
- }
- .policy-card.is-collapsed:hover::after{opacity:1;color:var(--accent)}
- .policy-card .pc-tier-badge{
- position:absolute; top:8px; right:14px;
- font-size:9.5px; font-weight:700; letter-spacing:0.6px;
- padding:2px 8px; border-radius:100px;
- font-family:-apple-system,'PingFang SC',sans-serif;
- }
- .policy-card[data-tier="base"] .pc-tier-badge{background:rgba(224,122,59,0.12); color:#9B4D1F}
- .policy-card[data-tier="mid"] .pc-tier-badge{background:rgba(212,169,58,0.12); color:#5A4912}
- .policy-card[data-tier="high"] .pc-tier-badge{background:rgba(201,168,76,0.14); color:#5C4810}
- .policy-card{position:relative}
- /* [v4.8 · 2026-06-26 修正] 移除 data-collapsed 冗余系统
- 原 codebase 已有 .policy-card.is-collapsed 折叠机制(line 540+)· 不再重复 */
- /* === v3.0 金字塔三层概览条(5 险种缺口图上方) === */
- .pyramid-overview{
- margin:24px 0 16px; padding:16px 20px;
- background:#fff; border:1px solid var(--border); border-radius:10px;
- box-shadow:0 1px 3px rgba(60,50,30,0.05);
- }
- .pyramid-overview-title{
- font-size:13px; font-weight:600; color:var(--text-primary);
- margin-bottom:12px; letter-spacing:0.3px;
- }
- .pyramid-overview-rows{display:flex; flex-direction:column; gap:8px}
- .po-row{display:grid; grid-template-columns:30px 1fr 60px 80px; gap:12px; align-items:center; font-size:12px}
- .po-row .po-icon{font-size:16px; text-align:center}
- .po-row .po-name{font-weight:600; color:var(--text-primary)}
- .po-row .po-name .po-sub{display:block; font-size:10px; color:var(--text-tertiary); font-weight:400; margin-top:1px}
- .po-row .po-bar{height:8px; background:rgba(0,0,0,0.05); border-radius:4px; overflow:hidden; position:relative}
- .po-row .po-bar-fill{height:100%; transition:width 0.6s ease; border-radius:4px}
- .po-row .po-pct{font-family:var(--font-mono,monospace); font-weight:700; text-align:right; font-size:13px}
- /* HNW 寿险卡 · 跨 2 行布局(底部和教育金对齐) */
- .policy-card.life.hnw-mode{grid-row:span 2;display:flex;flex-direction:column}
- /* 境内/境外双 Tab(参照 ActionHub ins-tabs 风格) */
- .life-tabs{display:flex;gap:0;margin:14px 0 14px;border-bottom:1.5px solid var(--border)}
- .life-track-tab{flex:1;padding:10px 14px;font-size:12.5px;color:var(--text-dim);cursor:pointer;
- text-align:center;border:1.5px solid transparent;border-bottom:none;border-radius:6px 6px 0 0;
- transition:all .2s;font-weight:500;font-family:'Noto Serif SC',serif;background:var(--bg);
- margin-bottom:-1.5px}
- .life-track-tab:hover{color:var(--accent)}
- .life-track-tab.active{color:var(--accent);background:#fff;border-color:var(--border);
- border-bottom-color:#fff;font-weight:600}
- .life-track-pane{display:none}
- .life-track-pane.active{display:block;animation:lifeTrackFadeIn .25s ease}
- @keyframes lifeTrackFadeIn{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}
- .life-track-amount{font-family:'Cormorant Garamond',serif;font-size:2.2rem;font-weight:900;
- color:var(--text);font-feature-settings:"lnum","tnum";line-height:1.1;margin-bottom:6px;letter-spacing:-0.04em}
- .life-track-amount .unit{font-size:1rem;color:var(--text-dim);font-weight:600;margin-left:4px;letter-spacing:0}
- .life-track-amount-sub{font-size:11px;color:var(--text-dim);margin-bottom:12px}
- .ppli-table{width:100%;border-collapse:collapse;font-size:12px;margin-top:8px;background:#fff;
- border:1px solid var(--border);border-radius:6px;overflow:hidden}
- .ppli-table th{background:var(--accent-dim);color:var(--accent-deep);font-weight:700;
- padding:8px 10px;text-align:left;font-size:11px;letter-spacing:.5px}
- .ppli-table td{padding:8px 10px;border-top:1px solid var(--border);color:var(--text)}
- .ppli-table .num{text-align:right;font-family:'Cormorant Garamond',serif;font-feature-settings:"lnum","tnum";font-weight:600}
- .ppli-table tr:last-child td{font-weight:700;background:var(--accent-dim)}
- .hnw-hl-box{background:linear-gradient(135deg,rgba(166,28,43,.08),rgba(166,28,43,.02));
- border-left:3px solid var(--c-red);border-radius:4px;padding:10px 14px;margin-top:10px;
- font-size:11.5px;color:var(--text);line-height:1.7}
- .hnw-hl-box strong{color:var(--c-red)}
- .hnw-tag{display:inline-block;font-size:10px;letter-spacing:1px;color:#fff;
- background:linear-gradient(135deg,#A61C2B,#8B1C15);padding:2px 8px;border-radius:8px;
- margin-left:8px;font-weight:700}
- .dual-track-summary{margin-top:auto;padding-top:14px;border-top:1px dashed var(--border);
- display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px;font-size:12px}
- .dual-track-summary .lbl{color:var(--text-dim)}
- .dual-track-summary .ratio{font-family:'Cormorant Garamond',serif;font-feature-settings:"lnum","tnum";
- color:var(--accent);font-weight:600;font-size:14px}
- .pc-head{display:flex;align-items:center;gap:10px;margin-bottom:14px}
- .pc-icon{font-size:26px}
- .pc-title{font-size:16.5px;font-weight:700;color:var(--text);letter-spacing:0.3px}
- /* === 缺口状态徽章(v2026-06-13 v1.3 · 卡片右上角 pill · 含百分比文案)=== */
- .pc-status{
- position:absolute; top:34px; right:14px;
- display:inline-flex;align-items:center;justify-content:center;gap:4px;
- padding:3px 9px;border-radius:100px;
- font-size:10.5px;font-weight:700;letter-spacing:0.4px;
- font-family:-apple-system,'PingFang SC',sans-serif;
- flex-shrink:0;transition:all .3s;white-space:nowrap;
- z-index:2;
- }
- .pc-status.covered{
- background:rgba(45,106,79,.14);
- color:#2D6A4F;
- border:1px solid rgba(45,106,79,.35);
- }
- .pc-status.gap-partial{
- background:rgba(184,139,64,.14);
- color:#8B6F1A;
- border:1px solid rgba(184,139,64,.35);
- }
- .pc-status.gap-large{
- background:rgba(166,28,43,.12);
- color:#A6121C;
- border:1px solid rgba(166,28,43,.4);
- animation:gapPulse 1.6s ease-in-out infinite;
- }
- .pc-status.na{
- background:rgba(120,120,120,.10);
- color:#888;
- border:1px solid rgba(120,120,120,.25);
- }
- @keyframes gapPulse{
- 0%,100%{box-shadow:0 0 0 0 rgba(166,28,43,.45);transform:scale(1)}
- 50%{box-shadow:0 0 0 6px rgba(166,28,43,0);transform:scale(1.04)}
- }
- .pc-tag{font-size:10px;letter-spacing:1px;color:var(--text-dim);background:var(--bg);
- padding:3px 8px;border-radius:4px;margin-left:auto;text-transform:uppercase;font-weight:600;display:none}
- .pc-amount{font-family:'Cormorant Garamond',serif;font-size:3.1rem;font-weight:900;
- color:var(--text);font-feature-settings:"lnum","tnum";line-height:1;margin-bottom:6px;
- letter-spacing:-0.045em}
- .pc-amount .unit{font-size:1.15rem;color:var(--text-dim);font-weight:600;margin-left:5px;letter-spacing:0}
- .pc-amount-sub{font-size:12.5px;color:var(--text-dim);margin-bottom:14px;letter-spacing:0.2px}
- .pc-bar{margin-bottom:14px}
- .pc-bar-meta{display:flex;justify-content:space-between;font-size:11.5px;color:var(--text-dim);margin-bottom:5px}
- .pc-bar-meta .v{font-weight:600;color:var(--text);font-family:'Cormorant Garamond',serif;font-feature-settings:"lnum","tnum"}
- .pc-bar-track{width:100%;height:8px;background:var(--bg3);border-radius:100px;overflow:hidden;display:flex}
- .pc-bar-existing{height:100%;border-radius:100px 0 0 100px;background:var(--accent-light);transition:width .8s ease}
- .pc-bar-gap{height:100%;border-radius:0 100px 100px 0;background:linear-gradient(90deg,var(--c-red-light),var(--c-red));transition:width .8s ease}
- .pc-formula{background:var(--accent-dim);border-left:3px solid var(--accent);
- border-radius:4px;padding:10px 14px;margin-bottom:12px;font-size:11.5px;color:var(--text-dim);
- font-family:'Noto Sans SC',monospace;line-height:1.7}
- .pc-formula strong{color:var(--accent-deep);font-weight:700}
- .pc-formula .formula-line{display:block;margin-top:2px}
- .pc-meta{display:flex;justify-content:space-between;align-items:center;
- border-top:1px dashed var(--border);padding-top:12px;font-size:12.5px}
- .pc-meta-label{color:var(--text-dim);font-weight:600}
- .pc-meta-value{font-weight:700;color:var(--accent);font-family:'Cormorant Garamond',serif;font-feature-settings:"lnum","tnum";font-size:16.5px;letter-spacing:-0.02em}
- /* === 配置优先级段(v2026-06-13)· 类似 Timeline 让客户明确下一步 === */
- .priority-section{
- background:linear-gradient(135deg,var(--accent-dim) 0%,rgba(196,151,58,.02) 100%);
- border:1px solid var(--border);
- border-left:4px solid var(--accent);
- border-radius:var(--radius);
- padding:24px 28px;margin-bottom:24px;
- }
- .priority-head{display:flex;align-items:baseline;gap:14px;margin-bottom:6px}
- .priority-title{
- font-family:var(--font-display),'Noto Serif SC',serif;
- font-size:1.1rem;font-weight:700;color:var(--text);letter-spacing:-0.3px;
- }
- .priority-meta{font-size:12px;color:var(--text-dim);margin-left:auto}
- .priority-subtitle{font-size:12.5px;color:var(--text-dim);margin-bottom:18px;line-height:1.7}
- .priority-list{display:flex;flex-direction:column;gap:14px}
- .priority-item{
- background:#fff;border:1px solid var(--border);border-radius:var(--radius);
- padding:14px 18px;display:grid;
- grid-template-columns:80px auto 1fr;gap:16px;align-items:center;
- transition:all .15s;
- }
- .priority-item:hover{border-color:var(--accent);box-shadow:0 4px 12px rgba(196,151,58,.12)}
- .priority-item.p0{border-left:4px solid var(--c-red)}
- .priority-item.p1{border-left:4px solid var(--c-yellow)}
- .priority-item.p2{border-left:4px solid var(--c-blue)}
- .priority-item.done{border-left:4px solid var(--c-green);opacity:.85}
- .pi-rank{
- display:flex;flex-direction:column;align-items:center;justify-content:center;
- padding:8px 0;border-radius:6px;
- font-family:var(--font-sans);
- font-size:10.5px;font-weight:700;letter-spacing:1.2px;
- }
- .pi-rank.p0{background:rgba(166,28,43,.12);color:var(--c-red)}
- .pi-rank.p1{background:rgba(184,139,64,.14);color:var(--c-yellow)}
- .pi-rank.p2{background:rgba(61,111,140,.12);color:var(--c-blue)}
- .pi-rank.done{background:rgba(45,106,79,.12);color:var(--c-green)}
- .pi-rank-num{
- font-family:var(--font-num);
- font-feature-settings:'lnum' 1,'tnum' 1;
- font-variant-numeric:lining-nums tabular-nums;
- font-size:1.4rem;font-weight:900;letter-spacing:-0.04em;
- line-height:1;margin-bottom:2px;
- }
- .pi-icon-wrap{font-size:22px;text-align:center}
- .pi-content{display:flex;flex-direction:column;gap:4px}
- .pi-name{font-size:14px;font-weight:600;color:var(--text)}
- .pi-name .pi-amount{
- color:var(--c-red);font-weight:700;
- font-family:var(--font-num);
- font-feature-settings:'lnum' 1,'tnum' 1;
- font-variant-numeric:lining-nums tabular-nums;
- letter-spacing:-0.02em;
- margin-left:6px;
- }
- .pi-name .pi-amount.done{color:var(--c-green)}
- .pi-action{font-size:12px;color:var(--text-dim);line-height:1.6}
- .pi-action strong{color:var(--accent-deep)}
- /* === 高净值差异化建议 === */
- .uhnw-card{background:linear-gradient(135deg,#FFF8E7 0%,#FFFFFF 100%);
- border:1px solid var(--border);border-left:5px solid #C4973A;
- border-radius:var(--radius);padding:22px 26px;margin-bottom:24px}
- .uhnw-head{display:flex;align-items:baseline;gap:12px;margin-bottom:14px}
- .uhnw-title{font-size:16px;font-weight:700;color:var(--text);
- font-family:var(--font-display),'Noto Serif SC',serif;letter-spacing:-0.3px}
- .uhnw-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:12px}
- .uhnw-item{background:#fff;border:1px solid var(--border);border-radius:6px;padding:12px 16px}
- .uhnw-item-name{font-size:13px;font-weight:600;color:var(--text);margin-bottom:4px}
- .uhnw-item-desc{font-size:11.5px;color:var(--text-dim);line-height:1.6}
- /* === v3.0 v1.5 · 金字塔体检卡(分层卡片堆叠版 · 参照 PPTX 风格)=== */
- .pyramid-check-card{
- background:linear-gradient(135deg,#fff 0%,rgba(201,168,76,0.04) 100%);
- border:1px solid var(--border);border-radius:var(--radius);
- padding:28px 32px;margin-bottom:24px;
- display:grid;grid-template-columns:380px 1fr;gap:36px;align-items:center;
- box-shadow:0 4px 18px rgba(60,50,30,0.08);
- position:relative;
- }
- .pyramid-check-card::before{
- content:'';position:absolute;top:0;left:0;right:0;height:3px;
- background:linear-gradient(90deg,#854F1F 0%,#B07F32 50%,#D9B05A 100%);
- border-radius:var(--radius) var(--radius) 0 0;
- }
- @media (max-width:900px){.pyramid-check-card{grid-template-columns:1fr;gap:24px}}
- .pcc-svg-wrap{display:flex;align-items:center;justify-content:center;position:relative}
- .pcc-svg-wrap svg{width:100%;max-width:380px;height:auto;display:block}
- /* === v3.3.1 · 金字塔工具开关(左上角 · 更靠近边缘 · 香槟金主题)=== */
- .pyramid-controls{
- position:absolute; top:0px; left:0px; z-index:30;
- display:flex; flex-direction:column; gap:3px;
- }
- .pc-toggle{
- display:inline-flex; align-items:center; gap:5px;
- padding:3px 9px; border-radius:100px;
- font-size:10px; font-weight:700; letter-spacing:0.3px;
- font-family:-apple-system,'PingFang SC',sans-serif;
- background:rgba(255,255,255,0.92);
- border:1px solid rgba(201,168,76,0.45);
- color:#9B7C3A; cursor:pointer;
- transition:all 0.2s;
- box-shadow:0 1px 4px rgba(60,50,30,0.10);
- user-select:none; white-space:nowrap;
- }
- .pc-toggle:hover{background:rgba(252,247,235,0.98); border-color:rgba(201,168,76,0.75); transform:translateY(-1px)}
- .pc-toggle[data-on="0"]{
- background:rgba(0,0,0,0.04); border-color:rgba(0,0,0,0.12); color:#999;
- }
- .pc-toggle[data-on="0"]:hover{background:rgba(0,0,0,0.08); color:#666}
- .pc-toggle .tg-dot{
- width:6px; height:6px; border-radius:50%;
- background:#C9A84C;
- box-shadow:0 0 4px rgba(201,168,76,0.6);
- }
- .pc-toggle[data-on="0"] .tg-dot{background:#bbb; box-shadow:none}
- /* === v3.3.3 · 点击放大动效(金字塔每层可点击 · 选中后放大 + 金色光晕)=== */
- .pyr-layer{
- cursor:pointer;
- transform-box:view-box;
- transition:transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
- filter 0.35s ease;
- }
- .pyr-layer:hover{
- transform:scale(1.025);
- filter:drop-shadow(0 3px 8px rgba(201,168,76,0.30));
- }
- .pyr-layer.is-active{
- transform:scale(1.07);
- filter:drop-shadow(0 8px 20px rgba(201,168,76,0.55));
- }
- /* === v2026-06-13 v1.4 · 年缴保费分配 donut 卡(P2.1)=== */
- .premium-allocation-card{
- background:linear-gradient(135deg,#fff 0%,rgba(201,168,76,0.04) 100%);
- border:1px solid var(--border);border-radius:var(--radius);
- padding:24px 28px;margin-bottom:24px;
- display:grid;grid-template-columns:260px 1fr;gap:32px;align-items:center;
- box-shadow:0 4px 18px rgba(60,50,30,0.06);
- }
- /* [v4.8 · 2026-06-26] 年缴保费分配 卡片外加全宽白带 */
- .premium-allocation-wrap{
- position:relative;
- background:var(--band-white);
- box-shadow:0 0 0 100vmax var(--band-white);
- clip-path:inset(0 -100vmax);
- padding:24px 0;margin:0
- }
- /* [v4.8 · 2026-06-26] 风险层 tier banner + 卡片 外加全宽 band wrap
- 可叠加修饰类 --white / --cream / --pale-gold 切换底色 */
- .tier-band-wrap{
- position:relative;
- padding:20px 0;margin:0;
- border:none;border-radius:0
- }
- .tier-band-wrap--white{
- background:var(--band-white);
- box-shadow:0 0 0 100vmax var(--band-white);
- clip-path:inset(0 -100vmax)
- }
- .tier-band-wrap--cream{
- background:var(--band-cream);
- box-shadow:0 0 0 100vmax var(--band-cream);
- clip-path:inset(0 -100vmax)
- }
- .tier-band-wrap--pale-gold{
- background:var(--band-pale-gold);
- box-shadow:0 0 0 100vmax var(--band-pale-gold);
- clip-path:inset(0 -100vmax)
- }
- /* [v4.8 · 2026-06-26] 暖底 wrap · 用于显式包裹 tier 让结构与其他 wrap 对齐 */
- .tier-band-wrap--warm{
- background:var(--bg);
- box-shadow:0 0 0 100vmax var(--bg);
- clip-path:inset(0 -100vmax)
- }
- /* 在 band 内的 tier-banner-row 间距收紧(band 自身已有 padding) */
- .tier-band-wrap > .tier-banner-row{margin-bottom:14px}
- @media (max-width:900px){.premium-allocation-card{grid-template-columns:1fr;gap:20px}}
- .pa-svg-wrap{position:relative;display:flex;align-items:center;justify-content:center}
- .pa-svg-wrap svg{width:100%;max-width:240px;height:auto;display:block}
- .pa-center{position:absolute;text-align:center;pointer-events:none}
- .pa-center-label{font-size:10.5px;color:var(--text-dim);letter-spacing:1px;font-weight:600;margin-bottom:2px}
- .pa-center-num{font-family:'Cormorant Garamond',serif;font-size:1.9rem;font-weight:900;color:var(--text);letter-spacing:-0.04em;line-height:1.1}
- .pa-center-sub{font-size:10.5px;color:var(--text-dim);margin-top:3px;letter-spacing:0.5px}
- .pa-info h3{
- font-family:var(--font-display,Georgia,serif);font-size:18px;font-weight:600;
- color:var(--text);margin-bottom:14px;
- }
- .pa-tier-summary{display:flex;gap:12px;margin-bottom:14px;flex-wrap:wrap}
- .pa-tier-pill{
- display:flex;align-items:center;gap:6px;padding:6px 12px;border-radius:100px;
- font-size:11.5px;font-weight:700;letter-spacing:0.3px;
- }
- .pa-tier-pill .ptp-emoji{font-size:13px}
- .pa-tier-pill .ptp-pct{font-family:'JetBrains Mono',monospace;font-weight:800}
- .pa-tier-pill.ptp-base{background:rgba(213,78,66,0.12);color:#962C24;border:1px solid rgba(213,78,66,0.3)}
- .pa-tier-pill.ptp-mid{background:rgba(229,187,61,0.14);color:#8B6F1A;border:1px solid rgba(229,187,61,0.35)}
- .pa-tier-pill.ptp-high{background:rgba(122,63,160,0.10);color:#5C2A7A;border:1px solid rgba(122,63,160,0.3)}
- .pa-legend{display:grid;grid-template-columns:repeat(2,1fr);gap:8px 16px;margin-bottom:14px}
- .pa-legend-item{display:flex;align-items:center;gap:8px;font-size:11.5px}
- .pa-legend-dot{width:12px;height:12px;border-radius:3px;flex-shrink:0}
- .pa-legend-name{color:var(--text);font-weight:600;flex:1}
- .pa-legend-pct{font-family:'JetBrains Mono',monospace;color:var(--text-dim);font-size:11px;font-weight:700}
- .pa-foot{
- font-size:11.5px;line-height:1.6;color:var(--text-dim);
- background:rgba(201,168,76,0.06);border-left:2px solid #C9A84C;
- padding:10px 14px;border-radius:4px;
- }
- .pcc-info h3{
- font-family:var(--font-display,Georgia,serif);font-size:20px;font-weight:600;
- color:var(--text);margin-bottom:14px;
- }
- .pcc-label-badge{
- display:inline-block;padding:3px 12px;border-radius:100px;
- font-size:11px;font-weight:600;letter-spacing:1px;
- margin-left:10px;vertical-align:middle;
- font-family:-apple-system,'PingFang SC',sans-serif;
- }
- .pcc-tier-rows{display:flex;flex-direction:column;gap:10px;margin-bottom:16px}
- .pcc-tier-row{
- display:grid;grid-template-columns:24px 1fr 110px 60px 16px;
- align-items:center;gap:12px;
- padding:8px 12px;border-radius:8px;
- background:rgba(0,0,0,0.025);
- }
- /* [2026-07-12] 可点击展开 */
- .pcc-tier-clickable{cursor:pointer;transition:background .15s}
- .pcc-tier-clickable:hover{background:rgba(155,124,58,.08)}
- .pcc-tier-caret{font-size:11px;color:var(--text-dim);transition:transform .2s;text-align:center}
- .pcc-tier-row.is-expanded .pcc-tier-caret{transform:rotate(90deg);color:var(--accent)}
- .pcc-tier-detail{max-height:0;overflow:hidden;transition:max-height .3s ease;padding:0 4px}
- .pcc-tier-detail.is-open{max-height:600px;padding:10px 4px 4px}
- .pcc-icon-cell,.pcc-tier-icon{font-size:16px;text-align:center}
- .pcc-tier-name{font-size:12.5px;font-weight:600;color:var(--text)}
- .pcc-tier-name .pcc-tier-sub{
- display:block;font-size:10px;color:var(--text-dim);font-weight:400;
- letter-spacing:0.3px;margin-top:1px;
- }
- .pcc-tier-bar{height:8px;background:rgba(0,0,0,0.06);border-radius:4px;overflow:hidden}
- .pcc-tier-bar-fill{height:100%;transition:width 0.8s ease;border-radius:4px}
- .pcc-tier-pct{text-align:right;font-family:var(--font-mono);font-size:13px;font-weight:700}
- .pcc-diagnosis{
- padding:12px 16px;border-radius:8px;
- font-size:12.5px;line-height:1.6;
- border-left:4px solid;margin-bottom:14px;
- }
- .pcc-diag-msg{font-weight:700;margin-bottom:4px}
- .pcc-diag-text{opacity:0.85}
- .pcc-score-strip{
- display:flex;align-items:center;gap:18px;padding-top:14px;
- border-top:1px solid var(--border);
- }
- .pcc-ss-num{
- font-family:var(--font-mono);font-size:30px;font-weight:800;color:var(--accent);
- line-height:1;
- }
- .pcc-ss-suffix{font-size:13px;color:var(--text-dim);font-weight:400;margin-left:2px}
- .pcc-ss-label{font-size:11.5px;color:var(--text-dim);letter-spacing:0.3px}
- /* === Phase 3 · 5 险种缺口对比柱状图 === */
- .gap-chart-section{background:var(--card-bg);border:1px solid var(--border);
- border-radius:var(--radius);padding:24px 28px;margin-bottom:24px}
- /* === v3.4 · 家庭总财富画像(三盘合并视角)=== */
- .wealth-picture-section{
- /* [v4.8 · 2026-06-26] Total Wealth · 全宽白带(承接 §3 L1 风格)
- 用负 margin + 同等 padding 而非 box-shadow + clip-path 嵌套(避免 §3 内渲染 bug)*/
- position:relative;
- background:var(--card);
- margin:24px calc(-50vw + 50%);
- padding:24px calc(50vw - 50%);
- border:none;border-radius:0;box-shadow:none;clip-path:none}
- .wp-head{display:flex;align-items:baseline;gap:14px;margin-bottom:18px;
- border-bottom:1px solid var(--border);padding-bottom:10px}
- .wp-title{font-size:16px;font-weight:700;color:var(--text);
- font-family:var(--font-display),'Noto Serif SC',serif;letter-spacing:-0.3px}
- .wp-meta{font-size:12px;color:var(--text-dim);margin-left:auto}
- .wp-stack{margin-bottom:14px}
- .wp-bar{display:flex;height:32px;border-radius:6px;overflow:hidden;background:#EFE9DC;
- box-shadow:inset 0 1px 3px rgba(0,0,0,.06);margin-bottom:14px}
- .wp-seg{transition:width .8s ease;display:flex;align-items:center;justify-content:center;
- font-size:11px;color:#fff;font-weight:600;font-family:'Cormorant Garamond',serif;
- font-feature-settings:'lnum','tnum';overflow:hidden;white-space:nowrap}
- .wp-seg-liquid{background:linear-gradient(90deg,#3F8DCB,#5BA8E0)}
- .wp-seg-house{background:linear-gradient(90deg,#9B7C3A,#B89A52)}
- .wp-seg-invest{background:linear-gradient(90deg,#7A5A8E,#A480B5)}
- .wp-seg-insur{background:linear-gradient(90deg,#2E7A4F,#4FA379)}
- .wp-legend{display:grid;grid-template-columns:repeat(5,1fr);gap:10px}
- .wp-legend-item{background:#fff;border:1px solid var(--border);border-radius:6px;
- padding:10px 12px;display:flex;align-items:center;gap:6px;flex-wrap:nowrap;white-space:nowrap;overflow:hidden}
- .wp-legend-total{background:linear-gradient(180deg,#FFFBEC 0%,#F8EFD6 100%);border:2px solid var(--accent)}
- .wp-dot{display:inline-block;width:10px;height:10px;border-radius:50%;flex-shrink:0}
- .wp-dot-liquid{background:#3F8DCB}
- .wp-dot-house{background:#9B7C3A}
- .wp-dot-invest{background:#7A5A8E}
- .wp-dot-insur{background:#2E7A4F}
- .wp-dot-total{background:linear-gradient(135deg,#9B7C3A,#7A5A8E)}
- .wp-lbl{font-size:11.5px;color:var(--text);font-weight:500;flex-shrink:1;text-overflow:ellipsis;overflow:hidden;min-width:0}
- .wp-amt{font-family:'Cormorant Garamond',serif;font-feature-settings:'lnum','tnum';
- font-weight:700;font-size:14.5px;color:var(--text);margin-left:auto;flex-shrink:0;letter-spacing:-0.02em}
- .wp-legend-total .wp-amt{color:var(--accent);font-size:16.5px}
- .wp-pct{font-family:'Cormorant Garamond',serif;font-feature-settings:'lnum','tnum';
- font-weight:600;font-size:11.5px;color:var(--text-dim);flex-shrink:0;margin-left:4px;letter-spacing:-0.02em}
- .wp-insight{background:#FFFBEC;border-left:3px solid var(--accent);padding:10px 14px;
- border-radius:0 4px 4px 0;font-size:12.5px;line-height:1.7;color:var(--text);margin-bottom:14px}
- .wp-insight strong{color:var(--accent)}
- .wp-actions{display:flex;gap:12px;flex-wrap:wrap}
- /* === v3.5.3 · 「打开资产配置中心」「打开 Let's See」按钮 改深机构黑(对齐 CTA + result-cover)
- v3.5.5 · 反转色序: 左深→右暖 · 已上升为 Skill 默认 === */
- .wp-action-btn{display:inline-flex;align-items:center;gap:8px;
- background:linear-gradient(135deg,#080503 0%,#2D2010 100%);color:#F5E6B8;
- border:1px solid rgba(155,124,58,0.45);border-radius:6px;padding:9px 16px;
- font-size:13px;font-weight:500;text-decoration:none;
- transition:all .2s;font-family:'Noto Serif SC',serif;
- box-shadow:0 4px 14px rgba(0,0,0,0.30),inset 0 0 0 1px rgba(155,124,58,0.08)}
- .wp-action-btn:hover{background:linear-gradient(135deg,#0F0A04 0%,#3A2A14 100%);
- border-color:var(--accent-light);transform:translateY(-1px);
- box-shadow:0 8px 22px rgba(0,0,0,0.45),0 0 0 1px rgba(184,154,82,0.30)}
- @media (max-width: 900px){
- .wp-legend{grid-template-columns:repeat(2,1fr)}
- }
- /* === v2.8 · 支付能力健康度 + 行业基准对比 === */
- .affordability-section{background:linear-gradient(180deg,#FEFCF7 0%,#FDF8EA 100%);
- border:1px solid var(--gold);border-radius:var(--radius);padding:22px 28px;margin-bottom:24px;
- box-shadow:0 4px 16px rgba(155,124,58,.08)}
- .aff-head{display:flex;align-items:baseline;gap:14px;margin-bottom:18px;
- border-bottom:1px solid var(--gold-pale);padding-bottom:10px}
- .aff-title{font-size:16px;font-weight:700;color:var(--text);
- font-family:var(--font-display),'Noto Serif SC',serif;letter-spacing:-0.3px}
- .aff-meta{font-size:12px;color:var(--text-dim);margin-left:auto}
- .aff-row{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:16px}
- .aff-card{background:#fff;border:1px solid var(--border);border-radius:8px;padding:14px 16px}
- .aff-card-emphasis{background:linear-gradient(180deg,#FFFBEC 0%,#F8EFD6 100%);
- border:2px solid var(--accent);box-shadow:0 2px 8px rgba(155,124,58,.15)}
- .aff-card-label{font-size:11px;color:var(--text-dim);text-transform:uppercase;letter-spacing:.5px;margin-bottom:6px}
- .aff-card-value{font-family:'Cormorant Garamond',serif;font-feature-settings:'lnum','tnum';
- font-weight:700;font-size:24px;color:var(--text);letter-spacing:-1px;line-height:1.1}
- .aff-card-emphasis .aff-card-value{color:var(--accent)}
- .aff-card-sub{font-size:11px;color:var(--text-dim);margin-top:4px}
- .aff-warning{background:#FFF3E0;border:1px solid #E89B3D;border-left:4px solid #E87530;
- border-radius:6px;padding:10px 14px;margin-bottom:16px;display:flex;align-items:flex-start;gap:10px}
- .aff-warn-icon{font-size:18px;flex-shrink:0}
- .aff-warn-text{font-size:12.5px;color:#7A4710;line-height:1.6;font-weight:500}
- .aff-warn-text strong{color:#A61C2B}
- .aff-benchmark{background:#fff;border:1px solid var(--border);border-radius:8px;padding:16px 18px;margin-bottom:16px}
- .aff-bench-row{display:grid;grid-template-columns:160px 1fr 80px;gap:14px;align-items:center;
- padding:10px 0;border-bottom:1px dashed var(--border)}
- .aff-bench-row:last-child{border-bottom:none}
- .aff-bench-label{font-size:12px;font-weight:600;color:var(--text)}
- .aff-bench-bar{position:relative}
- .aff-bench-track{position:relative;height:18px;background:#F0EDE5;border-radius:4px;overflow:hidden}
- .aff-bench-band{position:absolute;top:0;height:100%}
- .aff-bench-band-ok{background:rgba(45,179,124,.35)}
- .aff-bench-band-warn{background:rgba(232,155,61,.35)}
- .aff-bench-band-bad{background:rgba(166,28,43,.35)}
- .aff-bench-marker{position:absolute;top:-4px;width:3px;height:26px;background:#1A1A1A;border-radius:1px;
- box-shadow:0 0 0 2px #fff,0 2px 6px rgba(0,0,0,.4);transition:left .8s ease}
- .aff-bench-scale{display:flex;justify-content:space-between;font-size:10px;color:var(--text-dim);
- margin-top:4px;font-family:'Cormorant Garamond',serif;font-feature-settings:'lnum','tnum';font-weight:600}
- .aff-bench-value{font-family:'Cormorant Garamond',serif;font-feature-settings:'lnum','tnum';
- font-weight:700;font-size:15px;color:var(--accent);text-align:right}
- .aff-bench-legend{display:flex;align-items:center;gap:6px;justify-content:center;font-size:11px;
- color:var(--text-dim);margin-top:8px;padding-top:8px;border-top:1px dashed var(--border)}
- .aff-bench-leg-dot{display:inline-block;width:10px;height:10px;border-radius:50%;margin:0 4px 0 12px}
- .aff-bench-legend .aff-bench-band-ok{background:rgba(45,179,124,.7)}
- .aff-bench-legend .aff-bench-band-warn{background:rgba(232,155,61,.7)}
- .aff-bench-legend .aff-bench-band-bad{background:rgba(166,28,43,.7)}
- /* === [v4.6] 三轨配置建议 · 完整需求 vs 可负担方案 vs 自定义方案 (合并单卡) === */
- .aff-tri-track{background:#fff;border:1px solid var(--gold);border-radius:8px;padding:16px 18px;margin-top:14px}
- .aff-tri-head{display:flex;align-items:baseline;gap:10px;margin-bottom:12px;flex-wrap:wrap;
- border-bottom:1px solid var(--gold-pale);padding-bottom:8px}
- .aff-tri-title{font-size:14px;font-weight:700;color:var(--text);font-family:var(--font-display),serif}
- .aff-tri-edit-hint{font-size:11px;color:var(--text-dim);margin-left:auto}
- .aff-tri-edit-hint strong{color:#2B6CB0}
- .aff-tri-table{width:100%;border-collapse:collapse;font-size:12px;background:#FAF8F2;
- border:1px solid var(--border);border-radius:6px;overflow:hidden}
- .aff-tri-table th{padding:9px 8px;text-align:center;background:#F4EDD8;color:var(--text);
- font-weight:700;font-size:12px;border-bottom:1px solid var(--border);vertical-align:top}
- .aff-tri-table th.tri-col-name{text-align:left;width:34%;background:#F4EDD8}
- .aff-tri-table th.tri-col-full{background:#F4EDD8}
- .aff-tri-table th.tri-col-aff{background:linear-gradient(180deg,#FFFBEC 0%,#FBF3DD 100%);color:var(--accent)}
- .aff-tri-table th.tri-col-custom{background:linear-gradient(180deg,#EEF4FF 0%,#DCE7FB 100%);color:#2B6CB0}
- .aff-tri-table th .tri-col-sub{display:block;font-size:10px;font-weight:500;
- color:var(--text-dim);margin-top:2px;letter-spacing:0;text-transform:none}
- .aff-tri-table th.tri-col-aff .tri-col-sub{color:var(--accent);opacity:.8}
- .aff-tri-table th.tri-col-custom .tri-col-sub{color:#2B6CB0;opacity:.8}
- .aff-tri-table tbody tr{border-bottom:1px dashed var(--border)}
- .aff-tri-table tbody tr:last-child{border-bottom:none}
- .aff-tri-table td{padding:7px 8px;color:var(--text);vertical-align:middle}
- .aff-tri-table td.tri-num{text-align:center;font-family:'Cormorant Garamond',serif;
- font-feature-settings:'lnum','tnum';font-weight:600;font-variant-numeric:tabular-nums;font-size:13px}
- .aff-tri-table td.tri-num-aff{background:rgba(201,168,76,.05);text-align:center}
- .aff-tri-table td.tri-num-custom{background:rgba(43,108,176,.05);text-align:center}
- .aff-tri-table tfoot tr.tri-total-row td{background:#F4EDD8;font-weight:700;font-size:13.5px;
- border-top:1.5px solid var(--gold);padding-top:10px;padding-bottom:10px;text-align:center}
- .aff-tri-table tfoot tr.tri-total-row td:first-child{text-align:left}
- .aff-tri-table tfoot tr.tri-total-row td.tri-num-aff{background:#FBF3DD;color:var(--accent)}
- .aff-tri-table tfoot tr.tri-total-row td.tri-num-custom{background:#DCE7FB;color:#2B6CB0;text-align:center}
- .tri-cell-cut{color:var(--text-dim)!important;font-style:italic}
- .tri-cell-cut::after{content:" ↓";color:#A61C2B;font-style:normal;font-weight:700}
- /* [v4.7 Q1 + Jack 2026-06-21] 三档差异 mini badge */
- .aff-tri-table tfoot tr.tri-diff-row td{background:#FBF7E8;border-top:1px solid var(--border)}
- .tri-diff-pill{display:inline-block;padding:2px 8px;border-radius:10px;font-family:'Cormorant Garamond',serif;
- font-feature-settings:'lnum','tnum';font-weight:700;font-size:12px;letter-spacing:.3px}
- .tri-diff-pill-down{background:rgba(45,179,124,.12);color:#1F7A4D;border:1px solid rgba(45,179,124,.35)}
- .tri-diff-pill-up{background:rgba(166,28,43,.10);color:#A61C2B;border:1px solid rgba(166,28,43,.35)}
- .tri-diff-pill-eq{background:rgba(155,124,58,.10);color:#7A6028;border:1px solid rgba(155,124,58,.30)}
- .tri-diff-amt{font-size:10.5px;color:#7A6028;margin-left:4px;font-family:'Cormorant Garamond',serif;font-feature-settings:'lnum','tnum'}
- .tri-custom-input{width:78px;padding:4px 6px;border:1px solid #B8C9DD;border-radius:4px;
- font-family:'Cormorant Garamond',serif;font-feature-settings:'lnum','tnum';
- font-variant-numeric:tabular-nums;font-size:13px;font-weight:600;color:#2B6CB0;
- background:#fff;text-align:right;transition:all .15s}
- .tri-custom-input:focus{outline:none;border-color:#2B6CB0;box-shadow:0 0 0 2px rgba(43,108,176,.18)}
- .tri-custom-input:hover{border-color:#2B6CB0}
- .tri-custom-input::-webkit-outer-spin-button,
- .tri-custom-input::-webkit-inner-spin-button{opacity:.5;height:18px}
- .tri-custom-suffix{margin-left:3px;color:var(--text-dim);font-size:11px}
- .aff-tri-warn{margin-top:10px;padding:8px 12px;border-radius:6px;font-size:11.5px;
- display:none;line-height:1.5}
- .aff-tri-warn.is-warn{display:block;background:#FFF5F5;border:1px solid #E87070;color:#A61C2B}
- .aff-tri-warn.is-ok{display:block;background:#F0FAF4;border:1px solid #5DB890;color:#1F4D2F}
- .aff-tri-warn strong{font-weight:700}
- .aff-dual-note{margin-top:10px;font-size:11.5px;color:var(--text-dim);background:#FFFBEC;
- border-left:3px solid var(--accent);padding:8px 12px;border-radius:0 4px 4px 0;line-height:1.6}
- .aff-dual-note strong{color:var(--text)}
- @media (max-width: 900px){
- .aff-row{grid-template-columns:repeat(2,1fr)}
- .aff-bench-row{grid-template-columns:120px 1fr 70px}
- }
- @media (max-width: 680px){
- .aff-tri-table{font-size:11px}
- .aff-tri-table th,.aff-tri-table td{padding:6px 4px}
- .tri-custom-input{width:60px;font-size:12px}
- }
- .gap-chart-head{display:flex;align-items:baseline;gap:14px;margin-bottom:18px;
- border-bottom:1px solid var(--border);padding-bottom:10px}
- .gap-chart-title{font-size:16px;font-weight:700;color:var(--text);
- font-family:var(--font-display),'Noto Serif SC',serif;letter-spacing:-0.3px;
- font-feature-settings:'lnum' 1,'tnum' 1;font-variant-numeric:lining-nums tabular-nums}
- .gap-chart-meta{font-size:12px;color:var(--text-dim);margin-left:auto}
- .gap-row{display:grid;grid-template-columns:120px 1fr 100px;gap:14px;align-items:center;
- padding:10px 0;border-bottom:1px dashed var(--border)}
- .gap-row:last-child{border-bottom:none}
- .gap-label{font-size:13px;font-weight:600;color:var(--text);display:flex;align-items:center;gap:6px}
- .gap-bar-wrap{position:relative;height:24px;background:var(--gold-pale);border-radius:6px;overflow:hidden}
- .gap-bar-existing{position:absolute;top:0;left:0;height:100%;background:linear-gradient(90deg,#9B7C3A,#B89A52);
- transition:width .8s ease;display:flex;align-items:center;justify-content:flex-end;padding-right:6px;
- font-size:10px;color:#fff;font-weight:600}
- .gap-bar-gap{position:absolute;top:0;height:100%;background:linear-gradient(90deg,#E87070,#A61C2B);
- transition:all .8s ease;display:flex;align-items:center;justify-content:flex-end;padding-right:6px;
- font-size:10px;color:#fff;font-weight:600}
- .gap-amount{font-family:'Cormorant Garamond',serif;font-feature-settings:"lnum","tnum";
- font-weight:600;color:var(--text);font-size:13px;text-align:right}
- .gap-amount .gap-num{color:var(--c-red)}
- /* === Phase 3 · 推荐产品区 === */
- .product-section{background:var(--card-bg);border:1px solid var(--border);
- border-radius:var(--radius);padding:24px 28px;margin-bottom:24px}
- .product-tabs{display:flex;gap:0;margin-bottom:16px;border-bottom:2px solid var(--border)}
- /* === [v4.4.2] 通用 ⓘ Popover 组件 · 注解折叠节省空间 === */
- .info-pill{
- display:inline-flex;align-items:center;gap:6px;
- padding:5px 12px;background:rgba(196,151,58,.12);
- border:1px solid rgba(196,151,58,.40);border-radius:14px;
- color:#C4973A;font-size:11.5px;cursor:pointer;
- transition:all .15s;font-family:inherit;line-height:1.4;
- user-select:none;white-space:nowrap;
- }
- .info-pill:hover{background:rgba(196,151,58,.22);transform:translateY(-1px)}
- .info-pill .info-icon{font-size:13px;font-weight:700;line-height:1}
- .info-pill .info-label{font-weight:600}
- .info-pill .info-count{color:#7A6028;font-weight:500;font-size:10.5px}
- .info-pill.info-pill-light{
- background:rgba(245,230,184,.10);border-color:rgba(245,230,184,.35);color:#F5E6B8;
- }
- .info-pill.info-pill-light:hover{background:rgba(245,230,184,.20)}
- /* ════════════════════════════════════════════════════════════════════
- [v4.8 · 2026-06-26] 客户家庭报告 · 一页总结(报告尾部"客户带走"卡)
- 外侧 pale-gold 横带 + 内侧白底大字 + 三色编码 3 步行动
- ════════════════════════════════════════════════════════════════════ */
- .client-summary-card{
- background:var(--card);
- border:1px solid var(--accent-light);
- border-left:5px solid var(--accent);
- border-radius:12px;
- padding:28px 32px;
- margin:0 auto;
- max-width:920px;
- box-shadow:0 6px 24px rgba(60,50,30,0.10);
- display:none; /* 由 renderClientSummary() 决定显示 */
- }
- .client-summary-card.show{display:block}
- .cs-head{
- display:flex;align-items:center;gap:12px;margin-bottom:6px;
- }
- .cs-icon{font-size:22px}
- .cs-title{
- font-family:'Cormorant Garamond','Noto Serif SC',serif;
- font-size:1.8rem;font-weight:700;color:var(--text);
- letter-spacing:-0.3px
- }
- .cs-tag{
- margin-left:auto;
- font-size:9.5px;letter-spacing:2.5px;
- color:var(--accent);
- background:var(--accent-dim);
- border:1px solid var(--accent-light);
- padding:3px 10px;border-radius:100px;
- text-transform:uppercase;font-weight:700
- }
- .cs-subtitle{
- font-size:12.5px;color:var(--text-dim);
- margin-bottom:22px;line-height:1.7;
- padding-bottom:14px;border-bottom:1px solid var(--border)
- }
- /* 一句话诊断 · 故事化 */
- .cs-headline{
- font-size:15px;line-height:1.85;
- color:var(--text);
- margin-bottom:22px;
- padding:14px 18px;
- background:var(--gold-pale);
- border-left:3px solid var(--accent);
- border-radius:0 6px 6px 0;
- font-family:'Noto Serif SC',serif;font-weight:500
- }
- .cs-headline strong{color:var(--accent);font-weight:700}
- .cs-headline .cs-h-num{
- font-family:'Cormorant Garamond',serif;font-weight:900;
- letter-spacing:-0.02em;font-size:1.1em
- }
- /* 关键指标 4 列 */
- .cs-metrics{
- display:grid;grid-template-columns:repeat(4,1fr);gap:0;
- border:1px solid var(--border);border-radius:8px;
- margin-bottom:24px;overflow:hidden
- }
- .cs-metric{
- padding:16px 14px;text-align:center;
- border-right:1px solid var(--border);
- background:#FFF
- }
- .cs-metric:last-child{border-right:none}
- .cs-metric-label{
- font-size:10px;color:var(--text-dim);
- letter-spacing:1.5px;font-weight:600;
- text-transform:uppercase;margin-bottom:8px
- }
- .cs-metric-value{
- font-family:'Cormorant Garamond','Noto Serif SC',serif;
- font-size:1.8rem;font-weight:900;
- color:var(--accent);letter-spacing:-0.04em;line-height:1.1;
- font-feature-settings:'lnum' 1,'tnum' 1
- }
- .cs-metric-value-text{font-size:1.3rem;color:var(--text)}
- .cs-metric-sub{
- font-size:10.5px;color:var(--text-dim);
- margin-top:6px;line-height:1.4
- }
- @media(max-width:720px){.cs-metrics{grid-template-columns:repeat(2,1fr)}.cs-metric:nth-child(2){border-right:none}.cs-metric:nth-child(-n+2){border-bottom:1px solid var(--border)}}
- /* 接下来 3 件事 */
- .cs-actions-head{
- font-family:'Cormorant Garamond','Noto Serif SC',serif;
- font-size:1.15rem;font-weight:700;
- color:var(--text);
- margin-bottom:14px;letter-spacing:-0.2px
- }
- .cs-actions{
- display:flex;flex-direction:column;gap:10px;
- margin-bottom:24px
- }
- .cs-action{
- display:flex;gap:14px;
- padding:14px 18px;
- background:#FFF;
- border:1px solid var(--border);
- border-radius:8px;
- transition:box-shadow .15s, transform .15s
- }
- .cs-action:hover{box-shadow:0 4px 14px rgba(60,50,30,0.08);transform:translateY(-1px)}
- .cs-action-num{
- flex-shrink:0;
- width:32px;height:32px;border-radius:50%;
- display:flex;align-items:center;justify-content:center;
- font-family:'Cormorant Garamond',serif;font-weight:900;
- font-size:16px;color:#FFF;letter-spacing:-0.02em
- }
- .cs-action--base .cs-action-num{background:linear-gradient(135deg,#E07A3B,#9B4D1F)}
- .cs-action--mid .cs-action-num{background:linear-gradient(135deg,#D4A93A,#9B7C3A)}
- .cs-action--high .cs-action-num{background:linear-gradient(135deg,#7A3FA0,#4A1F70)}
- .cs-action-body{flex:1;min-width:0}
- .cs-action-head{
- display:flex;align-items:baseline;gap:8px;
- font-size:13.5px;font-weight:700;color:var(--text);
- margin-bottom:4px
- }
- .cs-action-window{
- font-size:11px;font-weight:600;
- padding:2px 8px;border-radius:100px;
- letter-spacing:0.5px
- }
- .cs-action--base .cs-action-window{background:rgba(224,122,59,0.12);color:#9B4D1F}
- .cs-action--mid .cs-action-window{background:rgba(212,169,58,0.14);color:#8B6F1A}
- .cs-action--high .cs-action-window{background:rgba(122,63,160,0.10);color:#5C2A7A}
- .cs-action-desc{
- font-size:12px;color:var(--text-dim);
- line-height:1.65
- }
- .cs-action-desc strong{color:var(--text);font-weight:600}
- /* CTA · 联系顾问 */
- .cs-cta{
- background:linear-gradient(135deg,#1A0F05 0%,#2A1F0F 60%,#3D2914 100%);
- color:#F5E6B8;
- border-radius:8px;
- padding:18px 24px;
- text-align:center;
- box-shadow:inset 0 0 0 1px rgba(196,151,58,0.20)
- }
- .cs-cta-msg{
- font-size:13.5px;font-weight:600;
- color:#F5E6B8;
- margin-bottom:8px
- }
- .cs-cta-contact{
- font-size:11.5px;
- color:rgba(245,230,184,0.85);
- letter-spacing:0.3px;
- display:flex;align-items:center;justify-content:center;
- gap:10px;flex-wrap:wrap
- }
- .cs-cta-contact strong{color:#C8AB60;font-weight:700;letter-spacing:0.5px}
- .cs-cta-divider{opacity:0.4}
- .info-pill.info-pill-warn{
- background:rgba(232,112,112,.12);border-color:rgba(232,112,112,.40);color:#E87070;
- }
- .info-pill.info-pill-warn:hover{background:rgba(232,112,112,.22)}
- .info-popover-overlay{
- position:fixed;top:0;left:0;right:0;bottom:0;
- background:rgba(0,0,0,.45);backdrop-filter:blur(2px);
- display:none;align-items:center;justify-content:center;
- z-index:1000;animation:popoverFadeIn .15s ease-out;
- }
- .info-popover-overlay.is-open{display:flex}
- @keyframes popoverFadeIn{from{opacity:0}to{opacity:1}}
- .info-popover{
- background:linear-gradient(180deg,#1A0F05 0%,#2A1F0F 100%);
- color:#F5E6B8;padding:0;border-radius:10px;
- border:1px solid rgba(196,151,58,.50);
- box-shadow:0 16px 60px rgba(0,0,0,.55);
- max-width:540px;width:90%;max-height:80vh;
- display:flex;flex-direction:column;
- font-size:12px;line-height:1.75;
- animation:popoverSlideIn .2s ease-out;
- }
- @keyframes popoverSlideIn{from{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}
- .info-popover-head{
- display:flex;align-items:center;gap:12px;
- padding:14px 18px;border-bottom:1px solid rgba(196,151,58,.25);
- font-family:'Noto Serif SC',serif;font-weight:700;font-size:14px;
- color:#F5E6B8;letter-spacing:-.2px;
- }
- .info-popover-head .info-pop-icon{font-size:18px}
- .info-popover-close{
- margin-left:auto;background:transparent;border:1px solid rgba(196,151,58,.40);
- color:#C4973A;width:26px;height:26px;border-radius:50%;
- cursor:pointer;font-size:14px;line-height:1;
- display:flex;align-items:center;justify-content:center;
- transition:all .15s;
- }
- .info-popover-close:hover{background:rgba(196,151,58,.20);color:#F5E6B8}
- .info-popover-body{
- padding:16px 18px;overflow-y:auto;flex:1;
- font-size:12px;line-height:1.75;color:rgba(245,230,184,.88);
- }
- .info-popover-body p{margin:0 0 12px 0}
- .info-popover-body p:last-child{margin-bottom:0}
- .info-popover-body strong{color:#F5E6B8;font-weight:700}
- .info-popover-body ul{margin:8px 0;padding-left:20px}
- .info-popover-body li{margin:4px 0}
- .info-popover-body .info-row{
- margin:10px 0;padding:10px 12px;
- background:rgba(196,151,58,.08);border-left:2px solid #C4973A;
- border-radius:0 4px 4px 0;
- }
- .info-popover-body .info-row.info-row-warn{
- background:rgba(232,112,112,.08);border-left-color:#E87070;
- }
- /* === [v4.5.2] 方案切换器 · 建议 vs 可负担 === */
- .cf-scenario-switch{
- display:flex;align-items:center;gap:10px;flex-wrap:wrap;
- padding:12px 14px;margin-bottom:14px;
- background:rgba(196,151,58,.06);border:1px solid rgba(196,151,58,.25);border-radius:8px;
- }
- .cf-scenario-label{font-size:11.5px;color:#7A6028;font-weight:600;letter-spacing:.3px;flex-shrink:0}
- .cf-scenario-btn{
- display:inline-flex;align-items:center;gap:8px;
- padding:8px 14px;background:#FFFFFF;border:1px solid #C9A84C;
- border-radius:6px;cursor:pointer;font-family:inherit;
- transition:all .15s;font-size:12px;color:#5C4810;
- user-select:none;
- }
- .cf-scenario-btn:hover{background:#FAF6E8;border-color:#9B7C3A}
- .cf-scenario-btn.is-active{
- background:linear-gradient(135deg,#9B7C3A,#C4973A);color:#F5E6B8;
- border-color:#7A6028;box-shadow:0 2px 8px rgba(155,124,58,.30);
- }
- .cf-scenario-btn.is-active.is-affordable{
- background:linear-gradient(135deg,#2DB37C,#5DB890);border-color:#1F8557;
- box-shadow:0 2px 8px rgba(45,179,124,.30);
- }
- /* [v4.6] 自定义方案按钮 active 态 · 蓝色与三轨 C 列保持一致 */
- .cf-scenario-btn.is-active.is-custom{
- background:linear-gradient(135deg,#2B6CB0,#3A82C4);color:#FFFFFF;border-color:#1E4F8A;
- box-shadow:0 2px 8px rgba(43,108,176,.32);
- }
- .cf-scenario-btn.is-custom:not(.is-active){
- border-color:#B8C9DD;color:#2B6CB0;
- }
- .cf-scenario-btn.is-custom:not(.is-active):hover{
- background:#EEF4FF;border-color:#2B6CB0;
- }
- .scn-icon{font-size:14px;line-height:1}
- .scn-name{font-weight:700;letter-spacing:.2px}
- .scn-detail{font-family:'Cormorant Garamond',serif;font-feature-settings:'lnum','tnum';
- font-weight:500;font-size:11px;opacity:.85;margin-left:4px;
- padding-left:8px;border-left:1px solid currentColor;border-left-color:rgba(255,255,255,.30)}
- .cf-scenario-btn:not(.is-active) .scn-detail{border-left-color:rgba(122,96,40,.30);color:#7A6028}
- .cf-scenario-hint{flex:1;font-size:11px;color:#7A6028;font-style:italic;
- text-align:right;line-height:1.5;min-width:200px}
- /* === [v4.5.1] 风险对冲覆盖 KPI 卡片 · 把死亡赔付重新包装 === */
- .risk-hedge-kpi{
- background:linear-gradient(135deg,#1A0F05 0%,#2A1F0F 50%,#3D2914 100%);
- color:#F5E6B8;border-radius:12px;padding:20px 24px;margin-top:20px;
- border:1px solid rgba(196,151,58,.40);
- box-shadow:0 8px 28px rgba(0,0,0,.25);
- position:relative;overflow:hidden;
- }
- .risk-hedge-kpi::before{
- content:'';position:absolute;top:-50%;right:-30%;width:400px;height:300px;
- background:radial-gradient(circle,rgba(196,151,58,.20) 0%,transparent 70%);
- pointer-events:none;
- }
- .rhk-head{display:flex;align-items:center;gap:10px;margin-bottom:16px;
- border-bottom:1px solid rgba(196,151,58,.20);padding-bottom:12px;position:relative;z-index:1}
- .rhk-icon{font-size:22px}
- .rhk-title{font-family:'Noto Serif SC',serif;font-weight:700;font-size:15px;color:#F5E6B8;letter-spacing:-.3px}
- .rhk-body{display:flex;align-items:center;gap:32px;flex-wrap:wrap;position:relative;z-index:1}
- .rhk-value-block{flex-shrink:0;text-align:center;min-width:200px;padding-right:24px;
- border-right:1px solid rgba(196,151,58,.25)}
- .rhk-value{font-family:'Cormorant Garamond','Noto Serif SC',serif;
- font-weight:900;font-size:3.2rem;color:#F5E6B8;letter-spacing:-.04em;line-height:1;
- font-feature-settings:'lnum' 1,'tnum' 1;
- text-shadow:0 2px 12px rgba(196,151,58,.30)}
- .rhk-value-label{font-size:11.5px;color:#C4973A;letter-spacing:.5px;margin-top:6px;font-weight:500}
- .rhk-pillars{flex:1;display:grid;grid-template-columns:repeat(5,1fr);gap:10px;min-width:0}
- .rhk-pillar{display:flex;flex-direction:column;align-items:center;gap:3px;
- padding:10px 6px;background:rgba(245,230,184,.06);border:1px solid rgba(196,151,58,.22);
- border-radius:6px;text-align:center;transition:all .15s}
- .rhk-pillar:hover{background:rgba(245,230,184,.12);border-color:rgba(196,151,58,.40);transform:translateY(-1px)}
- .rhk-pillar-icon{font-size:18px;line-height:1}
- .rhk-pillar-name{font-size:11.5px;font-weight:700;color:#F5E6B8;letter-spacing:.2px;margin-top:2px}
- .rhk-pillar-desc{font-size:10px;color:#C4973A;line-height:1.35;opacity:.85}
- .rhk-footer{margin-top:14px;padding-top:12px;border-top:1px solid rgba(196,151,58,.20);
- font-size:11.5px;color:rgba(245,230,184,.70);line-height:1.65;position:relative;z-index:1}
- .rhk-footer strong{color:#F5E6B8;font-weight:700}
- /* === [v4.5.2] 杠杆比指标(可负担方案下显示) === */
- .rhk-leverage{
- display:flex;align-items:center;gap:18px;flex-wrap:wrap;
- margin-top:14px;padding:12px 16px;
- background:linear-gradient(90deg,rgba(45,179,124,.18) 0%,rgba(196,151,58,.10) 100%);
- border:1px solid rgba(45,179,124,.40);border-radius:8px;
- position:relative;z-index:1;
- }
- .rhk-lev-block{display:flex;align-items:center;gap:8px}
- .rhk-lev-icon{font-size:16px}
- .rhk-lev-label{font-size:11.5px;color:#90E0B0;font-weight:600;letter-spacing:.3px}
- .rhk-lev-value{
- font-family:'Cormorant Garamond',serif;font-feature-settings:'lnum','tnum';
- font-weight:900;font-size:2.2rem;color:#90E0B0;letter-spacing:-.04em;line-height:1;
- display:flex;align-items:baseline;
- }
- .rhk-lev-value > span{}
- .rhk-lev-desc{flex:1;font-size:11.5px;color:rgba(245,230,184,.85);line-height:1.6;
- border-left:1px solid rgba(196,151,58,.30);padding-left:14px}
- .rhk-lev-desc strong{color:#90E0B0;font-weight:700}
- @media (max-width:900px){
- .rhk-leverage{flex-direction:column;align-items:flex-start}
- .rhk-lev-desc{border-left:none;padding-left:0;margin-top:6px}
- }
- @media (max-width:900px){
- .rhk-body{flex-direction:column;align-items:stretch}
- .rhk-value-block{border-right:none;border-bottom:1px solid rgba(196,151,58,.25);
- padding-right:0;padding-bottom:18px;margin-bottom:8px}
- .rhk-pillars{grid-template-columns:repeat(2,1fr)}
- }
- /* === v4.4 现金流规划段 · LDI 视角 === */
- .cashflow-section{
- /* [v4.8 · 2026-06-26 测试] 风险对冲覆盖卡片外侧改为纯白 band 看效果 */
- position:relative;
- background:var(--card);
- box-shadow:0 0 0 100vmax var(--card);
- clip-path:inset(0 -100vmax);
- border:none;border-radius:0;
- padding:32px 0;margin:0
- }
- .cf-section-head{display:flex;align-items:baseline;gap:14px;margin-bottom:8px;
- border-bottom:1px solid rgba(201,168,76,.3);padding-bottom:10px}
- .cf-section-title{font-family:'Noto Serif SC',serif;font-size:17px;font-weight:700;
- color:#3D2914;letter-spacing:-0.3px}
- .cf-section-meta{font-size:11.5px;color:#7A6028;margin-left:auto}
- .cf-chart-wrap{margin-top:18px;background:#FFFFFF;border-radius:8px;padding:18px 20px;
- border:1px solid #E8DFC8}
- .cf-chart-head{display:flex;align-items:baseline;gap:14px;margin-bottom:14px}
- .cf-chart-title{font-size:13px;font-weight:600;color:#1A0F05}
- .cf-chart-meta{font-size:10.5px;color:#7A6028;margin-left:auto}
- .cf-canvas-wrap canvas{cursor:crosshair}
- .cf-tooltip{position:absolute;background:#1A0F05;color:#F5E6B8;
- padding:8px 12px;border-radius:6px;font-size:11px;line-height:1.6;
- pointer-events:none;z-index:100;box-shadow:0 4px 12px rgba(0,0,0,.3);
- font-family:'Inter','Noto Sans SC',sans-serif;max-width:240px;
- border:1px solid rgba(196,151,58,.4)}
- .cf-tooltip strong{color:#F5E6B8;font-weight:700}
- .cf-tooltip .tooltip-row{display:flex;justify-content:space-between;gap:14px;margin:2px 0}
- .cf-tooltip .tooltip-dot{display:inline-block;width:8px;height:8px;border-radius:2px;margin-right:4px;vertical-align:baseline}
- .cf-legend{display:flex;flex-wrap:wrap;gap:14px;margin-top:14px;padding-top:14px;
- border-top:1px solid #E8DFC8;font-size:11.5px;color:#5C4810}
- .cf-legend-item{display:flex;align-items:center;gap:5px}
- .cf-dot{display:inline-block;width:10px;height:10px;border-radius:2px}
- .cf-insights{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:18px}
- .cf-insight{padding:12px 14px;border-radius:8px;font-size:11.5px;line-height:1.6}
- .cf-insight strong{color:#1A0F05;font-weight:700;display:block;margin-bottom:4px;font-size:12px}
- .cf-insight-peak{background:rgba(166,28,43,.08);border-left:3px solid #A61C2B;color:#5C1B1F}
- .cf-insight-mid{background:rgba(196,151,58,.08);border-left:3px solid #C4973A;color:#5C4810}
- .cf-insight-end{background:rgba(141,185,213,.08);border-left:3px solid #3D6F8C;color:#1F3F4D}
- .ldi-suggestion{margin-top:16px;padding:14px 18px;
- background:linear-gradient(90deg,rgba(122,90,142,0.08),rgba(196,151,58,0.06));
- border-left:3px solid #7A5A8E;border-radius:0 6px 6px 0;font-size:12px;
- line-height:1.7;color:#3D2914}
- .ldi-suggestion strong{color:#7A5A8E;font-weight:700}
- @media (max-width:900px){
- .cf-insights{grid-template-columns:1fr}
- }
- .product-tab{padding:10px 20px;font-size:13px;color:var(--text-dim);cursor:pointer;font-weight:500;
- border-bottom:3px solid transparent;margin-bottom:-2px;transition:all .2s;font-family:'Noto Serif SC',serif}
- .product-tab:hover{color:var(--accent)}
- .product-tab.active{color:var(--accent);border-bottom-color:var(--accent);font-weight:600}
- .product-pane{display:none}
- .product-pane.active{display:block}
- .product-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:14px}
- .product-item{background:#fff;border:1px solid var(--border);border-radius:6px;padding:14px 16px;
- border-left:3px solid var(--accent);transition:all .15s}
- .product-item:hover{border-color:var(--accent);box-shadow:0 4px 12px rgba(196,151,58,.1)}
- .product-item.hot{border-left-color:#A61C2B;background:linear-gradient(135deg,#FFF8F8,#FFF)}
- .product-name{font-size:14.5px;font-weight:700;color:var(--text);margin-bottom:4px;display:flex;
- align-items:center;gap:6px;
- font-family:var(--font-display),'Noto Serif SC',serif;letter-spacing:-0.2px;
- font-feature-settings:'lnum' 1,'tnum' 1;font-variant-numeric:lining-nums tabular-nums}
- .product-issuer{font-size:11px;color:var(--text-dim);margin-bottom:6px;
- font-family:var(--font-sans);letter-spacing:.3px;text-transform:uppercase;font-weight:600}
- .product-tagline{font-size:12px;color:var(--accent-deep);font-style:italic;margin-bottom:8px;line-height:1.5;
- font-family:var(--font-eb),'Noto Serif SC',serif}
- .product-feats{font-size:11.5px;color:var(--text-dim);line-height:1.7;
- font-family:var(--font-sans)}
- .product-feats li{margin-bottom:2px;list-style:none;padding-left:14px;position:relative}
- .product-feats li::before{content:"▸";position:absolute;left:2px;color:var(--accent)}
- .product-meta{display:flex;justify-content:space-between;align-items:center;margin-top:10px;
- padding-top:8px;border-top:1px dashed var(--border);font-size:11px;color:var(--text-dim)}
- .product-meta .v{font-weight:600;color:var(--accent);font-family:'Cormorant Garamond',serif;font-feature-settings:"lnum","tnum"}
- .hot-badge{font-size:9px;background:linear-gradient(135deg,#A61C2B,#8B1C15);color:#fff;
- padding:1px 6px;border-radius:8px;letter-spacing:.5px;font-weight:700}
- /* === 产品详情 Modal(v2026-06-13)· 点击产品卡弹出 === */
- .product-modal{
- position:fixed;inset:0;background:rgba(26,15,5,.5);z-index:1000;
- display:none;align-items:flex-start;justify-content:center;
- backdrop-filter:blur(4px);overflow-y:auto;padding:40px 20px;
- }
- .product-modal.active{display:flex;animation:pmFadeIn .2s ease}
- @keyframes pmFadeIn{from{opacity:0}to{opacity:1}}
- .pm-card{
- background:#fff;border-radius:12px;
- max-width:680px;width:100%;
- box-shadow:0 20px 60px rgba(0,0,0,.3);
- position:relative;overflow:hidden;
- animation:pmSlideIn .25s ease;
- }
- @keyframes pmSlideIn{from{transform:translateY(-20px);opacity:0}to{transform:translateY(0);opacity:1}}
- .pm-close{
- position:absolute;top:16px;right:16px;
- width:32px;height:32px;border-radius:50%;
- background:var(--bg);border:1px solid var(--border);
- display:flex;align-items:center;justify-content:center;
- font-size:18px;color:var(--text-dim);cursor:pointer;
- transition:all .15s;z-index:10;
- }
- .pm-close:hover{background:var(--c-red);color:#fff;border-color:var(--c-red)}
- .pm-header{
- background:linear-gradient(135deg,#1A0F05,#3D2914);
- color:#fff;padding:32px 36px 24px;
- }
- .pm-eyebrow{
- font-family:var(--font-sans);
- font-size:10.5px;color:#C4973A;letter-spacing:1.8px;text-transform:uppercase;
- font-weight:700;margin-bottom:10px;
- }
- .pm-title{
- font-family:var(--font-display),'Noto Serif SC',serif;
- font-size:1.5rem;font-weight:700;color:#F5E6B8;letter-spacing:-0.3px;
- line-height:1.3;margin-bottom:6px;display:flex;align-items:center;gap:10px;flex-wrap:wrap;
- }
- .pm-title-en{
- font-family:var(--font-eb),'Noto Serif SC',serif;
- font-size:.85rem;color:rgba(245,230,184,.5);font-style:italic;margin-bottom:14px;
- }
- .pm-meta-row{
- font-family:var(--font-sans);
- font-size:11.5px;color:rgba(245,230,184,.65);
- display:flex;flex-wrap:wrap;gap:12px;
- }
- .pm-meta-row .pm-meta-item{display:flex;align-items:center;gap:5px}
- .pm-tagline{
- font-family:var(--font-eb),'Noto Serif SC',serif;
- font-size:.95rem;color:rgba(245,230,184,.85);font-style:italic;
- margin-top:14px;padding-top:14px;
- border-top:1px solid rgba(196,151,58,.2);
- line-height:1.6;
- }
- .pm-body{padding:28px 36px}
- .pm-section{margin-bottom:22px}
- .pm-section:last-child{margin-bottom:0}
- .pm-section-title{
- font-family:var(--font-display),'Noto Serif SC',serif;
- font-size:13px;color:var(--accent-deep);font-weight:700;
- letter-spacing:-0.2px;margin-bottom:10px;
- display:flex;align-items:center;gap:8px;
- }
- .pm-section-title::before{content:"";width:4px;height:14px;background:var(--accent);border-radius:2px}
- .pm-grid-2{display:grid;grid-template-columns:1fr 1fr;gap:10px 16px;font-size:12.5px}
- .pm-grid-2 .pm-label{color:var(--text-dim);font-family:var(--font-sans)}
- .pm-grid-2 .pm-value{color:var(--text);font-weight:600;
- font-family:var(--font-num);font-feature-settings:'lnum' 1,'tnum' 1;
- font-variant-numeric:lining-nums tabular-nums;letter-spacing:-0.02em}
- .pm-list{margin:0;padding:0;list-style:none}
- .pm-list li{
- font-family:var(--font-sans);
- font-size:12.5px;color:var(--text-dim);line-height:1.7;
- padding-left:18px;position:relative;margin-bottom:6px;
- }
- .pm-list li::before{
- content:"▸";position:absolute;left:2px;color:var(--accent);font-weight:700;
- }
- .pm-tags{display:flex;flex-wrap:wrap;gap:6px}
- .pm-tag{
- font-family:var(--font-sans);
- background:var(--accent-dim);color:var(--accent-deep);
- padding:4px 10px;border-radius:100px;font-size:11px;font-weight:600;
- }
- .pm-indices-table{
- width:100%;border-collapse:collapse;font-size:11.5px;
- background:#fff;border:1px solid var(--border);border-radius:6px;overflow:hidden;
- }
- .pm-indices-table th{
- background:var(--accent-dim);color:var(--accent-deep);
- font-family:var(--font-sans);font-weight:700;
- padding:8px 12px;text-align:left;font-size:10.5px;letter-spacing:.5px;text-transform:uppercase;
- }
- .pm-indices-table td{
- padding:8px 12px;border-top:1px solid var(--border);
- color:var(--text);font-family:var(--font-sans);
- }
- .pm-indices-table td:first-child{font-weight:600;color:var(--text)}
- .pm-partner-box{
- background:linear-gradient(135deg,#FFF8E7 0%,#FFFEF9 100%);
- border:1px solid var(--border);border-left:4px solid var(--accent);
- border-radius:6px;padding:12px 16px;
- font-family:var(--font-sans);font-size:12.5px;color:var(--text);line-height:1.7;
- }
- .pm-partner-box .pm-partner-label{
- font-size:10.5px;color:var(--accent-deep);letter-spacing:1px;
- text-transform:uppercase;font-weight:700;margin-bottom:4px;
- }
- .pm-partner-box .pm-partner-name{font-weight:700;color:var(--text);font-size:13.5px}
- .pm-notes{
- font-family:var(--font-sans);
- font-size:11.5px;color:var(--text-dim);line-height:1.7;
- background:var(--bg);padding:10px 14px;border-radius:6px;
- }
- .pm-footer{
- border-top:1px solid var(--border);padding:16px 36px;
- display:flex;justify-content:flex-end;gap:10px;
- background:var(--bg);
- }
- .pm-btn{
- padding:9px 22px;border-radius:6px;font-size:13px;font-weight:600;
- cursor:pointer;border:1px solid var(--border);background:#fff;color:var(--text-dim);
- font-family:var(--font-sans);transition:all .15s;
- }
- .pm-btn:hover{border-color:var(--accent);color:var(--accent)}
- .pm-btn.primary{background:var(--accent);color:#fff;border-color:var(--accent)}
- .pm-btn.primary:hover{background:var(--accent-deep)}
- @media(max-width:768px){
- .pm-grid-2{grid-template-columns:1fr}
- .pm-header{padding:24px 24px 20px}
- .pm-body,.pm-footer{padding:20px 24px}
- }
- /* === Phase 3 · 打印样式 === */
- @media print {
- body{background:#fff !important}
- .topbar,.ctx-bar,.calc-row,.back-link,.ah-nav-btn,.btn,.ctx-btn,
- .form-grid,.section-head:not(#planning-life){display:none !important}
- #result{display:block !important;border:none;padding:0;margin:0}
- .container{padding:20px;max-width:100%}
- .policy-card{break-inside:avoid;page-break-inside:avoid;
- box-shadow:none !important;transform:none !important}
- .policy-card.life.hnw-mode{break-after:page}
- .gap-chart-section,.product-section,.uhnw-card,.affordability-section,.wealth-picture-section{break-inside:avoid}
- .result-cover{background:#1A0F05 !important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
- .product-tab,.life-track-tab{display:none}
- .product-pane,.life-track-pane{display:block !important}
- .footer{font-size:9px}
- }
- @media(max-width:768px){
- .gap-row{grid-template-columns:80px 1fr 80px;gap:8px}
- }
- /* === Footer === */
- .footer{margin-top:40px;padding-top:24px;border-top:1px solid var(--border);
- text-align:center;font-size:11px;color:var(--text-dim);line-height:1.7;opacity:.85}
- .footer .disclaimer{margin-top:8px;font-size:11px;opacity:.75}
- /* 响应式 */
- @media(max-width:768px){
- .container{padding:20px 16px 40px}
- .hero h1{font-size:1.8rem}
- .form-grid{grid-template-columns:1fr}
- .policy-grid{grid-template-columns:1fr}
- .rc-summary{grid-template-columns:repeat(2,1fr)}
- }
- </style>
- <style id="v01-hero-css">
- /* --- 移植:hero容器+light!important覆盖 (源行1502-1567) --- */
- .v01-hero{padding:48px 64px 24px;max-width:1440px;margin:0 auto;color:#F5E6B8;position:relative;z-index:1}
- /* [v0.1 · 2026-06-27] Hero 卡片集群外侧 · 全宽白色横带 · 增强层次感
- 用 box-shadow + clip-path 让白带从浏览器左到右,Hero 内容居中悬浮其上
- Hero 内部所有卡片同时套用 light-theme 样式以适配白底 */
- .v01-hero{
- background:#FFFFFF;
- box-shadow:0 0 0 100vmax #FFFFFF;
- clip-path:inset(0 -100vmax);
- color:#1A0F05
- }
- .v01-hero .v01-hero-title{color:#9B7C3A !important}
- .v01-hero .v01-hero-headline{color:#1A0F05 !important}
- .v01-hero .v01-hero-headline em{color:#9B7C3A !important}
- /* Hero 内 · rings-wrap 强制 light · 在白底上仍有圆润卡片感 */
- .v01-hero .v01-rings-wrap{
- background:rgba(250,247,238,0.85) !important;
- border:1px solid rgba(155,124,58,.20) !important
- }
- .v01-hero .v01-rings-title{color:#1A0F05 !important}
- .v01-hero .v01-rings-perspective{color:rgba(122,96,40,.7) !important}
- .v01-hero .v01-rings-subtitle{color:rgba(61,41,20,.55) !important}
- .v01-hero .v01-ring-tile-track{stroke:rgba(155,124,58,.15) !important}
- .v01-hero .v01-ring-tile:hover{background:rgba(155,124,58,.06) !important}
- /* Hero 内 · KPI 强制 light */
- .v01-hero .v01-kpi{
- background:rgba(250,247,238,0.85) !important;
- border:1px solid rgba(155,124,58,.22) !important;
- color:#3D2914 !important
- }
- .v01-hero .v01-kpi-label{color:rgba(122,96,40,.7) !important}
- .v01-hero .v01-kpi-value{color:#1A0F05 !important}
- .v01-hero .v01-kpi-sub{color:rgba(61,41,20,.62) !important}
- .v01-hero .v01-kpi-icon{filter:none}
- /* Hero 内 · vis-card 强制 light */
- .v01-hero .v01-vis-card{
- background:rgba(250,247,238,0.85) !important;
- border:1px solid rgba(155,124,58,.20) !important
- }
- .v01-hero .v01-vis-title{color:#1A0F05 !important}
- .v01-hero .v01-vis-body{color:#3D2914 !important}
- .v01-hero .v01-vis-foot{
- color:rgba(61,41,20,.55) !important;
- border-top:1px dashed rgba(155,124,58,.18) !important
- }
- /* mini-tri cells */
- .v01-hero .v01-mini-tri-cell{background:rgba(155,124,58,.06) !important}
- .v01-hero .v01-mini-tri-cell.is-aff{background:rgba(45,179,124,.10) !important}
- .v01-hero .v01-mini-tri-cell.is-custom{background:rgba(122,63,160,.08) !important}
- .v01-hero .v01-mini-tri-label{color:rgba(61,41,20,.65) !important}
- .v01-hero .v01-mini-tri-num{color:#3D2914 !important}
- /* emergency mini */
- .v01-hero .v01-mini-emerg-num{color:#1A0F05 !important}
- .v01-hero .v01-mini-emerg-unit{color:rgba(61,41,20,.55) !important}
- .v01-hero .v01-mini-emerg-bar{background:rgba(155,124,58,.10) !important}
- .v01-hero .v01-mini-emerg-scale{color:rgba(61,41,20,.50) !important}
- .v01-hero-title{font-size:13px;letter-spacing:3px;color:rgba(201,168,76,.7);
- text-transform:uppercase;margin-bottom:8px;font-weight:600}
- .v01-hero-headline{font-size:32px;font-family:'Cormorant Garamond','Noto Serif SC',serif;
- font-weight:700;color:#F5E6B8;margin:0 0 32px;letter-spacing:.5px;line-height:1.2}
- .v01-hero-headline em{color:#C9A84C;font-style:italic}
- /* --- 移植:popover (源行1570-1635) --- */
- .v01-ring-popover-overlay{position:fixed;inset:0;z-index:200;
- background:rgba(0,0,0,.5);backdrop-filter:blur(6px);
- display:none;align-items:center;justify-content:center;padding:24px;
- animation:v01PopOverlayIn .2s ease-out}
- .v01-ring-popover-overlay.is-open{display:flex}
- @keyframes v01PopOverlayIn{from{opacity:0}to{opacity:1}}
- .v01-ring-popover{max-width:560px;width:100%;background:linear-gradient(180deg,#FAF8F2,#F5EFE0);
- border:1px solid rgba(155,124,58,.30);border-radius:14px;padding:32px;
- box-shadow:0 24px 64px rgba(0,0,0,.35);position:relative;
- animation:v01PopIn .25s cubic-bezier(.4,0,.2,1);color:#3D2914;
- font-family:'Noto Sans SC',sans-serif}
- @keyframes v01PopIn{from{opacity:0;transform:translateY(20px) scale(.96)}to{opacity:1;transform:translateY(0) scale(1)}}
- .v01-pop-close{position:absolute;top:14px;right:18px;width:32px;height:32px;
- border-radius:50%;background:transparent;border:1px solid rgba(155,124,58,.30);
- color:#9B7C3A;font-size:18px;line-height:1;cursor:pointer;
- display:flex;align-items:center;justify-content:center;transition:all .15s}
- .v01-pop-close:hover{background:rgba(155,124,58,.10);border-color:#9B7C3A}
- .v01-pop-icon{font-size:36px;margin-bottom:8px}
- .v01-pop-label{font-size:11px;letter-spacing:2.5px;color:rgba(122,96,40,.65);
- text-transform:uppercase;font-weight:700;margin-bottom:4px}
- .v01-pop-title{font-size:24px;font-family:'Cormorant Garamond','Noto Serif SC',serif;
- font-weight:700;color:#3D2914;margin-bottom:6px;letter-spacing:.3px}
- .v01-pop-score-row{display:flex;align-items:baseline;gap:12px;margin:14px 0 18px;
- padding:12px 16px;background:rgba(155,124,58,.06);border-radius:8px;border:1px solid rgba(155,124,58,.20)}
- .v01-pop-score-num{font-size:2.4rem;font-family:'Cormorant Garamond',serif;font-weight:700;
- font-feature-settings:'lnum','tnum';color:#9B7C3A;line-height:1}
- .v01-pop-score-unit{font-size:14px;color:rgba(122,96,40,.6)}
- .v01-pop-score-status{margin-left:auto;font-size:13px;color:#9B7C3A;font-weight:600}
- .v01-pop-section{margin-bottom:18px}
- .v01-pop-section-label{font-size:11px;letter-spacing:1.5px;color:rgba(122,96,40,.7);
- text-transform:uppercase;font-weight:700;margin-bottom:8px}
- .v01-pop-formula{padding:12px 16px;background:#FFFBEC;border-left:3px solid #C9A84C;
- border-radius:0 6px 6px 0;font-family:'Cormorant Garamond',serif;font-size:14.5px;
- color:#3D2914;line-height:1.7;font-feature-settings:'lnum','tnum'}
- .v01-pop-formula strong{color:#9B7C3A;font-weight:700}
- .v01-pop-text{font-size:13.5px;line-height:1.75;color:#3D2914}
- .v01-pop-text strong{color:#9B7C3A}
- .v01-pop-actions{margin-top:20px;display:flex;gap:10px;flex-wrap:wrap}
- .v01-pop-action-btn{padding:10px 18px;border-radius:8px;font-size:12.5px;
- font-family:'Noto Sans SC',sans-serif;font-weight:600;letter-spacing:.5px;cursor:pointer;
- border:1px solid rgba(155,124,58,.35);background:transparent;color:#3D2914;
- transition:all .15s}
- .v01-pop-action-btn:hover{background:rgba(155,124,58,.08);border-color:#9B7C3A}
- .v01-pop-action-btn.is-primary{background:#9B7C3A;color:#FAF8F2;border-color:#9B7C3A}
- .v01-pop-action-btn.is-primary:hover{background:#7A6028}
- /* 深色版 popup */
- body.v01-light:not(.theme-light) .v01-ring-popover{
- background:linear-gradient(180deg,#2C1B0E,#1A0F05);color:#F5E6B8;
- border-color:rgba(201,168,76,.30)}
- body.v01-light:not(.theme-light) .v01-pop-close{color:#C9A84C;border-color:rgba(201,168,76,.30)}
- body.v01-light:not(.theme-light) .v01-pop-close:hover{background:rgba(201,168,76,.12);border-color:#C9A84C}
- body.v01-light:not(.theme-light) .v01-pop-label{color:rgba(201,168,76,.65)}
- body.v01-light:not(.theme-light) .v01-pop-title{color:#F5E6B8}
- body.v01-light:not(.theme-light) .v01-pop-score-row{background:rgba(201,168,76,.08);border-color:rgba(201,168,76,.20)}
- body.v01-light:not(.theme-light) .v01-pop-score-num{color:#C9A84C}
- body.v01-light:not(.theme-light) .v01-pop-score-unit{color:rgba(201,168,76,.6)}
- body.v01-light:not(.theme-light) .v01-pop-score-status{color:#C9A84C}
- body.v01-light:not(.theme-light) .v01-pop-section-label{color:rgba(201,168,76,.7)}
- body.v01-light:not(.theme-light) .v01-pop-formula{background:rgba(201,168,76,.08);color:#F5E6B8}
- body.v01-light:not(.theme-light) .v01-pop-formula strong{color:#C9A84C}
- body.v01-light:not(.theme-light) .v01-pop-text{color:#F5E6B8}
- body.v01-light:not(.theme-light) .v01-pop-text strong{color:#C9A84C}
- body.v01-light:not(.theme-light) .v01-pop-action-btn{color:#F5E6B8;border-color:rgba(201,168,76,.35)}
- body.v01-light:not(.theme-light) .v01-pop-action-btn:hover{background:rgba(201,168,76,.10);border-color:#C9A84C}
- body.v01-light:not(.theme-light) .v01-pop-action-btn.is-primary{background:#C9A84C;color:#1A0F05;border-color:#C9A84C}
- /* --- 移植:grid+左列+三环 (源行1637-1705) --- */
- /* === Hero 主网格:左 三环+3KPI / 右 4 mini · [v0.1.5] 左右等高 === */
- .v01-hero-grid{display:grid;grid-template-columns:540px 1fr;gap:32px;align-items:stretch}
- @media (max-width:1200px){.v01-hero-grid{grid-template-columns:1fr;gap:24px}}
- .v01-left-col{display:flex;flex-direction:column}
- .v01-left-col > .v01-rings-wrap{flex:1 1 auto} /* 三环卡撑满左列剩余高度 */
- /* === [v0.1.3] 三环卡片:Whoop 三环风格 + 视角切换 === */
- .v01-rings-wrap{position:relative;background:rgba(255,255,255,.03);border:1px solid rgba(201,168,76,.18);
- border-radius:18px;padding:24px 14px;backdrop-filter:blur(8px)}
- .v01-rings-head{display:flex;align-items:baseline;justify-content:space-between;margin-bottom:18px;
- padding:0 4px}
- .v01-rings-perspective{font-size:11.5px;letter-spacing:2px;color:rgba(201,168,76,.7);
- text-transform:uppercase;font-weight:600}
- .v01-rings-subtitle{font-size:10.5px;color:rgba(245,230,184,.55);
- font-family:'Cormorant Garamond',serif;font-style:italic;letter-spacing:.5px}
- .v01-rings-row{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
- .v01-ring-tile{display:flex;flex-direction:column;align-items:center;
- padding:8px 2px;border-radius:10px;transition:background .2s;cursor:pointer;min-width:0}
- .v01-ring-tile:hover{background:rgba(201,168,76,.06)}
- .v01-ring-tile-canvas{width:100%;max-width:148px;aspect-ratio:1;position:relative}
- .v01-ring-tile-canvas svg{width:100%;height:100%;transform:rotate(-90deg);overflow:visible}
- .v01-ring-tile-track{fill:none;stroke:rgba(201,168,76,.15);stroke-width:11}
- .v01-ring-tile-progress{fill:none;stroke-width:11;stroke-linecap:round;
- transition:stroke-dashoffset 1.0s cubic-bezier(.4,0,.2,1)}
- .v01-ring-tile-text{position:absolute;inset:0;display:flex;flex-direction:column;
- align-items:center;justify-content:center;text-align:center}
- .v01-ring-tile-icon{font-size:18px;margin-bottom:2px;opacity:.85}
- .v01-ring-tile-num{font-size:2.6rem;font-family:'Cormorant Garamond',serif;
- font-weight:600;line-height:1;color:#F5E6B8;font-feature-settings:'lnum','tnum'}
- .v01-ring-tile-unit{font-size:.85rem;color:rgba(201,168,76,.5);margin-top:-2px;letter-spacing:1.5px}
- .v01-ring-tile-label{margin-top:10px;font-size:11.5px;color:#C9A84C;font-weight:700;
- letter-spacing:1px;text-align:center}
- .v01-ring-tile-status{margin-top:4px;font-size:10.5px;color:rgba(245,230,184,.6);
- text-align:center;line-height:1.3;min-height:14px}
- /* 浅色版三环 */
- body.v01-light.theme-light .v01-rings-wrap{background:rgba(255,255,255,.6);border:1px solid rgba(155,124,58,.20)}
- body.v01-light.theme-light .v01-rings-perspective{color:rgba(122,96,40,.7)}
- body.v01-light.theme-light .v01-rings-subtitle{color:rgba(61,41,20,.55)}
- body.v01-light.theme-light .v01-ring-tile:hover{background:rgba(155,124,58,.06)}
- body.v01-light.theme-light .v01-ring-tile-track{stroke:rgba(155,124,58,.15)}
- body.v01-light.theme-light .v01-ring-tile-num{color:#3D2914}
- body.v01-light.theme-light .v01-ring-tile-unit{color:rgba(155,124,58,.55)}
- body.v01-light.theme-light .v01-ring-tile-label{color:#9B7C3A}
- body.v01-light.theme-light .v01-ring-tile-status{color:rgba(61,41,20,.6)}
- /* === 视角切换器(顶栏右侧)=== */
- .v01-perspective-switcher{display:inline-flex;align-items:center;gap:0;
- background:rgba(255,255,255,.04);border:1px solid rgba(201,168,76,.25);
- border-radius:8px;padding:3px;font-family:'Noto Sans SC',sans-serif}
- .v01-perspective-btn{padding:6px 11px;border-radius:6px;font-size:11px;
- background:transparent;color:rgba(201,168,76,.7);border:none;cursor:pointer;
- transition:all .15s;letter-spacing:.3px;white-space:nowrap;display:inline-flex;
- align-items:center;gap:4px}
- .v01-perspective-btn:hover{color:#C9A84C;background:rgba(201,168,76,.08)}
- .v01-perspective-btn.is-active{background:linear-gradient(135deg,#C9A84C,#9B7C3A);
- color:#1A0F05;font-weight:700}
- body.v01-light.theme-light .v01-perspective-switcher{background:rgba(255,255,255,.5);border-color:rgba(155,124,58,.30)}
- body.v01-light.theme-light .v01-perspective-btn{color:rgba(122,96,40,.7)}
- body.v01-light.theme-light .v01-perspective-btn:hover{color:#9B7C3A;background:rgba(155,124,58,.08)}
- body.v01-light.theme-light .v01-perspective-btn.is-active{background:linear-gradient(135deg,#C9A84C,#9B7C3A);color:#FAF8F2}
- /* 移动端折叠 */
- @media (max-width:900px){
- .v01-rings-row{grid-template-columns:1fr}
- .v01-ring-tile-canvas{width:140px;height:140px}
- .v01-perspective-switcher{flex-wrap:wrap}
- .v01-perspective-btn{font-size:10px;padding:5px 9px}
- }
- /* --- 移植:3KPI (源行1748-1769) --- */
- .v01-kpi-row{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-top:18px}
- .v01-kpi{background:rgba(255,255,255,.03);border:1px solid rgba(201,168,76,.18);
- border-radius:12px;padding:18px 16px;cursor:pointer;transition:all .2s;position:relative}
- .v01-kpi:hover{background:rgba(255,255,255,.06);border-color:rgba(201,168,76,.4);
- transform:translateY(-2px)}
- .v01-kpi-icon{font-size:18px;margin-bottom:6px;opacity:.8}
- .v01-kpi-label{font-size:10.5px;letter-spacing:1.5px;color:rgba(201,168,76,.65);
- text-transform:uppercase;margin-bottom:6px;font-weight:600}
- .v01-kpi-value{font-size:1.95rem;font-family:'Cormorant Garamond',serif;
- font-weight:700;color:#F5E6B8;line-height:1.05;font-feature-settings:'lnum','tnum';
- font-variant-numeric:tabular-nums}
- .v01-kpi-sub{font-size:10.5px;color:rgba(245,230,184,.55);margin-top:6px}
- .v01-kpi-arrow{position:absolute;top:16px;right:16px;color:rgba(201,168,76,.45);font-size:14px;
- transition:transform .2s}
- .v01-kpi:hover .v01-kpi-arrow{transform:translate(2px,-2px);color:#C9A84C}
- /* KPI 配色 · 沿用 v4.7 维度色 */
- .v01-kpi-gap .v01-kpi-value{color:#F5C988}
- .v01-kpi-gap .v01-kpi-icon{color:#E5A654}
- .v01-kpi-leverage .v01-kpi-value{color:#A0E0B5}
- .v01-kpi-leverage .v01-kpi-icon{color:#5EE0A0}
- .v01-kpi-cost .v01-kpi-value{color:#F5B0A8}
- .v01-kpi-cost .v01-kpi-icon{color:#E87070}
- /* --- 移植:4mini (源行1771-1836) --- */
- /* === 4 mini 可视化 2x2 === */
- /* === 4 mini 可视化 2x2 · [v0.1.5] 撑满右列高度,与左列等高 === */
- .v01-vis-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;align-content:stretch;height:100%}
- .v01-vis-card{background:rgba(255,255,255,.03);border:1px solid rgba(201,168,76,.18);
- border-radius:14px;padding:18px;cursor:pointer;transition:all .2s;
- min-height:200px;display:flex;flex-direction:column;position:relative}
- .v01-vis-card:hover{background:rgba(255,255,255,.06);border-color:rgba(201,168,76,.4)}
- .v01-vis-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
- .v01-vis-icon{font-size:18px}
- .v01-vis-title{font-size:12px;letter-spacing:1.5px;color:#C9A84C;font-weight:700;
- text-transform:uppercase;flex:1;margin-left:8px}
- .v01-vis-arrow{color:rgba(201,168,76,.45);font-size:13px;transition:transform .2s}
- .v01-vis-card:hover .v01-vis-arrow{transform:translate(2px,-2px);color:#C9A84C}
- .v01-vis-body{flex:1;display:flex;align-items:center;justify-content:center;
- color:rgba(245,230,184,.85);font-size:11px;text-align:center;line-height:1.6}
- .v01-vis-foot{font-size:10.5px;color:rgba(245,230,184,.55);margin-top:8px;
- padding-top:8px;border-top:1px dashed rgba(201,168,76,.15)}
- /* mini 风险金字塔 SVG */
- .v01-mini-pyramid{width:100%;max-width:200px;height:120px}
- /* mini 现金流 Canvas */
- .v01-mini-cashflow{width:100%;max-width:240px;height:110px;display:block;margin:0 auto}
- /* mini 三轨表 · 3 数字横排 */
- .v01-mini-tri{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;width:100%}
- .v01-mini-tri-cell{padding:10px 6px;border-radius:8px;background:rgba(255,255,255,.04);
- text-align:center}
- .v01-mini-tri-cell.is-aff{background:rgba(201,168,76,.10);border:1px solid rgba(201,168,76,.3)}
- .v01-mini-tri-cell.is-custom{background:rgba(43,108,176,.10);border:1px solid rgba(43,108,176,.3)}
- .v01-mini-tri-label{font-size:9.5px;letter-spacing:1px;color:rgba(201,168,76,.7);
- margin-bottom:4px;text-transform:uppercase}
- .v01-mini-tri-num{font-size:1.15rem;font-family:'Cormorant Garamond',serif;
- font-weight:700;color:#F5E6B8;font-feature-settings:'lnum','tnum'}
- /* mini 杠杆 KPI · 单一大数字 */
- .v01-mini-leverage{text-align:center;width:100%}
- .v01-mini-lev-num{font-size:3.4rem;font-family:'Cormorant Garamond',serif;
- font-weight:700;color:#A0E0B5;line-height:1;font-feature-settings:'lnum','tnum'}
- .v01-mini-lev-x{font-size:1.4rem;color:rgba(201,168,76,.6);margin-left:4px}
- .v01-mini-lev-bar{margin-top:14px;height:6px;border-radius:3px;
- background:rgba(255,255,255,.08);overflow:hidden;position:relative}
- .v01-mini-lev-fill{height:100%;background:linear-gradient(90deg,#5EE0A0,#A0E0B5);
- border-radius:3px;transition:width 1s ease-out}
- .v01-mini-lev-scale{margin-top:6px;display:flex;justify-content:space-between;
- font-size:9.5px;color:rgba(201,168,76,.5)}
- /* [v0.1.6] mini 应急储备健康度 · 替换风险对冲 KPI(避免与保障杠杆 3 KPI 重复)*/
- .v01-mini-emergency{text-align:center;width:100%}
- .v01-mini-emerg-num{font-size:3.4rem;font-family:'Cormorant Garamond',serif;
- font-weight:700;color:#5EE0A0;line-height:1;font-feature-settings:'lnum','tnum'}
- .v01-mini-emerg-unit{font-size:1.4rem;color:rgba(201,168,76,.6);margin-left:6px}
- .v01-mini-emerg-bar{margin-top:14px;height:6px;border-radius:3px;
- background:rgba(255,255,255,.08);overflow:hidden;position:relative}
- .v01-mini-emerg-bar::before{content:"";position:absolute;left:25%;top:0;width:1px;height:100%;
- background:rgba(201,168,76,.5);z-index:1} /* 6月健康线 */
- .v01-mini-emerg-bar::after{content:"";position:absolute;left:50%;top:0;width:1px;height:100%;
- background:rgba(201,168,76,.5);z-index:1} /* 12月健康线 */
- .v01-mini-emerg-fill{height:100%;background:linear-gradient(90deg,#E87070,#E89B3D,#5EE0A0);
- border-radius:3px;transition:width 1s ease-out}
- .v01-mini-emerg-scale{margin-top:6px;display:flex;justify-content:space-between;
- font-size:9.5px;color:rgba(201,168,76,.5)}
- body.v01-light.theme-light .v01-mini-emerg-num{color:#1F7A4D}
- body.v01-light.theme-light .v01-mini-emerg-unit{color:rgba(155,124,58,.55)}
- body.v01-light.theme-light .v01-mini-emerg-bar{background:rgba(155,124,58,.10)}
- body.v01-light.theme-light .v01-mini-emerg-scale{color:rgba(155,124,58,.55)}
- /* --- 移植:入场动画stagger(引用已存在的v01fcFadeUp) (源行2260-2269) --- */
- .v01-hero .v01-rings-wrap{
- animation:v01fcFadeUp .65s cubic-bezier(.2,.7,.3,1) .20s both
- }
- .v01-hero .v01-kpi:nth-child(1){animation:v01fcFadeUp .55s cubic-bezier(.2,.7,.3,1) .35s both}
- .v01-hero .v01-kpi:nth-child(2){animation:v01fcFadeUp .55s cubic-bezier(.2,.7,.3,1) .45s both}
- .v01-hero .v01-kpi:nth-child(3){animation:v01fcFadeUp .55s cubic-bezier(.2,.7,.3,1) .55s both}
- .v01-hero .v01-vis-grid > .v01-vis-card:nth-child(1){animation:v01fcFadeUp .55s cubic-bezier(.2,.7,.3,1) .30s both}
- .v01-hero .v01-vis-grid > .v01-vis-card:nth-child(2){animation:v01fcFadeUp .55s cubic-bezier(.2,.7,.3,1) .40s both}
- .v01-hero .v01-vis-grid > .v01-vis-card:nth-child(3){animation:v01fcFadeUp .55s cubic-bezier(.2,.7,.3,1) .50s both}
- .v01-hero .v01-vis-grid > .v01-vis-card:nth-child(4){animation:v01fcFadeUp .55s cubic-bezier(.2,.7,.3,1) .60s both}
- /* ══════ [2026-07-12 移植] 体检报告 Hero (第5 Tab) · 白底浅色版 ══════ */
- /* 中和源 .v01-hero 的 100vmax 全宽出血 + 居中 max-width, 让其在 Tab 面板内左对齐填满 */
- .ic-tab-panel .v01-hero{box-shadow:none!important;clip-path:none!important;max-width:none!important;margin:0!important;padding:8px 0 0!important}
- </style>
- <style id="fav-module-css">
- /* ══════ [2026-07-12 移植自 FAV v0.1] 家族保单(01) + 生命周期/水位金字塔(02) ══════ */
- .fav-family-policies, .fav-lifecycle-block, .fav-pyramid-block, .pcc-tier-detail, #pccTierRows {
- --bg-warm-1:#F2F3EF; --bg-warm-2:#E9EAE4;
- --card:#FFFFFF; --card-hover:#F7F8F5;
- --border:#E4E5DF; --border-mid:#C8C9C0;
- --gold:#9B7C3A; --gold-2:#B89A52; --gold-3:#C8AB60; --gold-soft:rgba(155,124,58,0.08);
- --ink:#12100B;
- --text-primary:#0F0E0C; --text-secondary:#4A4640; --text-tertiary:#8B8478; --text-muted:#B5AE9F;
- --green:#2D6A4F; --amber:#8B7030; --red:#8B3030; --blue:#2D4A6A; --blue-soft:rgba(45,74,106,0.10);
- --r-sm:4px; --r-md:8px; --r-lg:12px; --r-xl:16px;
- --shadow-sm:0 1px 2px rgba(15,14,12,0.04); --shadow-md:0 2px 8px rgba(15,14,12,0.06); --shadow-lg:0 8px 28px rgba(15,14,12,0.10);
- --font-serif:'Cormorant Garamond','Noto Serif SC',Georgia,serif;
- }
- .fav-sec-head{font-family:var(--font-serif);font-size:1.15rem;font-weight:700;color:#1A0F05;margin-bottom:14px;padding-bottom:10px;border-bottom:1px solid rgba(155,124,58,.18)}
- .fav-sec-head .num{color:#9B7C3A;font-size:.8rem;margin-right:8px}
- .fav-note{font-size:.68rem;color:#8B8478;margin-top:10px;line-height:1.6}
- .fav-lifecycle-block,.fav-pyramid-block{margin-top:22px;padding-top:20px;border-top:1px dashed rgba(155,124,58,.20)}
- .member-pills { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-bottom:16px; }
- .member-pills .label { font-size:.7rem; color:var(--text-tertiary); letter-spacing:.06em; margin-right:2px; }
- .m-pill { font-size:.75rem; padding:6px 15px; border:1px solid var(--border-mid); border-radius:99px; background:none; color:var(--text-secondary); cursor:pointer; transition:all .18s; font-family:var(--font-sans); }
- .m-pill:hover { border-color:var(--gold); color:var(--gold); }
- .m-pill.active { background:linear-gradient(135deg,var(--gold-3),var(--gold)); color:#fff; border-color:var(--gold); font-weight:500; }
- .member-desc { font-size:.74rem; color:var(--text-secondary); margin-bottom:16px; padding:9px 15px; background:var(--gold-soft); border-radius:var(--r-md); border-left:2px solid var(--gold); }
- /* ── 保单表 ── */
- .policy-table { width:100%; border-collapse:collapse; background:var(--card); border:1px solid var(--border); border-radius:var(--r-lg); overflow:hidden; box-shadow:var(--shadow-sm); }
- .policy-table th { background:var(--bg-warm-1); font-size:.7rem; color:var(--text-secondary); text-align:left; padding:11px 14px; letter-spacing:.04em; font-weight:600; border-bottom:1px solid var(--border); }
- .policy-table td { padding:11px 14px; font-size:.78rem; border-bottom:1px solid var(--border); color:var(--text-secondary); }
- .policy-table tr:last-child td { border-bottom:none; }
- .policy-table tr:hover td { background:var(--card-hover); }
- .tag { display:inline-block; font-size:.64rem; padding:2px 8px; border-radius:99px; font-weight:500; }
- .tag-trust { background:var(--gold-soft); color:var(--gold); border:1px solid var(--gold-2); }
- .tag-lc { background:var(--blue-soft); color:var(--blue); }
- .num-cell { font-family:var(--font-serif); font-weight:600; color:var(--text-primary); }
- /* ── 视图切换 ── */
- .view-switch { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:18px; }
- .vs-tab { font-size:.76rem; padding:8px 16px; border:1px solid var(--border-mid); border-radius:var(--r-md); background:var(--card); color:var(--text-secondary); cursor:pointer; transition:all .18s; font-family:var(--font-sans); font-weight:500; }
- .vs-tab:hover { border-color:var(--gold); color:var(--gold); }
- .vs-tab.active { background:var(--ink); color:#fff; border-color:var(--ink); }
- .vs-hint { font-size:.68rem; color:var(--text-muted); font-style:italic; margin-left:4px; }
- /* ── 生命周期两阶段 ── */
- .lc-track { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
- .lc-stage { background:var(--card); border:1px solid var(--border); border-radius:var(--r-lg); padding:20px 22px; box-shadow:var(--shadow-sm); position:relative; }
- .lc-stage h3 { font-family:var(--font-serif); font-size:1.15rem; font-weight:600; margin-bottom:2px; }
- .lc-stage .lc-en { font-size:.62rem; letter-spacing:.14em; text-transform:uppercase; color:var(--gold); margin-bottom:6px; }
- .lc-stage .lc-needs-note { font-size:.66rem; color:var(--text-tertiary); margin-bottom:14px; padding-bottom:10px; border-bottom:1px solid var(--border); }
- /* ── 金字塔视图 ── */
- .pyr-wrap { display:grid; grid-template-columns:minmax(280px,1fr) 1.1fr; gap:24px; align-items:start; background:var(--card); border:1px solid var(--border); border-radius:var(--r-lg); padding:22px 24px; box-shadow:var(--shadow-sm); }
- .pyr-svg-col { position:relative; display:flex; align-items:center; justify-content:center; align-self:stretch; }
- .fav-pyramid-svg { width:100%; max-width:420px; height:auto; }
- /* 水位开关(平移自 PolicySummary v1.2 · 左上角香槟金 pill) */
- .pyr-controls { position:absolute; top:0; left:0; z-index:10; display:flex; flex-direction:column; gap:4px; }
- .pc-toggle { display:inline-flex; align-items:center; gap:5px; padding:4px 10px; border-radius:100px; font-size:10px; font-weight:700; letter-spacing:.3px; font-family:var(--font-sans); background:rgba(255,255,255,.92); border:1px solid rgba(201,168,76,.45); color:#9B7C3A; cursor:pointer; transition:all .2s; box-shadow:0 1px 4px rgba(60,50,30,.10); user-select:none; white-space:nowrap; }
- .pc-toggle:hover { background:rgba(252,247,235,.98); border-color:rgba(201,168,76,.75); transform:translateY(-1px); }
- .pc-toggle[data-on="0"] { background:rgba(0,0,0,.04); border-color:rgba(0,0,0,.12); color:#999; }
- .pc-toggle[data-on="0"]:hover { background:rgba(0,0,0,.08); color:#666; }
- .pc-toggle .tg-dot { width:6px; height:6px; border-radius:50%; background:#C9A84C; box-shadow:0 0 4px rgba(201,168,76,.6); }
- .pc-toggle[data-on="0"] .tg-dot { background:#bbb; box-shadow:none; }
- .pyr-gap-col { display:flex; flex-direction:column; gap:14px; }
- .pyr-note { font-size:.68rem; color:var(--text-tertiary); padding-bottom:10px; border-bottom:1px solid var(--border); font-style:italic; }
- /* 风险三分组 · 彩色 capsule 头 + 左侧色条 */
- .rtier-group { background:var(--rt-bg); border:1px solid var(--rt-bd); border-radius:var(--r-lg); padding:12px 14px; overflow:hidden; }
- .rtier-cap { display:inline-flex; align-items:center; gap:8px; margin-bottom:10px; }
- .rtier-name { font-size:.72rem; font-weight:700; color:#fff; background:var(--rt-c); padding:3px 12px; border-radius:99px; letter-spacing:.05em; }
- .rtier-desc { font-size:.66rem; color:var(--rt-c); font-weight:600; }
- .rtier-group .gap-list { gap:8px; }
- /* [2026-07-16] 上方金字塔(#pccTierRows)专属:头部可点折叠,险种明细默认隐藏 */
- #pccTierRows .rtier-cap { cursor:pointer; user-select:none; margin-bottom:0; width:100%; }
- #pccTierRows .rtier-caret { font-size:.7rem; color:var(--rt-c); transition:transform .2s; flex-shrink:0; }
- #pccTierRows .rtier-group.is-open .rtier-caret { transform:rotate(90deg); }
- #pccTierRows .rtier-body { max-height:0; overflow:hidden; transition:max-height .3s ease; }
- #pccTierRows .rtier-group.is-open .rtier-body { max-height:600px; margin-top:10px; }
- /* 该层聚合覆盖率进度条(折叠时也常显在头部) */
- #pccTierRows .rtier-cov { display:flex; align-items:center; gap:8px; margin-left:auto; min-width:100px; flex-shrink:0; }
- #pccTierRows .rtier-cov-bar { flex:1; height:6px; background:rgba(0,0,0,.06); border-radius:99px; overflow:hidden; min-width:44px; }
- #pccTierRows .rtier-cov-fill { height:100%; border-radius:99px; background:var(--rt-c); transition:width .8s ease; }
- #pccTierRows .rtier-cov-pct { font-family:var(--font-mono,monospace); font-size:.72rem; font-weight:700; color:var(--rt-c); min-width:32px; text-align:right; }
- /* 信托架构 capsule(生命周期 Stage2 · 家族信托为父 · 大额保单为子缩进注入) */
- .trust-cap { margin-top:14px; background:rgba(122,63,160,.06); border:1px solid rgba(122,63,160,.30); border-left:3px solid #7A3FA0; border-radius:var(--r-md); padding:12px 14px; }
- .trust-head { display:flex; align-items:center; gap:8px; margin-bottom:10px; flex-wrap:wrap; }
- .trust-name { font-size:.72rem; font-weight:700; color:#fff; background:#7A3FA0; padding:3px 12px; border-radius:99px; letter-spacing:.05em; }
- .trust-desc { font-size:.66rem; color:#7A3FA0; font-weight:600; }
- .trust-cap .gap-list { gap:8px; }
- .trust-child { position:relative; padding-left:20px; }
- .trust-child::before { content:'└'; position:absolute; left:4px; top:2px; color:#9B61C2; font-size:.85rem; font-weight:700; }
- /* ── 缺口条(两视图共用) ── */
- .gap-list { display:flex; flex-direction:column; gap:10px; }
- .gap-row { padding:2px 0; }
- .gap-top { display:flex; justify-content:space-between; align-items:baseline; margin-bottom:6px; gap:8px; }
- .gap-name { font-size:.8rem; font-weight:500; display:flex; align-items:center; gap:6px; }
- .gap-fig { font-size:.7rem; color:var(--text-tertiary); text-align:right; }
- .gap-fig b { font-family:var(--font-serif); font-size:.86rem; }
- .gap-fig .gap-amt { color:var(--red); }
- .gap-fig .gap-amt.ok { color:var(--green); }
- .gap-bar { height:6px; background:var(--bg-warm-2); border-radius:99px; overflow:hidden; }
- .gap-fill { height:100%; border-radius:99px; background:linear-gradient(90deg,var(--green),var(--gold-2)); transition:width .8s ease; }
- .dot-tier { width:7px; height:7px; border-radius:50%; flex-shrink:0; display:inline-block; }
- .tag-ext { background:var(--gold-soft); color:var(--gold); border:1px solid var(--gold-2); }
- .tag-p2 { background:var(--blue-soft); color:var(--blue); }
- /* [2026-07-12 修复] IC 主样式有同名 .gap-row{display:grid;120px 1fr 100px} 会把险种名挤成竖排。
- 在 fav 三容器 + 金字塔明细内作用域覆盖:恢复 FAV 的纵向堆叠布局 + 险种名强制横排不换行。
- [2026-07-16] 追加 #pccTierRows(上方金字塔改用 rtier-group 胶囊卡后同样需覆盖)。 */
- .fav-lifecycle-block .gap-row, .fav-pyramid-block .gap-row, .pcc-tier-detail .gap-row, #pccTierRows .gap-row{
- display:block!important;grid-template-columns:none!important;padding:2px 0!important;border-bottom:none!important;
- }
- .fav-lifecycle-block .gap-top, .fav-pyramid-block .gap-top, .pcc-tier-detail .gap-top, #pccTierRows .gap-top{
- display:flex;justify-content:space-between;align-items:baseline;gap:8px;margin-bottom:6px;
- }
- .fav-lifecycle-block .gap-name, .fav-pyramid-block .gap-name, .pcc-tier-detail .gap-name, #pccTierRows .gap-name{
- white-space:nowrap;flex-shrink:0;
- }
- .fav-lifecycle-block .gap-fig, .fav-pyramid-block .gap-fig, .pcc-tier-detail .gap-fig, #pccTierRows .gap-fig{
- text-align:right;
- }
- </style>
- </head>
- <body>
- <!-- ============================================================== -->
- <!-- v5.0 app-shell 化:常驻侧栏(mode-aware)+ 主内容区 -->
- <!-- 侧栏由 data/cy-sidebar.js 渲染;平台版含 cy-config.js 显示全导航 -->
- <!-- ============================================================== -->
- <div class="cy-app">
- <aside id="cy-sidebar-mount" class="sidebar"></aside>
- <div class="cy-main">
- <!-- 顶栏 -->
- <div class="topbar">
- <div class="brand">
- <div class="brand-logo" aria-label="Benchmark Wealth logo">
- <svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" role="img">
- <defs>
- <linearGradient id="g-wealth-ic" x1="0" y1="0" x2="1" y2="1">
- <stop offset="0%" stop-color="#D97757"/>
- <stop offset="100%" stop-color="#a95d44"/>
- </linearGradient>
- </defs>
- <g fill="url(#g-wealth-ic)">
- <rect x="46" y="6" width="8" height="38" rx="4" transform="rotate(0 50 50)"/>
- <rect x="46" y="6" width="8" height="38" rx="4" transform="rotate(30 50 50)"/>
- <rect x="46" y="6" width="8" height="38" rx="4" transform="rotate(60 50 50)"/>
- <rect x="46" y="6" width="8" height="38" rx="4" transform="rotate(90 50 50)"/>
- <rect x="46" y="6" width="8" height="38" rx="4" transform="rotate(120 50 50)"/>
- <rect x="46" y="6" width="8" height="38" rx="4" transform="rotate(150 50 50)"/>
- <rect x="46" y="6" width="8" height="38" rx="4" transform="rotate(180 50 50)"/>
- <rect x="46" y="6" width="8" height="38" rx="4" transform="rotate(210 50 50)"/>
- <rect x="46" y="6" width="8" height="38" rx="4" transform="rotate(240 50 50)"/>
- <rect x="46" y="6" width="8" height="38" rx="4" transform="rotate(270 50 50)"/>
- <rect x="46" y="6" width="8" height="38" rx="4" transform="rotate(300 50 50)"/>
- <rect x="46" y="6" width="8" height="38" rx="4" transform="rotate(330 50 50)"/>
- </g>
- </svg>
- </div>
- <div class="brand-text">
- <span class="t1">保额计算器 <span class="agent-badge">代理人专用</span></span>
- <span class="t2">INSURANCE CALCULATOR</span>
- </div>
- </div>
- <div class="topbar-right">
- <!-- v3.3.4 · 画像快速切换 dropdown(与 PolicySummary 同源 · vault 全部 CY_PORTRAITS)-->
- <select id="portraitSwitcher" onchange="switchPortrait(this.value)"
- style="padding:6px 12px; border:1px solid var(--gold,#9B7C3A);
- border-radius:6px; background:white; color:var(--gold,#9B7C3A);
- font-size:12px; font-weight:600; font-family:-apple-system,'PingFang SC',sans-serif;
- cursor:pointer; outline:none;">
- <option value="">⇄ 切换画像(共 0)</option>
- </select>
- <button class="ah-nav-btn" onclick="jumpActionHubIC()" title="回客户画像 · ActionHub">⌘ ActionHub</button>
- <a class="back-link" href="javascript:void(0)" onclick="goBackIC()">← 返回</a>
- </div>
- </div>
- <!-- ctx-bar 当前客户 (portrait 自动预填) -->
- <div class="ctx-bar" id="ctxBar">
- <span class="ctx-icon">📌</span>
- <span>当前客户:</span>
- <span class="ctx-name" id="ctxName">--</span>
- <span class="ctx-portrait" id="ctxPortrait"></span>
- <span style="color:var(--text-dim)">|</span>
- <span class="ctx-meta" id="ctxMeta">--</span>
- <div class="ctx-actions">
- <button class="ctx-btn primary" onclick="reloadFromPortrait()">🔄 重新载入画像</button>
- <button class="ctx-btn" onclick="switchToNewClient()">✕ 改为新客户</button>
- </div>
- </div>
- <div class="container">
- <!-- Hero 已移除(2026-07-11 Jack:去标题+6 capsule,直接从 9 家庭画像开始)-->
- <!-- 段 0 · ⚡ 快速导入预设画像 -->
- <div class="persona-section collapsed" id="personaSection">
- <div class="persona-head">
- <span class="persona-eyebrow">⚡ 快速导入</span>
- <span class="persona-title">9 个代表性家庭画像</span>
- <span class="persona-meta">点击 chip 一键填好 18 字段 · 后续仍可手动调整</span>
- <button class="persona-toggle" onclick="togglePersonaSection(this)">
- <span class="caret">▾</span>
- <span class="toggle-label">展开画像库</span>
- </button>
- </div>
- <div class="persona-subtitle">
- 代理人现场演示无需逐字填表 · 选最贴近客户场景的画像作为起点 · 选完后可微调每个字段。
- 画像 ≠ 真实客户(顶部 ctx-bar 会优先显示真实客户上下文)。
- </div>
- <div class="persona-tier-row">
- <span class="persona-tier-label"><span class="pc-tag-color std"></span> 普通客户(DIME 模式)</span>
- <div class="persona-chips">
- <div class="persona-chip" onclick="loadPersona('middle_3')">
- <span class="pc-name"><span class="pc-icon-em">👨👩👧</span>三口之家·中产</span>
- <span class="pc-desc">35岁 / 1子5岁 / 50+30万 / 房贷200</span>
- </div>
- <div class="persona-chip" onclick="loadPersona('two_child')">
- <span class="pc-name"><span class="pc-icon-em">👨👩👧👦</span>二孩·新中产</span>
- <span class="pc-desc">40岁 / 大10+二5 / 100+50万 / 全英美</span>
- </div>
- <div class="persona-chip" onclick="loadPersona('single_lady')">
- <span class="pc-name"><span class="pc-icon-em">👩💼</span>单身贵族·一线女</span>
- <span class="pc-desc">32岁女 / 未婚 / 80万 / 早退55</span>
- </div>
- <div class="persona-chip" onclick="loadPersona('dink')">
- <span class="pc-name"><span class="pc-icon-em">💑</span>DINK·双高收入</span>
- <span class="pc-desc">38+35 / 无子 / 100+80万 / 房贷600</span>
- </div>
- </div>
- </div>
- <div class="persona-tier-row">
- <span class="persona-tier-label"><span class="pc-tag-color mid"></span> 中等复杂(特殊场景)</span>
- <div class="persona-chips">
- <div class="persona-chip" onclick="loadPersona('single_mom')">
- <span class="pc-name"><span class="pc-icon-em">👩👦</span>离异·单亲妈妈</span>
- <span class="pc-desc">38岁女 / 1子8岁 / 60万单收入</span>
- </div>
- <div class="persona-chip" onclick="loadPersona('entrepreneur')">
- <span class="pc-name"><span class="pc-icon-em">🏢</span>创业者·民企主</span>
- <span class="pc-desc">42岁 / 2子 / 300万 / 经营贷1000 / 股权5000</span>
- </div>
- <div class="persona-chip" onclick="loadPersona('silver')">
- <span class="pc-name"><span class="pc-icon-em">👴</span>银发族·准退休</span>
- <span class="pc-desc">55岁 / 子女已成年 / 80+50万 / 流动800</span>
- </div>
- </div>
- </div>
- <div class="persona-tier-row">
- <span class="persona-tier-label"><span class="pc-tag-color hnw"></span> HNW(双轨触发 · 境内+境外 IUL/VUL/PPLI)</span>
- <div class="persona-chips">
- <div class="persona-chip" onclick="loadPersona('cross_border')">
- <span class="pc-name"><span class="pc-icon-em">🌏</span>跨境·二代美籍</span>
- <span class="pc-desc">50岁 / 1子22美籍 / 300万 / 流动1500 / FATCA</span>
- </div>
- <div class="persona-chip" onclick="loadPersona('uhnw_succession')">
- <span class="pc-name"><span class="pc-icon-em">🏛</span>HNW 传承家族</span>
- <span class="pc-desc">55岁 / 2子接班+留学 / 流动5000 / 股权10亿</span>
- </div>
- </div>
- </div>
- <div class="persona-section-tip" style="margin-top:14px;font-size:11.5px;color:rgba(229,220,196,0.78);padding:8px 12px;
- background:rgba(155,124,58,.10);border:1px solid rgba(155,124,58,0.20);border-radius:4px;line-height:1.7">
- 💡 <strong style="color:#F5E6B8">使用说明</strong>:点击 chip 后会自动填好下方所有 18 字段,顶部出现绿色 toast 提示。
- 点击「📊 计算保额」即可看到该画像的诊断报告。代理人可基于画像微调任何字段。
- </div>
- </div>
- <!-- ===== 段 1: 客户基本信息 ===== -->
- <div class="ic-section ic-section--L1" data-section="1">
- <div class="section-head">
- <span class="sh-num">01</span>
- <span class="sh-title">客户基本信息</span>
- <span class="sh-meta">用于生命表查保费 + DIME 公式收入替代</span>
- </div>
- <div class="form-grid">
- <div class="form-field">
- <label>客户姓 *</label>
- <input type="text" id="surname" placeholder="如:陈" maxlength="4" />
- </div>
- <div class="form-field">
- <label>主理人年龄 *<span class="hint">(影响保费)</span></label>
- <input type="number" id="age" placeholder="35" min="18" max="80" />
- </div>
- <div class="form-field">
- <label>性别 *</label>
- <select id="gender">
- <option value="M">男</option>
- <option value="F">女</option>
- </select>
- </div>
- <div class="form-field">
- <label>婚姻状况</label>
- <select id="marriage">
- <option value="married">已婚</option>
- <option value="single">未婚</option>
- <option value="divorced">离异</option>
- </select>
- </div>
- </div>
- <!-- ===== /段 1 结束 ===== -->
- </div>
- <!-- ===== 段 2: 子女与教育 ===== -->
- <div class="ic-section ic-section--L0" data-section="2">
- <div class="section-head">
- <span class="sh-num">02</span>
- <span class="sh-title">子女与教育规划</span>
- <span class="sh-meta">用于教育金 + 寿险 DIME 之 E 项</span>
- </div>
- <div class="form-grid">
- <div class="form-field">
- <label>子女数量</label>
- <select id="childCount" onchange="updateChildAgeFields()">
- <option value="0">无子女</option>
- <option value="1">1 个</option>
- <option value="2" selected>2 个</option>
- <option value="3">3 个</option>
- </select>
- </div>
- <div class="form-field" id="childAge1Wrap">
- <label>大儿/独子 年龄</label>
- <input type="number" id="childAge1" placeholder="8" min="0" max="30" value="8" />
- </div>
- <div class="form-field" id="childAge2Wrap">
- <label>二孩 年龄</label>
- <input type="number" id="childAge2" placeholder="5" min="0" max="30" value="5" />
- </div>
- <div class="form-field" id="childAge3Wrap" style="display:none">
- <label>三孩 年龄</label>
- <input type="number" id="childAge3" placeholder="3" min="0" max="30" />
- </div>
- <div class="form-field" style="grid-column:1/-1">
- <label>教育路径 *<span class="hint">(影响单子女教育金单价)</span></label>
- <select id="eduPath">
- <option value="domestic">🇨🇳 国内本科 · ¥100 万/子女</option>
- <option value="domestic_plus">🇨🇳+🌐 国内 + 海外硕士 · ¥250 万/子女</option>
- <option value="full_overseas" selected>🇬🇧🇺🇸 全程英美 · ¥600 万/子女</option>
- <option value="elite_us">🇺🇸 美高 + 美本 + 美研 · ¥1000 万/子女</option>
- </select>
- </div>
- </div>
- <!-- ===== /段 2 结束 ===== -->
- </div>
- <!-- ===== 段 3: 财务信息 (v3.4 · 加自住房产 + 投资资产 → 总财富画像) ===== -->
- <div class="ic-section ic-section--L1" data-section="3">
- <div class="section-head">
- <span class="sh-num">03</span>
- <span class="sh-title">家庭财务信息</span>
- <span class="sh-meta">所有金额单位为「万元」 · 流动资产/自住房产/投资资产分开填,体现总财富画像</span>
- </div>
- <div class="form-grid">
- <div class="form-field">
- <label>主理人年薪 (万) *</label>
- <input type="number" id="salary" placeholder="100" min="0" step="10" value="100" />
- </div>
- <div class="form-field">
- <label>配偶年薪 (万)</label>
- <input type="number" id="spouseSalary" placeholder="0" min="0" step="10" value="0" />
- </div>
- <div class="form-field">
- <label>房贷余额 (万)</label>
- <input type="number" id="mortgage" placeholder="500" min="0" step="10" value="500" />
- </div>
- <div class="form-field">
- <label>其他负债 (万)<span class="hint">(车贷/经营贷)</span></label>
- <input type="number" id="otherDebt" placeholder="0" min="0" step="10" value="0" />
- </div>
- <div class="form-field">
- <label>💧 流动资产 (万)<span class="hint">(现金+银行理财+股票/基金)</span></label>
- <input type="number" id="liquidAssets" placeholder="300" min="0" step="10" value="300" />
- </div>
- <div class="form-field">
- <label>🏠 自住房产估值 (万)<span class="hint">(仅自住)</span></label>
- <input type="number" id="primaryResidence" placeholder="0" min="0" step="50" value="0" />
- </div>
- <div class="form-field" style="grid-column:1/-1">
- <label>🏛 其他投资资产 (万)<span class="hint">(投资性房产+黄金+私募+信托+银行理财等总额估算)</span></label>
- <input type="number" id="investAssets" placeholder="0" min="0" step="50" value="0" />
- <div style="margin-top:6px;font-size:11px;color:var(--text-dim);line-height:1.5">
- 💡 需要细致拆分股票/基金/黄金/私募的资产配置?
- <a href="javascript:void(0)" onclick="jumpToAssetCenter()" style="color:var(--accent);text-decoration:underline;font-weight:600">→ 打开资产配置中心(将本表数据带过去)</a>
- </div>
- </div>
- <!-- [v4.2] 境外资产 · 用于境外寿险按实际境外资产分配,而非整体 AUM × 比例 -->
- <!-- [v4.4.3] 单位改为万美金(跨境美籍/UHNW 境外资产通常美元计价 · 内部按 1 USD = 7 CNY 换算)-->
- <div class="form-field" style="grid-column:1/-1;background:linear-gradient(90deg,rgba(141,185,213,0.06) 0%,rgba(255,255,255,0) 100%);padding:14px 16px;border-radius:8px;border-left:3px solid #3D6F8C">
- <label style="color:#3D6F8C;font-weight:700">🌏 境外资产 (万美金)<span class="hint" style="color:#6B5239;font-weight:400">[v4.4.3] (上述资产中位于境外的部分 · 海外金融账户/海外房产/海外公司股权 · <strong>美元计价</strong>)</span></label>
- <div style="display:flex;align-items:center;gap:10px">
- <input type="number" id="overseasAssets" placeholder="0" min="0" step="10" value="0" style="flex:1" />
- <span id="overseasAssetsCnyHint" style="font-size:11.5px;color:#7A6028;font-family:'Cormorant Garamond',serif;font-weight:600;white-space:nowrap">≈ ¥0 万</span>
- </div>
- <div style="margin-top:8px;display:flex;align-items:center;gap:10px;font-size:11.5px;color:var(--text-dim)">
- <label style="display:flex;align-items:center;gap:6px;cursor:pointer;font-weight:500">
- <input type="checkbox" id="overseasFuturePlan" style="width:14px;height:14px;cursor:pointer" />
- <span>客户计划未来 3-5 年配置境外资产</span>
- </label>
- <span style="color:#9B7C3A;font-style:italic">(勾选后按 AUM × 30% 估算境外寿险需求)</span>
- </div>
- <div style="margin-top:6px;font-size:11px;color:#7A6028;line-height:1.5">
- 💡 普通客户境外资产默认 0 → 不配境外寿险。跨境美籍 / UHNW 通常 30-60% AUM 在境外。汇率 <strong>1 USD = 7 CNY</strong> (内部换算用,精确测算请咨询 1v1 顾问)。<br>
- ⚠ 如果勾选"未来计划",代理人需在 1v1 服务中确认客户跨境意向(移民/海外置业/子女留学/跨境家办等)。
- </div>
- </div>
- </div>
- <!-- ===== /段 3 结束 ===== -->
- </div>
- <!-- ===== 段 4: 现有保障 (v3.1 · 7 险种全覆盖 · 按金字塔基础→中端→高端顺序) ===== -->
- <div class="ic-section ic-section--L2" data-section="4">
- <div class="section-head">
- <span class="sh-num">04</span>
- <span class="sh-title">现有保障盘点</span>
- <span class="sh-meta">7 险种全盘点 · 用于计算每个险种的「缺口」</span>
- </div>
- <div class="form-grid form-grid--risk-tiers">
- <!-- 🟧 基础风险层 -->
- <div class="risk-layer-group risk-layer--basic">
- <div class="risk-layer-head">
- <span>🟧</span>
- <span>基础风险层</span>
- <span class="rl-meta">意外 / 医疗 / 重疾 · 损失性风险</span>
- </div>
- <div class="risk-layer-fields">
- <div class="form-field">
- <label>① 现有意外险保额 (万) <span class="hint">(基础)</span></label>
- <input type="number" id="existingAccident" placeholder="0" min="0" step="50" value="0" />
- </div>
- <div class="form-field">
- <label>② 现有高端医疗 <span class="hint">(基础)</span></label>
- <select id="existingMed">
- <option value="0">无</option>
- <option value="1" selected>有 (¥800 万级)</option>
- </select>
- </div>
- <div class="form-field">
- <label>③ 现有重疾保额 (万) <span class="hint">(基础)</span></label>
- <input type="number" id="existingCI" placeholder="0" min="0" step="50" value="50" />
- </div>
- </div>
- </div>
- <!-- 🟨 中端风险层 -->
- <div class="risk-layer-group risk-layer--mid">
- <div class="risk-layer-head">
- <span>🟨</span>
- <span>中端风险层</span>
- <span class="rl-meta">定寿 / 教育 / 养老 · 支出性风险</span>
- </div>
- <div class="risk-layer-fields">
- <div class="form-field">
- <label>④ 现有定期寿险保额 (万) <span class="hint">(中端·收入替代)</span></label>
- <input type="number" id="existingLife" placeholder="0" min="0" step="50" value="200" />
- </div>
- <div class="form-field">
- <label>⑤ 教育金储备 (万) <span class="hint">(中端·年金/分红型保险)</span></label>
- <input type="number" id="existingEduInsurance" placeholder="0" min="0" step="50" value="0" />
- </div>
- <div class="form-field">
- <label>⑥ 养老金储备 (万) <span class="hint">(中端·年金)</span></label>
- <input type="number" id="existingRetirement" placeholder="0" min="0" step="50" value="0" />
- </div>
- </div>
- </div>
- <!-- 🟡 高端风险层 -->
- <div class="risk-layer-group risk-layer--high">
- <div class="risk-layer-head">
- <span>🟡</span>
- <span>高端风险层</span>
- <span class="rl-meta">终身寿 · 传承隔离</span>
- </div>
- <div class="risk-layer-fields">
- <div class="form-field">
- <label>⑦ 现有终身寿险保额 (万) <span class="hint">(高端·传承隔离)</span></label>
- <input type="number" id="existingWholeLife" placeholder="0" min="0" step="50" value="0" />
- </div>
- </div>
- </div>
- </div>
- <!-- ===== /段 4 结束 ===== -->
- </div>
- <!-- ===== 段 5: 退休 & 预期 ===== -->
- <div class="ic-section ic-section--L1" data-section="5">
- <div class="section-head">
- <span class="sh-num">05</span>
- <span class="sh-title">退休与预期</span>
- <span class="sh-meta">用于寿险 I 项 + 养老金缺口</span>
- </div>
- <div class="form-grid">
- <div class="form-field">
- <label>计划退休年龄</label>
- <input type="number" id="retireAge" placeholder="60" min="40" max="80" value="60" />
- </div>
- <div class="form-field">
- <label>预期寿命<span class="hint">(用于养老金)</span></label>
- <input type="number" id="lifeExpectancy" placeholder="90" min="70" max="120" value="90" />
- </div>
- <div class="form-field">
- <label>退休后生活水平偏好<span class="hint">(退休后年支出 / 工作期年薪)</span></label>
- <select id="retireLifestyleRatio">
- <option value="0.45">极简生活 45% · 房贷已清 + 子女独立</option>
- <option value="0.56">标准默认 56% · 70%×80% 链式公式</option>
- <option value="0.70" selected>维持现状 70% · 中产舒适退休</option>
- <option value="0.85">高端维持 85% · UHNW 不降标</option>
- <option value="1.00">高于现状 100% · 退休后旅行/医疗增加</option>
- </select>
- </div>
- <div class="form-field">
- <label>未来收入折现率<span class="hint">(寿险 I 项现值,默认 4%)</span></label>
- <select id="incomeDiscountRate">
- <option value="0">不折现(简单累加 · 保守)</option>
- <option value="0.03" selected>3% (低利率假设)</option>
- <option value="0.04">4% (国债基准)</option>
- <option value="0.05">5% (标准理财)</option>
- <option value="0.06">6% (积极假设)</option>
- </select>
- </div>
- <div class="form-field">
- <label>重疾保额倍数<span class="hint">(重疾保额 = 年薪 × N)</span></label>
- <select id="ciMultiplier">
- <option value="2">2× · 极简(已有大额储蓄/医疗)</option>
- <option value="3" selected>3× · 标准(行业默认 · 中产)</option>
- <option value="4">4× · 加强(35-50 岁主理人)</option>
- <option value="5">5× · UHNW(留足体面康复期)</option>
- </select>
- </div>
- <div class="form-field">
- <label>家庭年缴保费上限</label>
- <select id="affordabilityCap">
- <option value="0.10">10% · 防御型(纯保障)</option>
- <option value="0.15">15% · 平衡型(保障+轻储蓄)</option>
- <option value="0.20" selected>20% · 储蓄型(保障+教育/养老)</option>
- <option value="0.30">30% · 激进储蓄(谨慎使用)</option>
- <option value="1.00">不设上限(仅显示完整需求)</option>
- </select>
- </div>
- </div>
- <!-- ===== /段 5 结束 ===== -->
- </div>
- <div class="calc-row" id="calcRow">
- <button class="btn btn-ghost" onclick="resetForm()">↺ 重置</button>
- <button class="btn btn-primary" onclick="calculate()">📊 计算保额 →</button>
- </div>
- <!-- ===== 输出区 ===== -->
- <div id="result">
- <!-- [2026-07-12 移植] 客户家庭档案卡 · 替代原「保险配置诊断」展示位(源:家庭保障体检报告 v0.1) -->
- <div class="v01-family-card" id="v01FamilyCard" style="display:none">
- <!-- 顶部 eyebrow + 大标题(左) · CFPI 金环(右) -->
- <div class="v01-fc-header">
- <div class="v01-fc-head-text">
- <div class="v01-fc-eyebrow">
- <span class="v01-fc-eyebrow-line"></span>
- <span class="v01-fc-eyebrow-text">客户家庭档案 · Client Profile</span>
- <span class="v01-fc-eyebrow-line"></span>
- </div>
- <h2 class="v01-fc-title" id="v01FcTitle">— 待载入画像 —</h2>
- <div class="v01-fc-subtitle" id="v01FcSubtitle">请填写左侧表单或从画像下拉选择</div>
- </div>
- <!-- CFPI 保障完整度金环仪表盘(右侧) -->
- <div class="v01-cfpi-gauge" id="v01CfpiGauge">
- <div class="v01-cfpi-ring">
- <svg width="104" height="104" viewBox="0 0 104 104">
- <defs><linearGradient id="cfpiGrad" x1="0" y1="0" x2="1" y2="1">
- <stop offset="0%" stop-color="#B89A52"/><stop offset="100%" stop-color="#2D6A4F"/>
- </linearGradient></defs>
- <circle class="v01-cfpi-ring-track" cx="52" cy="52" r="44"/>
- <circle class="v01-cfpi-ring-fill" id="v01CfpiRingFill" cx="52" cy="52" r="44"
- stroke-dasharray="276.5" stroke-dashoffset="276.5"/>
- </svg>
- <div class="v01-cfpi-ring-center">
- <div class="v01-cfpi-ring-num" id="v01CfpiNum">—</div>
- <div class="v01-cfpi-ring-max">CFPI / 10</div>
- </div>
- </div>
- <div class="v01-cfpi-meta">
- <span class="v01-cfpi-meta-eyebrow">保障完整度</span>
- <span class="v01-cfpi-badge" id="v01CfpiBadge">— 待评</span>
- <span class="v01-cfpi-meta-desc" id="v01CfpiDesc">计算后显示 7 险种保障评分</span>
- </div>
- </div>
- </div>
- <!-- 三柱核心指标(大字 Cormorant Garamond) -->
- <div class="v01-fc-metrics">
- <div class="v01-fc-metric">
- <div class="v01-fc-metric-label">家庭年收入</div>
- <div class="v01-fc-metric-value" id="v01FcIncome">¥ —</div>
- <div class="v01-fc-metric-sub" id="v01FcIncomeSub">主理人 + 配偶</div>
- </div>
- <div class="v01-fc-metric-divider"></div>
- <div class="v01-fc-metric">
- <div class="v01-fc-metric-label">总资产</div>
- <div class="v01-fc-metric-value" id="v01FcWealth">¥ —</div>
- <div class="v01-fc-metric-sub" id="v01FcWealthSub">4 盘合计</div>
- </div>
- <div class="v01-fc-metric-divider"></div>
- <!-- [2026-07-12 提案① · 对齐 FAV 顶部卡] 已配置保额 · 7 险种 existing 合计 -->
- <div class="v01-fc-metric">
- <div class="v01-fc-metric-label">已配置保额</div>
- <div class="v01-fc-metric-value" id="v01FcInsured">¥ —</div>
- <div class="v01-fc-metric-sub" id="v01FcInsuredSub">7 险种现有保单</div>
- </div>
- <div class="v01-fc-metric-divider"></div>
- <!-- [2026-07-12 提案① · 对齐 FAV 顶部卡] 保障缺口 · 镜像 totalGapHero -->
- <div class="v01-fc-metric">
- <div class="v01-fc-metric-label">保障缺口</div>
- <div class="v01-fc-metric-value" id="v01FcGap">¥ —</div>
- <div class="v01-fc-metric-sub" id="v01FcGapSub">需求 − 现有</div>
- </div>
- <div class="v01-fc-metric-divider"></div>
- <div class="v01-fc-metric">
- <div class="v01-fc-metric-label">退休规划</div>
- <div class="v01-fc-metric-value v01-fc-metric-value-text" id="v01FcRetire">—</div>
- <div class="v01-fc-metric-sub" id="v01FcRetireSub">月支出 / 寿期</div>
- </div>
- </div>
- <!-- 资产 4 盘细分 -->
- <div class="v01-fc-assets" id="v01FcAssets"></div>
- <!-- 7 险种现有保单 -->
- <div class="v01-fc-policies-head">
- <span class="v01-fc-policies-icon">📋</span>
- <span class="v01-fc-policies-title">现有保单 · 7 险种保障概览</span>
- </div>
- <div class="v01-fc-policies-grid" id="v01FcPolicies"></div>
- </div>
- <!-- [2026-07-12 移植] 体检报告 Hero · 作为 #result 直接子元素 → Tab 引擎抓成第5 Tab -->
- <div class="v01-hero" id="v01Hero">
- <div class="v01-hero-title">保险配置 · 5 分钟诊断</div>
- <h1 class="v01-hero-headline" id="v01Headline">您的家庭保障 <em>体检报告</em></h1>
- <div class="v01-hero-grid">
- <!-- 左侧:三环 + 3 KPI(Jack 2026-06-22:Coach 移出 grid 放最下方,左右等高) -->
- <div class="v01-left-col">
- <!-- [v0.1.3] 三环卡片 · 视角切换驱动 -->
- <div class="v01-rings-wrap">
- <div class="v01-rings-head">
- <div>
- <div class="v01-rings-perspective" id="v01RingsTitle">保险三层 · 基础 / 中端 / 高端</div>
- <div class="v01-rings-subtitle" id="v01RingsSubtitle">沿用 v4.7 风险金字塔架构 · 数据已有</div>
- </div>
- </div>
- <div class="v01-rings-row" id="v01RingsRow">
- <!-- 3 个环 tile · 由 JS v01RenderRings 渲染 -->
- </div>
- </div>
- <div class="v01-kpi-row" style="margin-top:18px">
- <div class="v01-kpi v01-kpi-gap">
- <div class="v01-kpi-icon">💰</div>
- <div class="v01-kpi-label">保障缺口</div>
- <div class="v01-kpi-value" id="v01KpiGap">¥ —</div>
- <div class="v01-kpi-sub" id="v01KpiGapSub">7 险种合计</div>
- </div>
- <div class="v01-kpi v01-kpi-leverage">
- <div class="v01-kpi-icon">⚖</div>
- <div class="v01-kpi-label">保障杠杆</div>
- <div class="v01-kpi-value" id="v01KpiLeverage">— ×</div>
- <div class="v01-kpi-sub">纯保障型</div>
- </div>
- <div class="v01-kpi v01-kpi-cost">
- <div class="v01-kpi-icon">💸</div>
- <div class="v01-kpi-label">实际年成本</div>
- <div class="v01-kpi-value" id="v01KpiCost">¥ —</div>
- <div class="v01-kpi-sub" id="v01KpiCostSub">年缴 / 收入</div>
- </div>
- </div>
- </div>
- <!-- 右侧:4 mini 可视化 2x2 -->
- <div class="v01-vis-grid">
- <div class="v01-vis-card">
- <div class="v01-vis-head">
- <span class="v01-vis-icon">🔺</span>
- <span class="v01-vis-title">风险金字塔</span>
- </div>
- <div class="v01-vis-body">
- <svg class="v01-mini-pyramid" viewBox="0 0 200 120" id="v01MiniPyramid">
- <!-- 由 v01UpdateHero() 动态填充 -->
- </svg>
- </div>
- <div class="v01-vis-foot" id="v01PyramidFoot">7 险种水位 · 0% 已配齐</div>
- </div>
- <div class="v01-vis-card">
- <div class="v01-vis-head">
- <span class="v01-vis-icon">📊</span>
- <span class="v01-vis-title">现金流 60 年</span>
- </div>
- <div class="v01-vis-body">
- <canvas class="v01-mini-cashflow" id="v01MiniCashflow" width="240" height="110"></canvas>
- </div>
- <div class="v01-vis-foot" id="v01CashflowFoot">↑ 流出 / ↓ 流入 双向柱</div>
- </div>
- <div class="v01-vis-card">
- <div class="v01-vis-head">
- <span class="v01-vis-icon">🎯</span>
- <span class="v01-vis-title">三轨方案</span>
- </div>
- <div class="v01-vis-body">
- <div class="v01-mini-tri">
- <div class="v01-mini-tri-cell">
- <div class="v01-mini-tri-label">完整需求</div>
- <div class="v01-mini-tri-num" id="v01MiniTriFull">¥ —</div>
- </div>
- <div class="v01-mini-tri-cell is-aff">
- <div class="v01-mini-tri-label">可负担</div>
- <div class="v01-mini-tri-num" id="v01MiniTriAff">¥ —</div>
- </div>
- <div class="v01-mini-tri-cell is-custom">
- <div class="v01-mini-tri-label">自定义</div>
- <div class="v01-mini-tri-num" id="v01MiniTriCustom">¥ —</div>
- </div>
- </div>
- </div>
- <div class="v01-vis-foot">三档方案对比 · 完整 / 可负担 / 自定义</div>
- </div>
- <div class="v01-vis-card">
- <div class="v01-vis-head">
- <span class="v01-vis-icon">💧</span>
- <span class="v01-vis-title">应急储备健康度</span>
- </div>
- <div class="v01-vis-body">
- <div class="v01-mini-emergency">
- <div class="v01-mini-emerg-num"><span id="v01EmergencyNum">—</span><span class="v01-mini-emerg-unit">月</span></div>
- <div class="v01-mini-emerg-bar"><div class="v01-mini-emerg-fill" id="v01EmergencyFill" style="width:0%"></div></div>
- <div class="v01-mini-emerg-scale"><span>0月</span><span>6月</span><span>12月</span><span>24月+</span></div>
- </div>
- </div>
- <div class="v01-vis-foot" id="v01EmergencyFoot">流动资产 / 月生活费 · 行业建议 6-12 月</div>
- </div>
- </div>
- </div>
- </div>
- <!-- [2026-07-12 移植自 FAV] 01 家族保单 → 第6 Tab(sel .fav-family-policies) -->
- <div class="fav-family-policies" id="favFamilyPolicies">
- <div class="fav-sec-head"><span class="num">家族</span>家族保单聚合</div>
- <div class="member-pills" id="favMemberPills"></div>
- <div class="member-desc" id="favMemberDesc">📋 当前查看:家族总览 · 显示家庭全部保单记录</div>
- <table class="policy-table">
- <thead><tr><th>成员</th><th>险种</th><th>保险公司</th><th>保额</th><th>被保险人</th><th>受益人</th><th>阶段</th></tr></thead>
- <tbody id="favPolicyBody"></tbody>
- </table>
- <p class="fav-note">💡 演示口径:IC 为家庭级数据,现有保单默认归主理人投保;逐成员归属为合成展示。家族全成员真实保单映射请用「家族账户 FAV」页面。</p>
- </div>
- <!-- [2026-07-12 移植自 FAV] 02a 生命周期两阶段 → 并入 Tab A(sel 追加 .fav-lifecycle-block) -->
- <div class="fav-lifecycle-block" id="favLifecycleBlock">
- <div class="fav-sec-head"><span class="num">生命周期</span>保障缺口 · 按生命周期两阶段</div>
- <div id="favLcBody"></div>
- </div>
- <!-- 总览 Cover · [2026-07-12] 隐藏保留 · calculate() 与下游卡片仍读写其子节点 ID -->
- <div class="result-cover" style="display:none">
- <div class="rc-eyebrow">INSURANCE CALCULATOR · RESULT</div>
- <div class="rc-title" id="rcTitle">陈先生(35 岁) · 保险配置诊断</div>
- <div class="rc-subtitle" id="rcSubtitle">基于 DIME 法 + 高端医疗 800 万 cover + 子女教育路径自动计算</div>
- <!-- [v3.6] 计算依据展开按钮 -->
- <div style="margin-top:12px;text-align:center">
- <button class="btn-formula-toggle" onclick="toggleFormulaPanel()" style="background:transparent;border:1px solid rgba(201,168,76,0.5);color:#C9A84C;padding:6px 18px;border-radius:6px;cursor:pointer;font-size:12.5px;letter-spacing:0.3px;font-family:'Noto Serif SC',serif;transition:all .2s">📐 查看 7 险种完整计算依据</button>
- </div>
- <div class="rc-summary rc-summary-v4">
- <div class="rc-tile rc-tile-onetime">
- <div class="rc-tile-label">一次性赔付保额合计</div>
- <div class="rc-tile-value" id="totalOnetimeCoverage">¥ -</div>
- <div class="rc-tile-sub">重疾 + 医疗 + 定寿 + 终身寿 + 意外</div>
- </div>
- <div class="rc-tile rc-tile-longterm">
- <div class="rc-tile-label">长周期累积需求合计</div>
- <div class="rc-tile-value" id="totalLongtermNeed">¥ -</div>
- <div class="rc-tile-sub">养老金 / 教育金 PV 现值</div>
- </div>
- <!-- [v4.7 + Jack 2026-06-21] 保障缺口 · 7 险种 need - existing 累计 · 客户最直观的"还差多少" -->
- <div class="rc-tile rc-tile-gap">
- <div class="rc-tile-label">保障缺口</div>
- <div class="rc-tile-value" id="totalGapHero">¥ -</div>
- <div class="rc-tile-sub" id="totalGapHeroSub">7 险种现有保单 vs 完整需求差额</div>
- </div>
- <div class="rc-tile rc-tile-cost">
- <div class="rc-tile-label">客户实际年成本</div>
- <div class="rc-tile-value" id="totalAnnualPremium">¥ -</div>
- <div class="rc-tile-sub" id="totalAnnualPremiumSub">年缴保费 · 占资产比例</div>
- </div>
- <div class="rc-tile rc-tile-leverage">
- <div class="rc-tile-label">保障杠杆</div>
- <div class="rc-tile-value" id="leverage">- 倍</div>
- <div class="rc-tile-sub">一次性赔付 / 20年纯保障型保费</div>
- </div>
- </div>
- <!-- v4.0 兼容 · 老 totalCoverage / totalGap / totalPremium 节点保留(JS 仍写入,但不显示) -->
- <span id="totalCoverage" style="display:none">-</span>
- <span id="totalGap" style="display:none">-</span>
- <span id="totalPremium" style="display:none">-</span>
- <!-- [v4.3] 软提示警示条(超 AUM 100% 时显示,不强制缩减) -->
- <div id="capWarningV43" style="display:none;margin-top:14px;padding:10px 14px;background:rgba(232,112,112,.10);border-left:3px solid #E87070;border-radius:0 4px 4px 0;font-size:11.5px;line-height:1.65;color:rgba(245,200,184,.92)"></div>
- <!-- [v4.4.2] 注解折叠 · 5 条 disclaimer 用 ⓘ popover 节省空间 -->
- <div style="margin-top:14px;display:flex;gap:8px;flex-wrap:wrap;justify-content:center">
- <button class="info-pill info-pill-light" onclick="toggleInfoPopover('disclaimers')">
- <span class="info-icon">ⓘ</span>
- <span class="info-label">公式与假设说明</span>
- <span class="info-count">· 5 条</span>
- </button>
- </div>
- <!-- ⓘ Popover · 5 条 disclaimer -->
- <div class="info-popover-overlay" id="info-disclaimers" onclick="event.stopPropagation()">
- <div class="info-popover" onclick="event.stopPropagation()">
- <div class="info-popover-head">
- <span class="info-pop-icon">📐</span>
- <span>v4.4 公式 / 假设 / Disclaimer 共 5 条</span>
- <button class="info-popover-close" onclick="toggleInfoPopover('disclaimers')">×</button>
- </div>
- <div class="info-popover-body">
- <div class="info-row">
- <strong>① v4.3 公式与软提示</strong><br>
- 相比 v4.2 硬性 100% AUM 缩减,v4.3 三处优化 — 配偶补充按 spouseSalary/salary 比例(无收入则 0,避免虚假需求);境内增额终身寿合计 ≤ 境内资产 × 50% 上限(防止 max 公式过激);一次性赔付 100% AUM 改为软提示,超出后只显示警示,不强制砍。
- </div>
- <div class="info-row info-row-warn">
- <strong>② 杠杆倍数 disclaimer</strong><br>
- 80/40/20/10x 按健康标体非吸烟测算,实际由保司精算综合年龄/健康/性别/烟酒史定价,可能偏差 ±30%。
- </div>
- <div class="info-row info-row-warn">
- <strong>③ 美籍 50% needRatio 复合系数</strong><br>
- 跨境美籍 50% 是Benchmark 对外标准复合系数,综合 3 层需求 — 跨境法律隔离(STAR/VISTA 信托)~ 20%;流动性桥梁(资产变现期家庭过渡)~ 10-15%;美籍遗产税敞口对冲 ~ 10-30%(因身份+US-situs 比例+豁免额变动)。
- </div>
- <div class="info-row info-row-warn">
- <strong>④ 美籍敞口具体规则</strong><br>
- US Person(公民/绿卡)= 全球资产 × 40%(豁免 $1393 万 USD,2027 预期减半);NRA(非居民)= 仅 US-situs assets × 40%(豁免 $6 万)。精确测算需 1v1 顾问服务,Benchmark 后续版本将加 UI 输入字段(身份/US-situs 比例/豁免自动扣)。
- </div>
- <div class="info-row info-row-warn">
- <strong>⑤ 重疾(储蓄型)意外身故</strong><br>
- 储蓄型重疾<strong>意外身故也赔保额</strong>(身故责任),不只是诊断重疾才赔。
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- [v3.6] 7 险种计算依据展开块(默认隐藏 · 点 result-cover 上的按钮触发) -->
- <div class="formula-panel" id="formulaPanel" style="display:none;background:linear-gradient(180deg,#FAF6E8,#F3EDD9);border:1px solid #C9A84C;border-radius:12px;padding:24px 28px;margin-bottom:20px;box-shadow:0 4px 16px rgba(155,124,58,.10)">
- <div class="fp-head" style="display:flex;align-items:baseline;gap:14px;margin-bottom:14px;border-bottom:1px solid rgba(201,168,76,.3);padding-bottom:10px">
- <span style="font-size:18px">📐</span>
- <span style="font-size:15px;font-weight:700;font-family:'Noto Serif SC',serif;color:#3D2914;letter-spacing:-.3px">7 险种总保额完整计算依据</span>
- <span style="font-size:11.5px;color:#7A6028;margin-left:auto" id="fpKpiHeader">客户感知口径 · 详细公式 + 数字</span>
- <button onclick="toggleFormulaPanel()" style="background:transparent;border:1px solid #9B7C3A;color:#7A6028;padding:3px 10px;border-radius:4px;cursor:pointer;font-size:11px">✕ 收起</button>
- </div>
- <div id="formulaPanelBody" style="font-size:12.5px;line-height:1.85;color:#3D2914"></div>
- <!-- [v4.4.2] fp-disclaimer 折叠为 ⓘ popover -->
- <div style="margin-top:12px;text-align:center">
- <button class="info-pill" onclick="toggleInfoPopover('fp-disclaimer')">
- <span class="info-icon">ⓘ</span>
- <span class="info-label">口径说明</span>
- <span class="info-count">· 双口径分离</span>
- </button>
- </div>
- <div class="info-popover-overlay" id="info-fp-disclaimer">
- <div class="info-popover" onclick="event.stopPropagation()">
- <div class="info-popover-head">
- <span class="info-pop-icon">📐</span>
- <span>v4.0 口径说明 · 双口径分离</span>
- <button class="info-popover-close" onclick="toggleInfoPopover('fp-disclaimer')">×</button>
- </div>
- <div class="info-popover-body">
- <p>本工具采用<strong>"一次性赔付 vs 长周期累积"双口径分离</strong>。其中:</p>
- <div class="info-row">
- <strong>一次性赔付组(金色)</strong><br>
- 意外险 / 重疾 / 高端医疗 / 寿险 / 终身寿险 — 出险即赔保额(精算严格风险敞口)
- </div>
- <div class="info-row">
- <strong>长周期累积组(蓝色)</strong><br>
- 养老金 / 教育金 — <strong>v4.0 已改用 PV 现值</strong>(今天该准备的购买力,非未来名义金额),避免数字虚高
- </div>
- <div class="info-row">
- <strong>实际成本(年缴保费)</strong><br>
- 7 项保费总和 ÷ 20 年 = 客户每年实际支出,这才是和资产做对比的合理口径
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- v3.4 · 家庭总财富画像(流动 / 自住 / 投资三盘) -->
- <div class="wealth-picture-section" id="wealthPictureSection">
- <div class="wp-head">
- <span style="font-size:18px">📊</span>
- <span class="wp-title">家庭总财富画像 · Total Wealth</span>
- <span class="wp-meta" id="wpMeta">v3.4 新增 · 流动+自住+投资 三盘合并视角</span>
- </div>
- <div class="wp-stack">
- <div class="wp-bar" id="wpBar">
- <div class="wp-seg wp-seg-liquid" id="wpSegLiquid" title="流动资产"></div>
- <div class="wp-seg wp-seg-house" id="wpSegHouse" title="自住房产"></div>
- <div class="wp-seg wp-seg-invest" id="wpSegInvest" title="其他投资"></div>
- <div class="wp-seg wp-seg-insur" id="wpSegInsur" title="保险现金价值"></div>
- </div>
- <div class="wp-legend">
- <div class="wp-legend-item">
- <span class="wp-dot wp-dot-liquid"></span>
- <span class="wp-lbl">💧 流动资产</span>
- <span class="wp-amt" id="wpLiquidAmt">¥ -</span>
- <span class="wp-pct" id="wpLiquidPct">- %</span>
- </div>
- <div class="wp-legend-item">
- <span class="wp-dot wp-dot-house"></span>
- <span class="wp-lbl">🏠 自住房产</span>
- <span class="wp-amt" id="wpHouseAmt">¥ -</span>
- <span class="wp-pct" id="wpHousePct">- %</span>
- </div>
- <div class="wp-legend-item">
- <span class="wp-dot wp-dot-invest"></span>
- <span class="wp-lbl">🏛 其他投资</span>
- <span class="wp-amt" id="wpInvestAmt">¥ -</span>
- <span class="wp-pct" id="wpInvestPct">- %</span>
- </div>
- <div class="wp-legend-item">
- <span class="wp-dot wp-dot-insur"></span>
- <span class="wp-lbl">📜 保险现金价值</span>
- <span class="wp-amt" id="wpInsurAmt">¥ -</span>
- <span class="wp-pct" id="wpInsurPct">- %</span>
- </div>
- <div class="wp-legend-item wp-legend-total">
- <span class="wp-dot wp-dot-total"></span>
- <span class="wp-lbl">总财富</span>
- <span class="wp-amt" id="wpTotalAmt">¥ -</span>
- <span class="wp-pct">100%</span>
- </div>
- </div>
- </div>
- <div class="wp-insight" id="wpInsight"></div>
- <div class="wp-actions">
- <a class="wp-action-btn" href="javascript:void(0)" onclick="jumpToAssetCenter()">
- 🏛 打开资产配置中心 <span style="opacity:.7">(细化股票/基金/黄金/私募)</span>
- </a>
- <a class="wp-action-btn" href="javascript:void(0)" onclick="jumpToLetsSee()">
- 🔮 打开 Let's See <span style="opacity:.7">(看 30 年财富推演)</span>
- </a>
- </div>
- </div>
- <!-- v2.8 · 支付能力健康度 + 行业基准对比 -->
- <div class="affordability-section" id="affordabilitySection">
- <div class="aff-head">
- <span style="font-size:18px">⚖</span>
- <span class="aff-title">支付能力健康度 · Affordability Check</span>
- <span class="aff-meta">v2.9 升级 · HNW 以 AUM 为分母 + 教育金分级保留(留学优先)</span>
- </div>
- <div class="aff-row">
- <div class="aff-card">
- <div class="aff-card-label" id="affFamilyIncomeLabel">家庭年收入</div>
- <div class="aff-card-value" id="affFamilyIncome">¥ -</div>
- <div class="aff-card-sub" id="affFamilyIncomeSub">主理人 + 配偶</div>
- </div>
- <div class="aff-card">
- <div class="aff-card-label">完整需求年缴(理论)</div>
- <div class="aff-card-value" id="affFullPremium">¥ -</div>
- <div class="aff-card-sub" id="affFullPremiumSub">基于 7 险种缺口</div>
- </div>
- <div class="aff-card">
- <div class="aff-card-label">保费占收入比</div>
- <div class="aff-card-value" id="affPremiumRatio">- %</div>
- <div class="aff-card-sub" id="affPremiumRatioSub">普通家庭 10-20% / HNW 1-3%</div>
- </div>
- <div class="aff-card aff-card-emphasis">
- <div class="aff-card-label">可负担年缴(推荐)</div>
- <div class="aff-card-value" id="affAffordablePremium">¥ -</div>
- <div class="aff-card-sub" id="affAffordablePremiumSub">按上限自动缩减储蓄型</div>
- </div>
- </div>
- <div class="aff-warning" id="affWarning" style="display:none">
- <span class="aff-warn-icon">⚠</span>
- <span class="aff-warn-text" id="affWarnText"></span>
- </div>
- <div class="aff-benchmark">
- <div class="aff-bench-row">
- <div class="aff-bench-label" id="affCoverageBenchLabel">总保额 / 家庭年收入</div>
- <div class="aff-bench-bar">
- <div class="aff-bench-track">
- <div class="aff-bench-band aff-bench-band-ok" style="left:0;width:50%"></div>
- <div class="aff-bench-band aff-bench-band-warn" style="left:50%;width:25%"></div>
- <div class="aff-bench-band aff-bench-band-bad" style="left:75%;width:25%"></div>
- <div class="aff-bench-marker" id="affCoverageMarker" style="left:0%"></div>
- </div>
- <div class="aff-bench-scale" id="affCoverageScale">
- <span>0×</span><span>10×</span><span>20×</span><span>30×</span><span>40×+</span>
- </div>
- </div>
- <div class="aff-bench-value" id="affCoverageMultiple">- ×</div>
- </div>
- <div class="aff-bench-row">
- <div class="aff-bench-label" id="affPremiumBenchLabel">年缴 / 家庭年收入</div>
- <div class="aff-bench-bar">
- <div class="aff-bench-track">
- <div class="aff-bench-band aff-bench-band-ok" style="left:0;width:33%"></div>
- <div class="aff-bench-band aff-bench-band-warn" style="left:33%;width:33%"></div>
- <div class="aff-bench-band aff-bench-band-bad" style="left:66%;width:34%"></div>
- <div class="aff-bench-marker" id="affPremiumMarker" style="left:0%"></div>
- </div>
- <div class="aff-bench-scale" id="affPremiumScale">
- <span>0%</span><span>15%</span><span>30%</span><span>45%+</span>
- </div>
- </div>
- <div class="aff-bench-value" id="affPremiumPct">- %</div>
- </div>
- <div class="aff-bench-legend">
- <span class="aff-bench-leg-dot aff-bench-band-ok"></span><span>合理区</span>
- <span class="aff-bench-leg-dot aff-bench-band-warn"></span><span>警示区</span>
- <span class="aff-bench-leg-dot aff-bench-band-bad"></span><span>超出区</span>
- </div>
- </div>
- <div class="aff-tri-track" id="affDualTrack" style="display:none">
- <div class="aff-tri-head">
- <span style="font-size:16px">🎯</span>
- <span class="aff-tri-title">三轨配置建议 · 完整需求 vs 可负担方案 vs 自定义方案</span>
- <span class="aff-tri-edit-hint">💡 第三列「自定义方案」可<strong>直接编辑</strong>,Canvas 实时同步</span>
- </div>
- <table class="aff-tri-table" id="affTriTable">
- <thead>
- <tr>
- <th class="tri-col-name">险种</th>
- <th class="tri-col-full">A. 完整需求<span class="tri-col-sub">理论上限</span></th>
- <th class="tri-col-aff">B. 可负担方案<span class="tri-col-sub">系统推荐落地</span></th>
- <th class="tri-col-custom">C. 自定义方案<span class="tri-col-sub">代理人自定义</span></th>
- </tr>
- </thead>
- <tbody id="affTriTableBody">
- <!-- 由 JS 渲染 -->
- </tbody>
- <tfoot>
- <tr class="tri-total-row">
- <td>年缴合计</td>
- <td class="tri-num" id="triFullTotal">¥-</td>
- <td class="tri-num tri-num-aff" id="triAffTotal">¥-</td>
- <td class="tri-num tri-num-custom" id="triCustomTotal">¥-</td>
- </tr>
- <!-- [v4.7 Q1 + Jack 2026-06-21] 三档差异 mini badge · 让客户秒看出"自定义方案 vs 可负担/完整需求"差额 -->
- <tr class="tri-diff-row">
- <td style="font-size:11px;color:#7A6028;padding:6px 8px;font-weight:600">vs 完整需求</td>
- <td class="tri-diff-cell" style="text-align:center;padding:6px 8px;font-size:11px;color:#7A6028">基准</td>
- <td class="tri-diff-cell" id="triAffDiff" style="text-align:center;padding:6px 8px;font-size:11px"></td>
- <td class="tri-diff-cell" id="triCustomDiff" style="text-align:center;padding:6px 8px;font-size:11px"></td>
- </tr>
- </tfoot>
- </table>
- <div class="aff-tri-warn" id="triCustomWarn"></div>
- <div id="triExtraWarn"><!-- [v4.7] Q2 准退休护栏 + Q3 中端档现金流提示 由 renderAffordabilityCheck 注入 --></div>
- <div class="aff-dual-note">
- 💡 <strong>缩减策略 v2.9</strong>:刚需险(重疾/医疗/寿险)按完整需求保留;储蓄型险按比例缩减,但<strong>教育金按子女路径分级保留</strong> —— 留学(elite_us / full_overseas)floor 70% / 混合(domestic_plus)floor 50% / 国内 floor 30%,因签证 + 入学窗口刚性,留学不可缓。养老金可延后补足。<br>
- 🔵 <strong>自定义方案(C 列)</strong>默认 = 可负担方案,代理人可基于客户实际意愿微调每个险种 —— Canvas 现金流图会同步重画一条<strong style="color:#2B6CB0">蓝色虚线</strong>对照真实方案。
- </div>
- </div>
- </div>
- <!-- ===== [v4.5] 现金流规划段 · LDI 视角(60 年生命周期净现金流)===== -->
- <div class="cashflow-section" id="cashflowSection">
- <div class="cf-section-head">
- <span style="font-size:20px">💰</span>
- <span class="cf-section-title">现金流规划 · LDI 视角(60 年生命周期)</span>
- <span class="cf-section-meta">支出期(Y0-Y30 向上)+ 领取期(Y30-Y60 向下)· 服务于 Liability Driven Investment 全周期投资规划</span>
- </div>
- <div class="cf-chart-wrap">
- <div class="cf-chart-head">
- <span class="cf-chart-title">📊 60 年净现金流(¥万/年)</span>
- <span class="cf-chart-meta">↑ 流出 · 7 险种保费(支出)/ ↓ 流入 · 养老月领 + 教育返还 · 鼠标悬停查看年份明细</span>
- </div>
- <!-- [v4.5.2] 方案切换器 · 建议 vs 可负担 -->
- <div class="cf-scenario-switch">
- <span class="cf-scenario-label">展示方案:</span>
- <button class="cf-scenario-btn is-active" data-scenario="full" onclick="switchCfScenario('full')">
- <span class="scn-icon">📋</span>
- <span class="scn-name">建议方案</span>
- <span class="scn-detail" id="scnFullDetail">完整需求 · 年缴 ¥-</span>
- </button>
- <button class="cf-scenario-btn" data-scenario="affordable" onclick="switchCfScenario('affordable')">
- <span class="scn-icon">✓</span>
- <span class="scn-name">可负担方案</span>
- <span class="scn-detail" id="scnAffordableDetail">系统缩减 · 年缴 ¥-</span>
- </button>
- <button class="cf-scenario-btn is-custom" data-scenario="custom" onclick="switchCfScenario('custom')">
- <span class="scn-icon">🔵</span>
- <span class="scn-name">自定义方案</span>
- <span class="scn-detail" id="scnCustomDetail">代理人编辑 · 年缴 ¥-</span>
- </button>
- <span class="cf-scenario-hint" id="cfScenarioHint">💡 当前展示「建议方案」· 完整需求口径,养老/教育按完整 retireNeed/eduNeed 计算</span>
- </div>
- <!-- Canvas 趋势图 + tooltip · v4.5 高度增加给双向柱 -->
- <div class="cf-canvas-wrap" style="position:relative;width:100%">
- <canvas id="premiumTimelineCanvas" width="900" height="400" style="width:100%;height:auto;max-height:440px;display:block"></canvas>
- <div id="cfTooltip" class="cf-tooltip" style="display:none"></div>
- </div>
- <!-- 图例 (v4.5 加流入项) -->
- <div class="cf-legend">
- <span style="color:#7A6028;font-weight:600;font-size:11px;margin-right:6px">↑ 流出</span>
- <span class="cf-legend-item"><span class="cf-dot" style="background:#9B7C3A"></span>意外险</span>
- <span class="cf-legend-item"><span class="cf-dot" style="background:#C4973A"></span>高端医疗</span>
- <span class="cf-legend-item"><span class="cf-dot" style="background:#A61C2B"></span>重疾</span>
- <span class="cf-legend-item"><span class="cf-dot" style="background:#7A3FA0"></span>定期寿险</span>
- <span class="cf-legend-item"><span class="cf-dot" style="background:#3D6F8C"></span>养老金</span>
- <span class="cf-legend-item"><span class="cf-dot" style="background:#5DB890"></span>教育金</span>
- <span class="cf-legend-item"><span class="cf-dot" style="background:#7A5A8E"></span>终身寿险</span>
- <span style="border-left:1px solid #C9A84C;height:14px;margin:0 4px"></span>
- <span style="color:#2DB37C;font-weight:600;font-size:11px;margin-right:6px">↓ 流入</span>
- <span class="cf-legend-item"><span class="cf-dot" style="background:#2DB37C"></span>养老月领</span>
- <span class="cf-legend-item"><span class="cf-dot" style="background:#5DB890"></span>教育金返还</span>
- </div>
- </div>
- <!-- 关键节点说明 -->
- <div class="cf-insights" id="cfInsights">
- <!-- 由 renderPremiumTimeline 动态生成 -->
- </div>
- </div>
- <!-- v1.3 · 金字塔体检卡(取代 7 险种缺口图 · 与 PolicySummary 视觉一致) -->
- <div class="pyramid-check-card" id="pyramidCheckCard">
- <div class="pcc-svg-wrap">
- <!-- v3.2.1 · 金字塔左上工具开关(水位动画 / 立体感)-->
- <div class="pyramid-controls" data-card="cy_calc">
- <button class="pc-toggle" data-key="anim" data-on="1" title="水位动画 · 开:显示实际覆盖率水位 · 关:显示满覆盖原色对照(用于看缺口)">
- <span class="tg-dot"></span><span class="tg-label">💧 实际</span>
- </button>
- <button class="pc-toggle" data-key="stereo" data-on="1" title="立体感开关 · 关闭后金字塔变扁平,适合白天演示反光环境">
- <span class="tg-dot"></span><span class="tg-label">🎨 3D</span>
- </button>
- </div>
- <svg viewBox="0 0 280 240" id="calcPyramidSvg"></svg>
- </div>
- <div class="pcc-info">
- <h3>家族风险金字塔体检
- <span class="pcc-label-badge" id="pccLabelBadge"></span>
- </h3>
- <div class="pcc-tier-rows" id="pccTierRows"></div>
- <div class="pcc-diagnosis" id="pccDiagnosis">
- <div class="pcc-diag-msg" id="pccDiagMsg"></div>
- <div class="pcc-diag-text" id="pccDiagText"></div>
- </div>
- <div class="pcc-score-strip">
- <div>
- <div class="pcc-ss-num" id="pccScoreNum">—<span class="pcc-ss-suffix">/ 10</span></div>
- </div>
- <div class="pcc-ss-label">家族风险综合评分<br/><span style="opacity:.7;font-size:10px">已买保险 6.0 起评 · 配置完整度加分 · 险种均衡度加分</span></div>
- </div>
- </div>
- </div>
- <!-- [v4.8 · 2026-06-26] 年缴保费分配 donut 图已移除(冗余信息) · JS 函数保留 -->
- <!-- 7 险种卡片 · v3.0 v1.2 · 按金字塔三层强制分行 -->
- <div class="policy-grid">
- <!-- ━━━ 🟧 基础风险层(进/防 · 没钱 · 损失性风险 · 所有家庭必配) ━━━ -->
- <div class="tier-banner-row tb-base">
- <span class="tb-emoji">🟧</span>
- <span>基础风险层</span>
- <span class="tb-meta">进 / 防 · 损失性风险 · 解决"没钱"问题 · 所有家庭必配</span>
- <span class="tb-progress" id="tbBaseProgress">
- <span class="tb-bar-track"><span class="tb-bar-fill" id="tbBaseFill" style="width:0%"></span></span>
- <span class="tb-pct" id="tbBasePct">—</span>
- <span class="tb-status-icon" id="tbBaseIcon">○</span>
- </span>
- </div>
- <div class="tier-row tier-base">
- <!-- 1.1 意外险(基础) -->
- <div class="policy-card accident" data-tier="base">
- <span class="pc-tier-badge">🟧 基础</span>
- <div class="pc-head">
- <span class="pc-icon">⚡</span>
- <span class="pc-status" id="accStatus" title="缺口状态">—</span>
- <span class="pc-title">意外险</span>
- <span class="pc-tag">ACCIDENT</span>
- </div>
- <div class="pc-amount" id="accAmount">¥ -<span class="unit">万</span></div>
- <div class="pc-amount-sub">突发性身故/伤残的家庭维持缓冲 · 5 年家庭支出</div>
- <div class="pc-bar">
- <div class="pc-bar-meta"><span>现有 <span class="v" id="accExisting">¥0万</span></span><span>缺口 <span class="v" id="accGapText">¥0万</span></span></div>
- <div class="pc-bar-track"><div class="pc-bar-existing" id="accBarExist" style="width:0%"></div><div class="pc-bar-gap" id="accBarGap" style="width:0%"></div></div>
- </div>
- <div class="pc-formula">
- <strong>公式</strong> 意外险保额 = 年支出 × 5(覆盖 5 年家庭维持缓冲)
- <span class="formula-line" id="accCalc">= --</span>
- <span class="formula-line">▸ 推荐:**百万意外险**(高保额低保费 · 1500-3000 元/年)</span>
- </div>
- <div class="pc-meta">
- <span class="pc-meta-label">建议年缴保费</span>
- <span class="pc-meta-value" id="accPremium">¥ -</span>
- </div>
- </div>
- <!-- 1.2 医疗险(基础) -->
- <div class="policy-card med" data-tier="base">
- <span class="pc-tier-badge">🟧 基础</span>
- <div class="pc-head">
- <span class="pc-icon">💚</span>
- <span class="pc-status" id="medStatus" title="缺口状态">—</span>
- <span class="pc-title">医疗险</span>
- <span class="pc-tag">HIGH-END MEDICAL</span>
- </div>
- <div class="pc-amount" id="medAmount">¥ 800<span class="unit">万</span></div>
- <div class="pc-amount-sub">推荐保额 · cover 境内顶级私立 + 海外医疗</div>
- <div class="pc-bar">
- <div class="pc-bar-meta"><span>现有 <span class="v" id="medExisting">无</span></span><span id="medGapWrap">缺口 <span class="v" id="medGapText">¥800万</span></span></div>
- <div class="pc-bar-track"><div class="pc-bar-existing" id="medBarExist" style="width:0%"></div><div class="pc-bar-gap" id="medBarGap" style="width:100%"></div></div>
- </div>
- <div class="pc-formula">
- <strong>公式</strong> 800 万固定建议
- <span class="formula-line">▸ 覆盖治疗费 + 康复费 → 让重疾纯做收入替代</span>
- <span class="formula-line">▸ 推荐:**国际医疗险**(覆盖境内顶级私立 + 海外医疗)</span>
- </div>
- <div class="pc-meta">
- <span class="pc-meta-label">建议年缴保费</span>
- <span class="pc-meta-value" id="medPremium">¥ -</span>
- </div>
- </div>
- <!-- 1.3 重疾险(基础) -->
- <div class="policy-card ci" data-tier="base">
- <span class="pc-tier-badge">🟧 基础</span>
- <div class="pc-head">
- <span class="pc-icon">🔴</span>
- <span class="pc-status" id="ciStatus" title="缺口状态">—</span>
- <span class="pc-title">重疾险</span>
- <span class="pc-tag">CRITICAL ILLNESS</span>
- </div>
- <div class="pc-amount" id="ciAmount">¥ -<span class="unit">万</span></div>
- <div class="pc-amount-sub">建议保额 · 用于 5 年康复期收入替代</div>
- <div class="pc-bar">
- <div class="pc-bar-meta"><span>现有 <span class="v" id="ciExisting">¥0万</span></span><span>缺口 <span class="v" id="ciGapText">¥0万</span></span></div>
- <div class="pc-bar-track"><div class="pc-bar-existing" id="ciBarExist" style="width:0%"></div><div class="pc-bar-gap" id="ciBarGap" style="width:0%"></div></div>
- </div>
- <div class="pc-formula">
- <strong>公式</strong> 重疾保额 = 年收入 × N(倍数,默认 3,可调 2-5)
- <span class="formula-line">▸ 因高端医疗 cover 治疗费,重疾纯粹用于收入替代</span>
- <span class="formula-line" id="ciCalc">= --</span>
- </div>
- <div class="pc-meta">
- <span class="pc-meta-label">建议年缴保费</span>
- <span class="pc-meta-value" id="ciPremium">¥ -</span>
- </div>
- </div>
- </div><!-- /.tier-row.tier-base -->
- <!-- ━━━ 🟨 中端风险层(出/增 · 花钱 · 支出性风险 + 收入替代) ━━━ -->
- <!-- [v4.8 · 2026-06-26] 中端 tier 外侧暖色 wrap(白带 → 暖底) -->
- <div class="tier-band-wrap tier-band-wrap--warm">
- <div class="tier-banner-row tb-mid">
- <span class="tb-emoji">🟨</span>
- <span>中端风险层</span>
- <span class="tb-meta">出 / 增 · 支出性风险 · 解决"花钱"问题 · 中产 + 中高净值</span>
- <span class="tb-progress" id="tbMidProgress">
- <span class="tb-bar-track"><span class="tb-bar-fill" id="tbMidFill" style="width:0%"></span></span>
- <span class="tb-pct" id="tbMidPct">—</span>
- <span class="tb-status-icon" id="tbMidIcon">○</span>
- </span>
- </div>
- <div class="tier-row tier-mid">
- <!-- 2.1 教育年金(中端) -->
- <div class="policy-card education" data-tier="mid">
- <span class="pc-tier-badge">🟨 中端</span>
- <div class="pc-head">
- <span class="pc-icon">🎓</span>
- <span class="pc-status" id="eduStatus" title="缺口状态">—</span>
- <span class="pc-title">教育年金</span>
- <span class="pc-tag">EDUCATION FUND</span>
- </div>
- <div class="pc-amount" id="eduAmount">¥ -<span class="unit">万</span></div>
- <div class="pc-amount-sub">所有子女教育金合计 · 含 5% 教育通胀</div>
- <div class="pc-bar">
- <div class="pc-bar-meta"><span>已储备 <span class="v" id="eduExisting">¥0万</span></span><span>缺口 <span class="v" id="eduGapText">¥0万</span></span></div>
- <div class="pc-bar-track"><div class="pc-bar-existing" id="eduBarExist" style="width:0%"></div><div class="pc-bar-gap" id="eduBarGap" style="width:0%"></div></div>
- </div>
- <div class="pc-formula">
- <strong>公式</strong> Σ(单子女单价 × (1.05)^到大学剩余年数) - 储备
- <span class="formula-line" id="eduCalc">--</span>
- </div>
- <div class="pc-meta">
- <span class="pc-meta-label">建议年缴保费 (10 年缴)</span>
- <span class="pc-meta-value" id="eduPremium">¥ -</span>
- </div>
- </div>
- <!-- 2.2 养老年金(中端) -->
- <div class="policy-card retirement" data-tier="mid">
- <span class="pc-tier-badge">🟨 中端</span>
- <div class="pc-head">
- <span class="pc-icon">💰</span>
- <span class="pc-status" id="retireStatus" title="缺口状态">—</span>
- <span class="pc-title">养老年金</span>
- <span class="pc-tag">RETIREMENT</span>
- </div>
- <div class="pc-amount" id="retireAmount">¥ -<span class="unit">万</span></div>
- <div class="pc-amount-sub">退休后总缺口 · 维持现有生活水平</div>
- <div class="pc-bar">
- <div class="pc-bar-meta"><span>已储备 <span class="v" id="retireExisting">¥0万</span></span><span>缺口 <span class="v" id="retireGapText">¥0万</span></span></div>
- <div class="pc-bar-track"><div class="pc-bar-existing" id="retireBarExist" style="width:0%"></div><div class="pc-bar-gap" id="retireBarGap" style="width:0%"></div></div>
- </div>
- <div class="pc-formula">
- <strong>公式</strong> 退休后月支出 = 年薪 × 替代率 / 12 · 月缺口 × 12 × 年金终值因子
- <span class="formula-line" id="retireCalc1">退休后月支出 = - </span>
- <span class="formula-line" id="retireCalc2">月缺口(扣社保 ¥1.2万) × 12 × 年金现值因子(PV) = -</span>
- </div>
- <div class="pc-meta">
- <span class="pc-meta-label">建议年缴保费</span>
- <span class="pc-meta-value" id="retirePremium">¥ -</span>
- </div>
- </div>
- <!-- 2.3 定期寿险(中端 · 主理人收入替代 · DIME 公式) -->
- <div class="policy-card life" id="lifeCard" data-tier="mid">
- <span class="pc-tier-badge">🟨 中端</span>
- <div class="pc-head">
- <span class="pc-icon">🛡</span>
- <span class="pc-status" id="lifeStatus" title="缺口状态">—</span>
- <span class="pc-title">定期寿险</span>
- <span class="pc-tag">TERM LIFE</span>
- <span class="hnw-tag" id="hnwBadge" style="display:none">HNW 模式</span>
- </div>
- <div class="pc-amount" id="lifeAmount">¥ -<span class="unit">万</span></div>
- <div class="pc-amount-sub" id="lifeAmountSub">建议保额 · 主理人意外身故时的家庭保障</div>
- <div class="pc-bar">
- <div class="pc-bar-meta"><span>现有 <span class="v" id="lifeExisting">¥0万</span></span><span>缺口 <span class="v" id="lifeGapText">¥0万</span></span></div>
- <div class="pc-bar-track"><div class="pc-bar-existing" id="lifeBarExist" style="width:0%"></div><div class="pc-bar-gap" id="lifeBarGap" style="width:0%"></div></div>
- </div>
- <div class="pc-formula" id="dimeFormula">
- <strong>DIM 公式</strong> = 房贷+负债 + 收入替代(主理人占比 · 折现到现值) - 现有资产
- <span class="formula-line" id="lifeCalcD">D = -</span>
- <span class="formula-line" id="lifeCalcI">I = -</span>
- <span class="formula-line" id="lifeCalcE" style="opacity:.55">E = (教育金已在独立险种,寿险不重复计入)</span>
- <span class="formula-line" id="lifeCalcA">A = -</span>
- </div>
- <div class="pc-meta">
- <span class="pc-meta-label">建议年缴保费</span>
- <span class="pc-meta-value" id="lifePremium">¥ -</span>
- </div>
- </div>
- </div><!-- /.tier-row.tier-mid -->
- </div><!-- /.tier-band-wrap (中端 v4.8 暖底) -->
- <!-- ━━━ 🟡 高端风险层(保/传 · 留钱 · 所有性风险 · UHNW/跨境配置) ━━━ -->
- <!-- [v4.8 · 2026-06-26] 高端 tier 外加全宽暖底 wrap(结构对称) -->
- <div class="tier-band-wrap tier-band-wrap--warm">
- <div class="tier-banner-row tb-high">
- <span class="tb-emoji">🟡</span>
- <span>高端风险层</span>
- <span class="tb-meta">保 / 传 · 所有性风险 · 解决"留钱"问题 · UHNW / 跨境配置</span>
- <span class="tb-progress" id="tbHighProgress">
- <span class="tb-bar-track"><span class="tb-bar-fill" id="tbHighFill" style="width:0%"></span></span>
- <span class="tb-pct" id="tbHighPct">—</span>
- <span class="tb-status-icon" id="tbHighIcon">○</span>
- </span>
- </div>
- <div class="tier-row tier-high">
- <!-- 3.1 终身寿险(高端 · 整行 · 含境内/境外双 Tab) -->
- <div class="policy-card whole-life" data-tier="high">
- <span class="pc-tier-badge">🟡 高端</span>
- <div class="pc-head">
- <span class="pc-icon">💎</span>
- <span class="pc-status" id="wlStatus" title="缺口状态">—</span>
- <span class="pc-title">终身寿险</span>
- <span class="pc-tag">WHOLE LIFE · 传承隔离 · 装入信托</span>
- </div>
- <div class="pc-amount" id="wlAmount">¥ -<span class="unit">万</span></div>
- <div class="pc-amount-sub">资产传承隔离基线 · 总资产 × 30%</div>
- <div class="pc-bar">
- <div class="pc-bar-meta"><span>现有 <span class="v" id="wlExisting">¥0万</span></span><span>缺口 <span class="v" id="wlGapText">¥0万</span></span></div>
- <div class="pc-bar-track"><div class="pc-bar-existing" id="wlBarExist" style="width:0%"></div><div class="pc-bar-gap" id="wlBarGap" style="width:0%"></div></div>
- </div>
- <div class="pc-formula">
- <strong>公式</strong> 终身寿保额 = 总资产 × 30%(传承隔离基线)
- <span class="formula-line" id="wlCalc">= --</span>
- </div>
- <!-- [v3.6] 双轨展示:境内增额终身寿 + 境外 IUL/VUL/PPLI(分级) -->
- <!-- [v4.8] 加 ic-hnw-wrap class · L2 金调全宽 band(高级功能区视觉提示)-->
- <div id="hnwTabsWrap" class="ic-hnw-wrap" data-collapsed="1">
- <div class="hnw-toggle" onclick="toggleHnwTabs(this)" style="cursor:pointer;display:flex;align-items:center;justify-content:space-between;padding:12px 16px;background:linear-gradient(90deg,rgba(122,63,160,0.08) 0%,rgba(212,169,58,0.08) 100%);border:1px solid rgba(122,63,160,0.25);border-radius:8px;font-size:13px;font-weight:700;color:#3B1A52;letter-spacing:0.4px;transition:all 0.2s">
- <span><span class="hnw-toggle-arrow" style="display:inline-block;transition:transform 0.2s;margin-right:8px">▶</span>境内 / 境外双轨配置详情(产品 / 杠杆 / 法律)</span>
- <span class="hnw-toggle-hint" style="font-size:11px;font-weight:600;color:#7A3FA0;opacity:0.7">点击展开</span>
- </div>
- <div class="hnw-detail-body" style="display:none;margin-top:14px">
- <div class="life-tabs">
- <div class="life-track-tab active" onclick="switchLifeTrack('domestic', this)">🇨🇳 境内增额终身寿</div>
- <div class="life-track-tab" onclick="switchLifeTrack('overseas', this)">🌏 境外 · IUL / VUL / PPLI ★</div>
- </div>
- <!-- 境内 Tab · v3.6 加回:境内增额终身寿 -->
- <div class="life-track-pane active" id="lifeTrackDomestic">
- <div class="life-track-amount" id="domesticAmount">¥ -<span class="unit">亿</span></div>
- <div class="life-track-amount-sub">境内增额终身寿建议 · 主理人 + 配偶分散投保</div>
- <div class="pc-formula">
- <strong>境内增额终身寿拆解</strong>
- <span class="formula-line" id="domesticCalc1">▸ 主理人 = -</span>
- <span class="formula-line" id="domesticCalc2">▸ 配偶补充 = -</span>
- <span class="formula-line" id="domesticCalc3">⚠ 64 岁以上 + 健康因素综合上限 ¥3-5 亿/单人</span>
- </div>
- <div class="hnw-hl-box">
- <strong>📦 推荐配置类型</strong> 境内增额终身寿(主)+ 终身寿(配偶补充 · 分散投保)<br>
- <strong>💰 杠杆</strong> 5-10x · 杠杆比 = 保额 / 总保费(20-30 年缴清)<br>
- <strong>⚖ 法律</strong> 《保险法》§42 · 指定受益人 · 不属遗产 · 免个税<br>
- <strong>🏷 推荐产品</strong> 友邦传世金生 / 中宏盈丰 / 平安御享金生 / 中国人寿鑫盈鸿利
- </div>
- </div>
- <!-- 境外 Tab · v3.6 重设计:IUL / VUL / PPLI 分级 -->
- <div class="life-track-pane" id="lifeTrackOverseas">
- <div class="life-track-amount" id="overseasAmount">¥ -<span class="unit">亿</span></div>
- <div class="life-track-amount-sub" id="overseasAmountSub">境外终身寿险 · 按资产档分级推荐</div>
- <div class="pc-formula">
- <strong>境外终身寿拆解</strong>
- <span class="formula-line" id="overseasCalc1">▸ 推荐档位 = -</span>
- <span class="formula-line" id="overseasCalc2">▸ 装入资产 = -</span>
- <span class="formula-line" id="overseasCalc3" style="color:var(--accent)">⚠ AUM < $2000 万美金不启用 PPLI · 优先 IUL / VUL · 建议 3-5 张保单分批配置</span>
- </div>
- <table class="ppli-table" id="ppliTableWrapper">
- <thead><tr><th>装入资产类别</th><th>装入比例</th><th class="num">境外保额(¥万)</th></tr></thead>
- <tbody id="ppliTableBody">
- <!-- 由 JS 渲染 -->
- </tbody>
- </table>
- <div class="hnw-hl-box">
- <strong>🌏 跨境通道</strong> 持牌境外保险公司(开曼/百慕大/列支敦士登)· 通过持牌经纪通道办理<br>
- <strong>✓ 产品分级</strong>
- · IUL(指数型万能寿险)入门款 - $500 万美金以下 ·
- · VUL(投连型万能寿险)中段 - $500-2000 万美金 ·
- · <strong style="color:var(--accent)">PPLI(私募定制寿险)顶级 - $2000 万美金以上(¥1.4 亿)</strong><br>
- <strong>✓ 杠杆倍数</strong> 35-45 岁 80x · 46-55 岁 40x · 56-65 岁 20x · 66+ 岁 10x(Benchmark middle-funded · 健康标体非吸烟测算)<br>
- <strong>✓ 免遗产税</strong> 死亡赔付按保单计税(美籍二代 40% 税率重灾区)<br>
- <strong>✓ 跨境合规</strong> CRS / FATCA 友好 · 跨代信托受益(STAR/VISTA)<br>
- <strong>🏷 推荐产品</strong> Sun Life Hong Kong IUL / Manulife Singapore SIUL3 / NHW Life Solution PPLI<br>
- <strong style="color:var(--c-red)">⚠ 实操建议</strong> 跨境美籍/大额保额建议 3-5 张保单分批配置(单笔 ¥3000-5000 万),避免单保单核保压力 + 分散通道风险
- </div>
- </div>
- <div class="dual-track-summary">
- <span class="lbl">境内 / 境外 配置比例</span>
- <span class="ratio" id="dualRatio">-</span>
- <span class="lbl">终身寿合计</span>
- <span class="ratio" id="dualTotal">-</span>
- </div>
- </div><!-- /.hnw-detail-body -->
- </div>
- <!-- 非 HNW 客户提示(v3.1 · 双轨详情已默认折叠 · 此提示文案配合调整) -->
- <div id="wlNonHnwHint" style="margin-top:14px;padding:12px 16px;background:rgba(201,168,76,0.08);border-left:3px solid #C9A84C;border-radius:6px;font-size:12px;line-height:1.6;color:#5C4810">
- 💡 <strong>当前为普通家庭模式</strong> · 终身寿险按"总资产 × 30%"展示传承隔离基线建议。「境内 / 境外双轨详情」默认折叠,展开可查看产品 / 杠杆 / PPLI 装入资产明细(高净值场景配置)。
- </div>
- <div class="pc-meta">
- <span class="pc-meta-label">建议年缴保费</span>
- <span class="pc-meta-value" id="wlPremium">¥ -</span>
- </div>
- </div>
- </div><!-- /.tier-row.tier-high -->
- </div><!-- /.tier-band-wrap (高端 v4.8 暖底) -->
- </div><!-- /.policy-grid -->
- <!-- 配置优先级 · 接下来要做什么(v2026-06-13) -->
- <!-- [v4.8 · 2026-06-26] 外加全宽白带 wrap(由 pale-gold 改为 white) -->
- <div class="tier-band-wrap tier-band-wrap--white">
- <div class="priority-section" id="prioritySection">
- <div class="priority-head">
- <span style="font-size:20px">⏵</span>
- <span class="priority-title">配置优先级 · 接下来要做什么</span>
- <span class="priority-meta">基于 7 险种 × 风险金字塔三层 · 自动按 tier 优先级 + 缺口大小排序</span>
- </div>
- <div class="priority-subtitle">
- 系统按缺口金额 + 紧迫度 + 投保窗口期综合排序 · 数字越靠前优先级越高 · 每项配套**具体下一步行动**(产品 / 通道 / 时间窗口)。代理人可基于此清单为客户制定 90 天 / 180 天 / 365 天行动计划。
- </div>
- <div class="priority-list" id="priorityList">
- <!-- 由 renderPriorityTimeline() 渲染 -->
- </div>
- </div>
- </div><!-- /.tier-band-wrap (priority white v4.8) -->
- <!-- [v4.8 · 2026-06-26] 高净值差异化建议卡已移除(信息冗余 · 已被客户一页总结取代)
- JS 函数 renderUhnwSuggestions() 保留,DOM 缺失时早期 return,不影响渲染 -->
- <!-- [v4.8 · 2026-06-26] 客户家庭报告 · 一页总结(报告尾部"客户带走"卡)-->
- <!-- 外侧暖色 wrap(pale-gold → warm 2026-06-26) -->
- <div class="tier-band-wrap tier-band-wrap--warm">
- <div class="client-summary-card" id="clientSummaryCard">
- <div class="cs-head">
- <span class="cs-icon">📋</span>
- <span class="cs-title">您的家庭保障 · 一页总结</span>
- <span class="cs-tag">CLIENT TAKEAWAY</span>
- </div>
- <div class="cs-subtitle">30 秒带走的核心信息 · 您看完整份报告后,只需记住这一页</div>
- <!-- 一句话诊断 -->
- <div class="cs-headline" id="csHeadline">
- <!-- 由 renderClientSummary() 渲染 -->
- </div>
- <!-- 关键指标 4 项 -->
- <div class="cs-metrics" id="csMetrics">
- <div class="cs-metric">
- <div class="cs-metric-label">总缺口</div>
- <div class="cs-metric-value" id="csMetricGap">¥ -</div>
- <div class="cs-metric-sub">7 险种合计</div>
- </div>
- <div class="cs-metric">
- <div class="cs-metric-label">综合评分</div>
- <div class="cs-metric-value" id="csMetricScore">- / 10</div>
- <div class="cs-metric-sub" id="csMetricScoreLabel">—</div>
- </div>
- <div class="cs-metric">
- <div class="cs-metric-label">最大缺口</div>
- <div class="cs-metric-value cs-metric-value-text" id="csMetricMaxGap">—</div>
- <div class="cs-metric-sub" id="csMetricMaxGapAmt">¥ -</div>
- </div>
- <div class="cs-metric">
- <div class="cs-metric-label">年缴 / 年薪</div>
- <div class="cs-metric-value" id="csMetricRatio">- %</div>
- <div class="cs-metric-sub" id="csMetricRatioLabel">—</div>
- </div>
- </div>
- <!-- 接下来 3 件事 -->
- <div class="cs-actions-head">🎯 接下来 3 件事 · 按时间窗口排优先级</div>
- <div class="cs-actions" id="csActions">
- <!-- 由 renderClientSummary() 渲染 3 个 cs-action 块 -->
- </div>
- <!-- 顾问联系 -->
- <div class="cs-cta">
- <div class="cs-cta-msg">💬 准备好了吗?联系您的 1v1 顾问开始下一步</div>
- <div class="cs-cta-contact">
- <strong>Jack · Benchmark Wealth</strong>
- <span class="cs-cta-divider">|</span>
- <span>微信 jackpara</span>
- <span class="cs-cta-divider">|</span>
- <span>邮箱 jack@benchmarkwealth.com</span>
- </div>
- </div>
- </div>
- </div><!-- /.tier-band-wrap (client-summary 暖底 v4.8) -->
- <!-- Phase 3 · 推荐产品区(接 products-bundle.js) -->
- <!-- [v4.8 · 2026-06-26] 外加全宽白带 wrap -->
- <div class="tier-band-wrap tier-band-wrap--white">
- <div class="product-section">
- <div class="gap-chart-head">
- <span style="font-size:18px">📦</span>
- <span class="gap-chart-title">推荐产品 · 真实产品库匹配</span>
- <span class="gap-chart-meta">数据来源 products-bundle.js · 33 款产品池</span>
- </div>
- <div class="product-tabs">
- <div class="product-tab active" onclick="switchProductTab('onshore', this)">🇨🇳 境内寿险/年金</div>
- <div class="product-tab" onclick="switchProductTab('offshore', this)">🌏 境外 IUL / VUL / PPLI</div>
- </div>
- <div class="product-pane active" id="productPaneOnshore">
- <div class="product-grid" id="onshoreProducts"></div>
- </div>
- <div class="product-pane" id="productPaneOffshore">
- <div class="product-grid" id="offshoreProducts"></div>
- </div>
- </div>
- </div><!-- /.tier-band-wrap (product-section white v4.8) -->
- <div class="calc-row">
- <button class="btn btn-ghost" onclick="document.getElementById('result').style.display='none';window.scrollTo({top:0,behavior:'smooth'})">↺ 重新填写</button>
- <button class="btn btn-ghost" onclick="window.print()">📥 导出 PDF / 打印</button>
- <button class="btn btn-primary" onclick="alert('1v1 顾问咨询\\n\\n联系 Jack:\\n• 微信: jackpara\\n• 邮箱: jack@chengyan.com\\n\\nBenchmark Wealth · 保险配置专项咨询')">📞 对接 1v1 顾问咨询</button>
- </div>
- </div>
- <!-- Footer -->
- <div class="footer">
- Benchmark Wealth © 2026 · Insurance Calculator v5.1 · Powered by 助飞科技
- <div class="disclaimer">
- ⚠ 保额建议基于行业公式(DIME / 5 倍年收入 / 教育金通胀)演算,**仅供代理人现场参考**。<br>
- 具体配置以 Benchmark Wealth 1v1 服务 + 完整 CFPI 评测 + 持牌代理人核保结果为准。本工具不构成保险销售建议。
- </div>
- </div>
- </div>
- <!-- 产品详情 Modal(v2026-06-13 · 点击产品卡弹出)-->
- <div class="product-modal" id="productModal" onclick="if(event.target===this)closeProductModal()">
- <div class="pm-card" id="pmCard">
- <button class="pm-close" onclick="closeProductModal()" title="关闭">✕</button>
- <div id="pmContent"><!-- 由 showProductModal() 渲染 --></div>
- </div>
- </div>
- </div><!-- /.cy-main -->
- </div><!-- /.cy-app -->
- <!-- ============================================================== -->
- <!-- 计算引擎 v1.0 · Phase 1 MVP + Phase 2 portrait 接入 + Phase 3 -->
- <!-- ============================================================== -->
- <!-- v5.0:cy-config.js(平台开关·白标版不带)+ cy-sidebar.js(mode-aware 侧栏)-->
- <script src="data/cy-config.js"></script>
- <script src="data/portraits-bundle.js"></script>
- <script src="data/cy-portraits-extended.js"></script>
- <script src="data/products-bundle.js"></script>
- <script src="data/cy-renderer.js?v=20260611a"></script>
- <script src="data/cy-policy-meta.js?v=20260613a"></script>
- <script src="data/cy-sidebar.js?v=20260716-ssot3"></script>
- <script src="data/cy-ic-tabs.js?v=20260711-phase2-v3"></script>
- <script src="data/cy-client-context.js?v=20260718"></script>
- <script>
- // v5.0 · 渲染 mode-aware 常驻侧栏(保额计算器 active)
- (function(){
- function boot(){
- if (!window.CYSidebar) { console.warn('[IC v5.0] CYSidebar 未加载'); return; }
- window.CYSidebar.render({
- mount: '#cy-sidebar-mount',
- activeKey: 'insurance',
- moduleName: '保额计算器',
- moduleEn: 'Insurance Calculator',
- demoUrl: '#', // 独立版 CTA:预约演示(部署时填真实地址)
- contactUrl: '#' // 独立版 CTA:联系顾问
- });
- }
- if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', boot);
- else boot();
- })();
- </script>
- <script>
- 'use strict';
- // ============================================================
- // v3.0 跨页跳转预填 · 接收 PolicySummary 的 cy_calc_prefill
- // ============================================================
- (function applyCrossPagePrefill() {
- try {
- const raw = sessionStorage.getItem('cy_calc_prefill');
- if (!raw) return;
- const prefill = JSON.parse(raw);
- sessionStorage.removeItem('cy_calc_prefill');
- // 5 分钟过期(避免老 prefill 误触发)
- if (prefill.timestamp && Date.now() - prefill.timestamp > 5 * 60 * 1000) return;
- // 等待 DOM ready 后写入
- function apply() {
- // 1. 写姓氏
- const surnameEl = document.getElementById('surname');
- if (surnameEl && prefill.insured_name) {
- surnameEl.value = prefill.insured_name.replace(/\s/g, '').slice(0, 1) || prefill.insured_name;
- }
- // 2. 显示一个高亮提示条(在 hero 后插入)
- if (prefill.risk_dimension) {
- const hero = document.querySelector('.hero');
- if (hero && !document.getElementById('xpagePrefillBanner')) {
- const banner = document.createElement('div');
- banner.id = 'xpagePrefillBanner';
- banner.style.cssText = [
- 'margin:18px 0;padding:14px 20px;border-radius:8px',
- 'background:linear-gradient(90deg,rgba(155,124,58,0.12) 0%,rgba(155,124,58,0.04) 100%)',
- 'border-left:4px solid #C9A84C;color:#5C4810;font-size:13px;line-height:1.55'
- ].join(';');
- const gapWan = (prefill.gap_cents || 0) / 100 / 10000;
- const gapStr = gapWan >= 10000
- ? (gapWan / 10000).toFixed(2) + ' 亿'
- : Math.round(gapWan).toLocaleString('zh-CN') + ' 万';
- banner.innerHTML =
- '🎯 <strong>从保单汇总携带过来</strong>:' +
- (prefill.insured_name || '客户') + ' · ' +
- '<strong>' + prefill.risk_dimension + '</strong> 缺口 ' +
- '<strong style="color:#B71C1C">¥' + gapStr + '</strong>' +
- ' · 已自动填充姓氏,请补充其他字段后点击「📊 计算 7 险种保额」';
- hero.parentNode.insertBefore(banner, hero.nextSibling);
- }
- }
- console.log('[v3.0 prefill] 已应用 PolicySummary 跨页参数:', prefill);
- }
- if (document.readyState === 'loading') {
- document.addEventListener('DOMContentLoaded', apply);
- } else {
- apply();
- }
- } catch(e) { console.warn('[v3.0 prefill]', e); }
- })();
- /* === 教育路径单价 (¥万/子女) === */
- const EDU_PATH_COST = {
- 'domestic': 100,
- 'domestic_plus': 250,
- 'full_overseas': 600,
- 'elite_us': 1000
- };
- /* === Phase 4 · 9 个预设客户画像(代表性场景库) ===
- [v2.9 完善] 每个画像加 v29_params 块,按场景调优 retireRatio/ciMul/cap/discount;
- HNW 画像加 aumWan(让 v2.9 AUM 分母模式完整生效)
- */
- const CLIENT_PERSONAS = [
- {
- id: 'middle_3', tier: 'std', name: '三口之家·中产',
- forceHNW: false,
- data: {
- surname:'李', age:35, gender:'M', marriage:'married',
- childCount:1, childAge1:5, childAge2:'', childAge3:'',
- eduPath:'domestic_plus',
- salary:50, spouseSalary:30, mortgage:200, otherDebt:0, liquidAssets:50,
- primaryResidence:500, investAssets:0, overseasAssets:0, // [v4.2] 默认无境外资产
- existingLife:100, existingCI:30, existingMed:'0',
- existingRetirement:0, existingEduInsurance:0,
- retireAge:60, lifeExpectancy:90
- },
- v29_params: {
- retireLifestyleRatio: 0.70,
- incomeDiscountRate: 0.03,
- ciMultiplier: 3,
- affordabilityCap: 0.20,
- // [v3.5 新增] NewClient 完整导入字段
- surname_en: 'Li',
- name_en: 'Li Ming',
- family_name_en: 'The Li Family',
- nationality: 'cn',
- residence_city: '上海',
- industry: '一线城市中产 · 互联网/金融行业 G1 双职工'
- }
- },
- {
- id: 'two_child', tier: 'std', name: '二孩·新中产',
- forceHNW: false,
- data: {
- surname:'王', age:40, gender:'M', marriage:'married',
- childCount:2, childAge1:10, childAge2:5, childAge3:'',
- eduPath:'full_overseas',
- salary:100, spouseSalary:50, mortgage:500, otherDebt:0, liquidAssets:300,
- primaryResidence:800, investAssets:300, overseasAssets:0, // [v4.2] 中产无境外资产
- existingLife:200, existingCI:50, existingMed:'1',
- existingRetirement:0, existingEduInsurance:0,
- retireAge:60, lifeExpectancy:90
- },
- v29_params: {
- retireLifestyleRatio: 0.70,
- incomeDiscountRate: 0.03,
- ciMultiplier: 4, // 主理人 40 岁高峰 + 双子女留学
- affordabilityCap: 0.20,
- surname_en: 'Wang',
- name_en: 'Wang Hao',
- family_name_en: 'The Wang Family',
- nationality: 'cn',
- residence_city: '杭州',
- industry: '新一线城市新中产 · 高科技/互联网 G1 双职工'
- }
- },
- {
- id: 'single_lady', tier: 'std', name: '单身贵族·一线女',
- forceHNW: false,
- data: {
- surname:'林', age:32, gender:'F', marriage:'single',
- childCount:0, childAge1:'', childAge2:'', childAge3:'',
- eduPath:'domestic',
- salary:80, spouseSalary:0, mortgage:250, otherDebt:0, liquidAssets:150,
- primaryResidence:500, investAssets:50, overseasAssets:0, // [v4.2] 一线无境外资产
- existingLife:50, existingCI:30, existingMed:'0',
- existingRetirement:0, existingEduInsurance:0,
- retireAge:55, lifeExpectancy:90
- },
- v29_params: {
- retireLifestyleRatio: 0.85, // 单身靠自己,养老不降标
- incomeDiscountRate: 0.03,
- ciMultiplier: 4, // 单身没人兜底
- affordabilityCap: 0.30, // 无子女 + 高储蓄能力
- surname_en: 'Lin',
- name_en: 'Lin Yixin',
- family_name_en: 'The Lin Family',
- nationality: 'cn',
- residence_city: '上海',
- industry: '单身白领 · 金融/咨询行业资深经理'
- }
- },
- {
- id: 'dink', tier: 'std', name: 'DINK·双高收入',
- forceHNW: false,
- data: {
- surname:'张', age:38, gender:'M', marriage:'married',
- childCount:0, childAge1:'', childAge2:'', childAge3:'',
- eduPath:'domestic',
- salary:100, spouseSalary:80, mortgage:600, otherDebt:0, liquidAssets:400,
- primaryResidence:1200, investAssets:400, overseasAssets:0, // [v4.2] DINK 默认无境外
- existingLife:100, existingCI:50, existingMed:'0',
- existingRetirement:0, existingEduInsurance:0,
- retireAge:55, lifeExpectancy:90
- },
- v29_params: {
- retireLifestyleRatio: 1.00, // 退休后旅行医疗,高于现状
- incomeDiscountRate: 0.03,
- ciMultiplier: 3, // 双收入互为兜底
- affordabilityCap: 0.30, // 无子女 + 双高
- surname_en: 'Zhang',
- name_en: 'Zhang Yang',
- family_name_en: 'The Zhang Family',
- nationality: 'cn_pr', // 北京双高 + 香港 PR
- residence_city: '北京',
- industry: '跨国企业高管 + 科技公司中层 G1 双职工'
- }
- },
- {
- id: 'single_mom', tier: 'mid', name: '离异·单亲妈妈',
- forceHNW: false,
- data: {
- surname:'赵', age:38, gender:'F', marriage:'divorced',
- childCount:1, childAge1:8, childAge2:'', childAge3:'',
- eduPath:'domestic_plus',
- salary:60, spouseSalary:0, mortgage:300, otherDebt:0, liquidAssets:100,
- primaryResidence:400, investAssets:0, overseasAssets:0, // [v4.2] 单亲无境外
- existingLife:100, existingCI:30, existingMed:'0',
- existingRetirement:0, existingEduInsurance:0,
- retireAge:60, lifeExpectancy:90
- },
- v29_params: {
- retireLifestyleRatio: 0.70,
- incomeDiscountRate: 0.03,
- ciMultiplier: 4, // 单一收入 + 单亲,重疾击垮率最高
- affordabilityCap: 0.15, // 单收入预算紧
- surname_en: 'Zhao',
- name_en: 'Zhao Min',
- family_name_en: 'The Zhao Family',
- nationality: 'cn',
- residence_city: '广州',
- industry: '国企/外企中层 · 单亲家庭'
- }
- },
- {
- id: 'entrepreneur', tier: 'mid', name: '创业者·民企主',
- forceHNW: false,
- data: {
- surname:'黄', age:42, gender:'M', marriage:'married',
- childCount:2, childAge1:13, childAge2:8, childAge3:'',
- eduPath:'full_overseas',
- salary:300, spouseSalary:0, mortgage:800, otherDebt:1000, liquidAssets:500,
- primaryResidence:1500, investAssets:1500, overseasAssets:50, // [v4.4.3] 民企主豪宅 + 少量境外金融账户(50 万美金 ≈ ¥350 万)
- existingLife:300, existingCI:100, existingMed:'1',
- existingRetirement:50, existingEduInsurance:200,
- retireAge:60, lifeExpectancy:90
- },
- v29_params: {
- retireLifestyleRatio: 0.85, // 民企主 UHNW 标准
- incomeDiscountRate: 0.03,
- ciMultiplier: 5, // 经营贷 + 高峰期 + 单收入家庭核心 → 5×
- affordabilityCap: 0.30,
- surname_en: 'Huang',
- name_en: 'Huang Jianguo',
- family_name_en: 'The Huang Family',
- nationality: 'cn',
- residence_city: '杭州',
- industry: '民企 G1 主理人 · 浙江纺织/制造业 30 年累积'
- }
- },
- {
- id: 'silver', tier: 'mid', name: '银发族·准退休',
- forceHNW: false,
- data: {
- surname:'周', age:55, gender:'M', marriage:'married',
- childCount:0, childAge1:'', childAge2:'', childAge3:'',
- eduPath:'domestic',
- salary:80, spouseSalary:50, mortgage:0, otherDebt:0, liquidAssets:800,
- primaryResidence:1200, investAssets:600, overseasAssets:0, // [v4.2] 中段退休普通 HNW 无境外
- existingLife:200, existingCI:80, existingMed:'1',
- existingRetirement:200, existingEduInsurance:0,
- retireAge:60, lifeExpectancy:90
- },
- v29_params: {
- retireLifestyleRatio: 0.45, // 房贷已清+子女独立,极简
- incomeDiscountRate: 0.03,
- ciMultiplier: 2, // 已有 800 万流动资产+200 万养老储备
- affordabilityCap: 0.10, // 准退休不再激进
- surname_en: 'Zhou',
- name_en: 'Zhou Senior',
- family_name_en: 'The Zhou Family',
- nationality: 'cn_pr', // 国企退休 + 香港 PR
- residence_city: '北京',
- industry: '国企退休工程师 + 高级管理 G1'
- }
- },
- {
- id: 'cross_border', tier: 'hnw', name: '跨境·二代美籍',
- forceHNW: true,
- data: {
- surname:'陈', age:50, gender:'M', marriage:'married',
- childCount:1, childAge1:22, childAge2:'', childAge3:'',
- eduPath:'elite_us',
- salary:300, spouseSalary:80, mortgage:0, otherDebt:0, liquidAssets:1500,
- primaryResidence:2500, investAssets:4000, overseasAssets:430, // [v4.4.3] 跨境美籍 · 境外 430 万美金 ≈ ¥3010 万(海外金融账户+海外房产+股权)
- existingLife:500, existingCI:100, existingMed:'1',
- existingRetirement:100, existingEduInsurance:300,
- retireAge:65, lifeExpectancy:95
- },
- v29_params: {
- retireLifestyleRatio: 0.85,
- incomeDiscountRate: 0.04, // HNW 用国债基准
- ciMultiplier: 5, // UHNW 体面康复期
- affordabilityCap: 0.20, // 映射到 AUM × 2%
- aumWan: 8000, // [v2.9] 总 AUM 8000 万
- surname_en: 'Chen',
- name_en: 'Chen Wei',
- family_name_en: 'The Chen Family',
- nationality: 'multi', // 中国 + 美籍
- residence_city: '香港',
- industry: 'G2 跨境美籍 · 制造业转金融业'
- }
- },
- {
- id: 'uhnw_succession', tier: 'hnw', name: 'HNW 传承家族',
- forceHNW: true,
- data: {
- surname:'郑', age:55, gender:'M', marriage:'married',
- childCount:2, childAge1:25, childAge2:18, childAge3:'',
- eduPath:'elite_us',
- salary:500, spouseSalary:0, mortgage:0, otherDebt:0, liquidAssets:5000,
- primaryResidence:15000, investAssets:30000, overseasAssets:1140, // [v4.4.3] HNW 传承 · 境外 1140 万美金 ≈ ¥7980 万(对冲基金/离岸信托)
- existingLife:2000, existingCI:200, existingMed:'1',
- existingRetirement:500, existingEduInsurance:1000,
- retireAge:65, lifeExpectancy:95
- },
- v29_params: {
- retireLifestyleRatio: 1.00, // 传承级,预算无忧
- incomeDiscountRate: 0.04,
- ciMultiplier: 5,
- affordabilityCap: 0.30, // 映射到 AUM × 3%
- aumWan: 50000, // [v2.9] 总 AUM 5 亿
- surname_en: 'Zheng',
- name_en: 'Zheng Yongheng',
- family_name_en: 'The Zheng Family',
- nationality: 'cn_pr', // 中国 + 新加坡 PR
- residence_city: '上海',
- industry: 'G2 接班传承 · 浙江制造业 30 年累积 + 跨境家办'
- }
- }
- ];
- // [v3.5] 暴露到 window,让 jumpToAssetCenter 等函数能跨闭包访问
- window.CLIENT_PERSONAS = CLIENT_PERSONAS;
- /* === 画像段折叠/展开切换 === */
- function togglePersonaSection(btn) {
- const section = document.getElementById('personaSection');
- if (!section) return;
- section.classList.toggle('collapsed');
- const label = btn.querySelector('.toggle-label');
- if (label) {
- label.textContent = section.classList.contains('collapsed') ? '展开画像库' : '收起画像库';
- }}
- // [v4.8 · 2026-06-26 修正] 移除冗余的 togglePolicyCard / DOMContentLoaded 折叠系统
- // 原 codebase 已有 .policy-card.is-collapsed 系统(line 4809+)· 不再重复
- function loadPersona(id) {
- const p = CLIENT_PERSONAS.find(x => x.id === id);
- if (!p) return;
- // 选画像时如果当前是收起状态,保持收起(因为已选好,不需要看其他)
- // 这里不主动切换状态
- // v3.1 · 新增字段默认重置为 0(persona.data 若有显式定义则在下方 forEach 中覆盖)
- // [v4.2] 加 overseasAssets 重置 + overseasFuturePlan toggle 重置
- ['existingAccident', 'existingWholeLife', 'overseasAssets'].forEach(k => {
- const el = document.getElementById(k);
- if (el) el.value = 0;
- });
- const _futurePlanEl = document.getElementById('overseasFuturePlan');
- if (_futurePlanEl) _futurePlanEl.checked = false;
- // 填表
- Object.keys(p.data).forEach(key => {
- const el = document.getElementById(key);
- if (!el) return;
- el.value = p.data[key];
- });
- updateChildAgeFields();
- // [v2.9 完善] 应用 v29_params 到 4 个下拉(retireRatio / discount / ciMul / cap)
- if (p.v29_params) {
- const v = p.v29_params;
- const setSel = (id, val) => {
- const el = document.getElementById(id);
- if (!el || val === undefined || val === null) return;
- const targetStr = String(val);
- const opt = [...el.options].find(o => o.value === targetStr ||
- Math.abs(parseFloat(o.value) - parseFloat(targetStr)) < 1e-6);
- if (opt) el.value = opt.value;
- };
- setSel('retireLifestyleRatio', v.retireLifestyleRatio);
- setSel('incomeDiscountRate', v.incomeDiscountRate);
- setSel('ciMultiplier', v.ciMultiplier);
- setSel('affordabilityCap', v.affordabilityCap);
- if (v.aumWan !== undefined && v.aumWan > 0) {
- sessionStorage.setItem('cy_persona_aum_wan', String(v.aumWan));
- } else {
- sessionStorage.removeItem('cy_persona_aum_wan');
- }
- } else {
- sessionStorage.removeItem('cy_persona_aum_wan');
- }
- // 标记当前画像 + forceHNW
- sessionStorage.setItem('cy_persona_id', id);
- if (p.forceHNW) {
- sessionStorage.setItem('cy_persona_force_hnw', '1');
- } else {
- sessionStorage.removeItem('cy_persona_force_hnw');
- }
- // chip 高亮 (只高亮当前点击的)
- document.querySelectorAll('.persona-chip').forEach(c => c.classList.remove('selected'));
- const clickedChip = [...document.querySelectorAll('.persona-chip')].find(c =>
- c.getAttribute('onclick') === `loadPersona('${id}')`);
- if (clickedChip) clickedChip.classList.add('selected');
- // toast 提示
- showInlineToast('✅ 已载入【' + p.name + '】画像 · 可微调字段后点「计算」');
- // 隐藏 ctx-bar(因为是 persona 不是 portrait)
- const ctxBar = document.getElementById('ctxBar');
- if (ctxBar) ctxBar.classList.remove('active');
- // [v2026-06-12 + 2] 不自动计算 · 等用户手动点「计算保额」
- // 隐藏旧结果(避免误以为是新画像的结果)
- const result = document.getElementById('result');
- if (result) result.style.display = 'none';
- // 滚到表单顶部 · 用户先看下字段再点「计算」
- setTimeout(() => {
- window.scrollTo({ top: 0, behavior: 'smooth' });
- }, 100);
- }
- function showInlineToast(msg) {
- let t = document.getElementById('_inlineToast');
- if (!t) {
- t = document.createElement('div');
- t.id = '_inlineToast';
- t.style.cssText = 'position:fixed;top:84px;left:50%;transform:translateX(-50%);' +
- 'background:linear-gradient(135deg,#2A1F0E,#3D2914);color:#F5E6B8;border:1px solid #C4973A;' +
- 'border-radius:8px;padding:14px 28px;font-size:14px;font-weight:500;letter-spacing:.3px;' +
- 'box-shadow:0 8px 32px rgba(196,151,58,.35);z-index:99999;opacity:0;' +
- 'transition:opacity .3s,transform .3s;font-family:"Noto Serif SC","PingFang SC",serif;' +
- 'pointer-events:none;white-space:nowrap';
- document.body.appendChild(t);
- }
- t.textContent = msg;
- t.style.opacity = '0';
- t.style.transform = 'translateX(-50%) translateY(-8px)';
- requestAnimationFrame(() => {
- t.style.opacity = '1';
- t.style.transform = 'translateX(-50%) translateY(0)';
- });
- clearTimeout(t._timer);
- t._timer = setTimeout(() => {
- t.style.opacity = '0';
- t.style.transform = 'translateX(-50%) translateY(-8px)';
- }, 2800);
- }
- /* === 保费查表 (年缴 / 万元保额) ===
- 简化版: 35-65 岁,5 岁分档,线性插值 */
- const PREMIUM_TABLE = {
- // 重疾(终身,30 年缴)
- ci: {
- 35: { M: 50, F: 48 },
- 40: { M: 65, F: 62 },
- 45: { M: 85, F: 80 },
- 50: { M: 115, F: 105 },
- 55: { M: 155, F: 140 },
- 60: { M: 205, F: 180 },
- 65: { M: 280, F: 240 }
- },
- // 寿险(增额终身寿,20 年缴)
- life: {
- 35: { M: 40, F: 35 },
- 40: { M: 48, F: 42 },
- 45: { M: 58, F: 50 },
- 50: { M: 72, F: 62 },
- 55: { M: 90, F: 78 },
- 60: { M: 115, F: 100 },
- 65: { M: 150, F: 130 }
- },
- // 高端医疗(年缴 · 保额 800 万)
- medical: {
- 35: 18000, 40: 22000, 45: 28000, 50: 35000, 55: 45000, 60: 60000, 65: 80000
- }
- };
- function lookupPremium(table, age, gender) {
- const ages = Object.keys(table).map(Number).sort((a,b) => a-b);
- let lo = ages[0], hi = ages[ages.length-1];
- for (let i = 0; i < ages.length-1; i++) {
- if (age >= ages[i] && age < ages[i+1]) { lo = ages[i]; hi = ages[i+1]; break; }
- }
- if (age >= hi) return table[hi][gender] || table[hi];
- if (age <= lo) return table[lo][gender] || table[lo];
- const tLo = table[lo][gender] || table[lo];
- const tHi = table[hi][gender] || table[hi];
- const ratio = (age - lo) / (hi - lo);
- return tLo + (tHi - tLo) * ratio;
- }
- /* === 数字格式化 === */
- function fmtWan(wan) {
- if (!wan) return '¥0万';
- if (wan >= 10000) return '¥' + (wan/10000).toFixed(2) + '亿';
- if (wan >= 1) return '¥' + Math.round(wan).toLocaleString() + '万';
- return '¥' + Math.round(wan*10000).toLocaleString();
- }
- /* === Phase 2 · Portrait 自动预填 === */
- function loadPortrait() {
- try {
- const raw = localStorage.getItem('cy_current_portrait');
- if (raw) return JSON.parse(raw);
- } catch(e) {}
- return null;
- }
- /* === v3.3.4 · 画像切换 dropdown(与 PolicySummary 同源 · 暴露 vault 全部 CY_PORTRAITS)=== */
- function populatePortraitSwitcher() {
- const select = document.getElementById('portraitSwitcher');
- if (!select || !window.CY_PORTRAITS) return;
- const keys = Object.keys(window.CY_PORTRAITS);
- select.innerHTML = '<option value="">⇄ 切换画像(共 ' + keys.length + ' 个)</option>';
- // 排序:strategic / uhnw / hnw / mid / std
- const tierOrder = { strategic: 0, uhnw: 1, hnw: 2, mid: 3, std: 4 };
- const sorted = keys.slice().sort((a, b) => {
- const ta = tierOrder[((window.CY_PORTRAITS[a].family || {}).tier) || 'std'] ?? 9;
- const tb = tierOrder[((window.CY_PORTRAITS[b].family || {}).tier) || 'std'] ?? 9;
- return ta - tb;
- });
- // 当前选中
- let currentKey = '';
- try {
- const stored = JSON.parse(localStorage.getItem('cy_current_portrait') || 'null');
- const cid = stored && stored.family && stored.family.id;
- if (cid) {
- sorted.forEach(k => {
- const p = window.CY_PORTRAITS[k];
- if (p && p.family && p.family.id === cid) currentKey = k;
- });
- }
- } catch(e) {}
- sorted.forEach(key => {
- const p = window.CY_PORTRAITS[key];
- if (!p || !p.family) return;
- const opt = document.createElement('option');
- opt.value = key;
- const tier = (p.family.tier || 'std').toUpperCase();
- opt.textContent = '[' + tier + '] ' + (p.family.name_cn || key) + ' · ' + (p.family.portrait_label || '');
- if (key === currentKey) opt.selected = true;
- select.appendChild(opt);
- });
- }
- function switchPortrait(key) {
- if (!key || !window.CY_PORTRAITS || !window.CY_PORTRAITS[key]) return;
- try {
- const data = JSON.stringify(window.CY_PORTRAITS[key]);
- // 双 key 同步双写(兼容演示端入口 + 专版 + PolicySummary)
- localStorage.setItem('cy_current_portrait', data);
- localStorage.setItem('cy-demo-portrait-data', data);
- localStorage.setItem('cy-demo-family', key);
- sessionStorage.setItem('cy_toast', '✓ 已切换到 ' + (window.CY_PORTRAITS[key].family.name_cn || key));
- } catch(e) {}
- location.reload();
- }
- function reloadFromPortrait() {
- const pt = loadPortrait();
- if (!pt) {
- alert('未检测到客户画像 cy_current_portrait,请先从客户列表选择客户');
- return;
- }
- // [Bug fix] 清掉 persona 标记,让 portrait 优先级生效
- sessionStorage.removeItem('cy_persona_id');
- sessionStorage.removeItem('cy_persona_force_hnw');
- document.querySelectorAll('.persona-chip').forEach(c => c.classList.remove('selected'));
- prefillFromPortrait(pt);
- }
- function switchToNewClient() {
- if (!confirm('切换为新客户模式 · 清空所有表单 · 不影响 localStorage 客户画像')) return;
- document.querySelectorAll('input[type=text],input[type=number]').forEach(i => i.value = '');
- document.getElementById('childCount').value = '0';
- document.getElementById('existingMed').value = '0';
- document.getElementById('ctxBar').classList.remove('active');
- document.getElementById('result').style.display = 'none';
- // [Bug fix] 清 persona 标记
- sessionStorage.removeItem('cy_persona_id');
- sessionStorage.removeItem('cy_persona_force_hnw');
- document.querySelectorAll('.persona-chip').forEach(c => c.classList.remove('selected'));
- updateChildAgeFields();
- window.scrollTo({ top:0, behavior:'smooth' });
- }
- function prefillFromPortrait(pt) {
- if (!pt || !pt.family) return;
- // === 显示 ctx-bar ===
- const ctxBar = document.getElementById('ctxBar');
- ctxBar.classList.add('active');
- document.getElementById('ctxName').textContent = pt.family.name_cn || '--';
- if (pt.family.portrait_label) {
- const portEl = document.getElementById('ctxPortrait');
- portEl.style.display = 'inline-block';
- portEl.textContent = pt.family.portrait + ' · ' + pt.family.portrait_label;
- }
- // === 主理人 ===
- const principal = (pt.members || []).find(m => m.role === 'principal');
- if (principal) {
- document.getElementById('age').value = principal.age || '';
- document.getElementById('gender').value = principal.gender === 'female' ? 'F' : 'M';
- }
- // 姓
- document.getElementById('surname').value = pt.family.surname || '';
- // 婚姻 (检测有无 spouse)
- const spouse = (pt.members || []).find(m => m.role === 'spouse');
- document.getElementById('marriage').value = spouse ? 'married' :
- (principal && principal.marital_status === 'single' ? 'single' : 'married');
- // === 子女 ===
- const children = (pt.members || []).filter(m => m.role === 'child');
- // 排除孙辈(generation 3+)
- const directChildren = children.filter(c => !c.generation || c.generation <= 2);
- document.getElementById('childCount').value = String(Math.min(3, directChildren.length));
- directChildren.slice(0, 3).forEach((c, idx) => {
- const ageInput = document.getElementById('childAge' + (idx + 1));
- if (ageInput) ageInput.value = c.age || '';
- });
- updateChildAgeFields();
- // 教育路径 (根据子女是否海外推断)
- const overseasChild = directChildren.find(c => c.residency && c.residency !== 'CN');
- const usChild = directChildren.find(c => c.is_us_person);
- if (usChild) {
- document.getElementById('eduPath').value = 'elite_us';
- } else if (overseasChild) {
- document.getElementById('eduPath').value = 'full_overseas';
- } else if (directChildren.length > 0) {
- document.getElementById('eduPath').value = 'domestic_plus';
- }
- // === 财务 ===
- // 年薪估算: family.annual_expense_cny / 0.5 (年支出占年薪 50%)
- const annualExpenseCny = pt.family.annual_expense_cny || 0;
- if (annualExpenseCny > 0) {
- document.getElementById('salary').value = Math.round(annualExpenseCny / 0.5 / 10000);
- }
- document.getElementById('spouseSalary').value = '0';
- // [v3.4 task #3] 三盘资产分流 · 流动 / 自住房产 / 其他投资
- // · LIQUID:cash / 公开市场股权 / liquidity=high
- // · PRIMARY_RES:real_estate 且 (subcategory=primary_residence / self_occupied / 名称含"自住"|"自用")
- // · INVEST:其他所有非保险/非现金的(real_estate 投资盘 / private_equity / equity_overseas / trust / overseas_allocation 等)
- const LIQUID_CATS = ['cash'];
- const LIQUID_SUBCATS = ['listed_a_share','us_listed_blue_chip','us_listed_etf','us_listed_tech','hk_listed','cash_money_market','cash_overseas_usd'];
- // 自住房产标识(subcategory 或名称关键词命中即归为 primaryResidence)
- const PRIMARY_RES_SUBCATS = ['primary_residence','self_occupied','principal_residence','main_home'];
- const PRIMARY_RES_NAME_KEYWORDS = ['自住', '自用', '主居', '住宅(自', '本人居住', 'primary residence'];
- // 不计入任何盘的(纯保险类资产,已在 policies 中)
- const SKIP_CATS = ['insurance', 'overseas_insurance'];
- // 货币换算
- function toCnyWan(asset) {
- const cents = asset.value_cents || 0;
- if (asset.currency === 'CNY') return cents / 100 / 10000;
- if (asset.currency === 'USD') return cents / 100 * 7 / 10000;
- if (asset.currency === 'HKD') return cents / 100 * 0.9 / 10000;
- if (asset.currency === 'SGD') return cents / 100 * 5.2 / 10000;
- return cents / 100 / 10000;
- }
- let liquid = 0, primaryResidence = 0, investAssets = 0;
- (pt.assets || []).forEach(a => {
- if (SKIP_CATS.indexOf(a.category) >= 0) return;
- const cnyWan = toCnyWan(a);
- if (cnyWan <= 0) return;
- // 1) 流动资产
- const isLiquid = LIQUID_CATS.indexOf(a.category) >= 0 ||
- LIQUID_SUBCATS.indexOf(a.subcategory) >= 0 ||
- (a.liquidity === 'high');
- if (isLiquid) {
- liquid += cnyWan;
- return;
- }
- // 2) 自住房产(real_estate 类别 + 自住识别)
- if (a.category === 'real_estate') {
- const isPrimary = PRIMARY_RES_SUBCATS.indexOf(a.subcategory) >= 0 ||
- PRIMARY_RES_NAME_KEYWORDS.some(kw => (a.name || '').indexOf(kw) >= 0);
- if (isPrimary) {
- primaryResidence += cnyWan;
- } else {
- // 投资性房产 → 其他投资盘
- investAssets += cnyWan;
- }
- return;
- }
- // 3) 其余非现金资产(私募 / 信托 / 跨境 / 海外配置 / 商业股权 等)→ 其他投资盘
- investAssets += cnyWan;
- });
- document.getElementById('liquidAssets').value = Math.round(liquid);
- const primaryResEl = document.getElementById('primaryResidence');
- if (primaryResEl) primaryResEl.value = Math.round(primaryResidence);
- const investAssetsEl = document.getElementById('investAssets');
- if (investAssetsEl) investAssetsEl.value = Math.round(investAssets);
- // 房贷 + 其他负债 (portrait 一般没有负债字段,默认 0)
- // 如果未来 portrait 加 liabilities 数组,这里读取
- document.getElementById('mortgage').value = '0';
- document.getElementById('otherDebt').value = '0';
- // === 现有保单(v3.1 · 7 险种细分:term_life → 定期寿险 / whole_life+iul+vul+ppli → 终身寿险)===
- let existingTermLife = 0, existingWholeLife = 0, existingCI = 0, hasIntlMed = 0, existingEduIns = 0, existingAccident = 0;
- (pt.policies || []).forEach(p => {
- const cents = p.face_amount_cents || 0;
- let cnyWan = 0;
- if (p.currency === 'USD') cnyWan = cents / 100 * 7 / 10000;
- else if (p.currency === 'HKD') cnyWan = cents / 100 * 0.9 / 10000;
- else cnyWan = cents / 100 / 10000;
- const pt2 = (p.product_type || '').toLowerCase();
- if (['whole_life','iul','vul','ppli'].indexOf(pt2) >= 0) {
- existingWholeLife += cnyWan; // v3.1 · 终身寿险类
- } else if (pt2 === 'term_life' || pt2 === 'term') {
- existingTermLife += cnyWan; // v3.1 · 定期寿险类
- } else if (pt2 === 'critical_illness' || pt2 === 'ci') {
- existingCI += cnyWan;
- } else if (pt2 === 'international_health' || pt2 === 'health' || pt2 === 'medical') {
- hasIntlMed = 1;
- } else if (pt2 === 'education' || pt2 === 'endowment_education') {
- existingEduIns += cnyWan;
- } else if (pt2 === 'accident' || pt2 === 'pa') {
- existingAccident += cnyWan;
- }
- });
- document.getElementById('existingLife').value = Math.round(existingTermLife);
- document.getElementById('existingWholeLife').value = Math.round(existingWholeLife);
- document.getElementById('existingAccident').value = Math.round(existingAccident);
- document.getElementById('existingCI').value = Math.round(existingCI);
- document.getElementById('existingMed').value = String(hasIntlMed);
- document.getElementById('existingRetirement').value = '0'; // portrait 没有专项养老
- // [v3.4] existingEdu 字段已删除(与流动资产重复),只保留 existingEduInsurance
- document.getElementById('existingEduInsurance').value = Math.round(existingEduIns);
- // [v3.4 task #3] 三盘已在上方分流过(liquid / primaryResidence / investAssets),此处无需重置
- // === 退休年龄 (从 scenarios.params.retirement_age 读) ===
- if (pt.scenarios && pt.scenarios.length) {
- const baseline = pt.scenarios.find(s => s.is_baseline) || pt.scenarios[0];
- if (baseline && baseline.params && baseline.params.retirement_age) {
- document.getElementById('retireAge').value = baseline.params.retirement_age;
- }
- if (baseline && baseline.params && baseline.params.projection_end_age) {
- document.getElementById('lifeExpectancy').value = baseline.params.projection_end_age;
- }
- }
- // 显示 ctx-bar meta
- const aumYi = liquid / 10000;
- let metaParts = [];
- if (annualExpenseCny > 0) metaParts.push('年薪估 ¥' + Math.round(annualExpenseCny / 0.5 / 10000) + '万');
- metaParts.push('流动资产 ¥' + Math.round(liquid) + '万');
- if (directChildren.length) metaParts.push(directChildren.length + ' 子女');
- document.getElementById('ctxMeta').textContent = metaParts.join(' · ');
- }
- /* === 主计算函数 === */
- function calculate() {
- // 收集输入
- const surname = (document.getElementById('surname').value || '').trim() || '客户';
- const age = parseInt(document.getElementById('age').value);
- const gender = document.getElementById('gender').value;
- const childCount = parseInt(document.getElementById('childCount').value);
- const childAges = [];
- for (let i = 1; i <= 3; i++) {
- if (i <= childCount) {
- const v = parseInt(document.getElementById('childAge'+i).value);
- if (!isNaN(v)) childAges.push(v);
- }
- }
- const eduPath = document.getElementById('eduPath').value;
- const salary = parseFloat(document.getElementById('salary').value) || 0;
- const spouseSalary = parseFloat(document.getElementById('spouseSalary').value) || 0;
- const mortgage = parseFloat(document.getElementById('mortgage').value) || 0;
- const otherDebt = parseFloat(document.getElementById('otherDebt').value) || 0;
- const liquid = parseFloat(document.getElementById('liquidAssets').value) || 0;
- // [v3.4] 自住房产 + 其他投资资产 · 用于总财富画像 + HNW 触发,**不参与寿险 DIM A 项**
- const primaryResidence = (function(){ const el = document.getElementById('primaryResidence'); return el ? (parseFloat(el.value) || 0) : 0; })();
- const investAssets = (function(){ const el = document.getElementById('investAssets'); return el ? (parseFloat(el.value) || 0) : 0; })();
- // [v4.2] 境外资产 · 境外寿险按实际境外资产分配 + 未来计划 toggle 估算
- // [v4.4.3] 单位改为万美金 · 内部按 1 USD = 7 CNY 换算成万人民币(对齐其他资产口径)
- const FX_USD_CNY = 7;
- const overseasAssetsUSD = (function(){ const el = document.getElementById('overseasAssets'); return el ? (parseFloat(el.value) || 0) : 0; })();
- const overseasAssetsRaw = overseasAssetsUSD * FX_USD_CNY; // 万美金 → 万人民币
- const overseasFuturePlan = (function(){ const el = document.getElementById('overseasFuturePlan'); return el ? !!el.checked : false; })();
- // UI 显示等价人民币
- (function(){
- const hint = document.getElementById('overseasAssetsCnyHint');
- if (hint) {
- const cny = overseasAssetsRaw;
- hint.textContent = '≈ ¥' + (cny >= 10000 ? (cny/10000).toFixed(2) + '亿' : cny.toFixed(0) + '万');
- }
- })();
- const existingLife = parseFloat(document.getElementById('existingLife').value) || 0;
- const existingCI = parseFloat(document.getElementById('existingCI').value) || 0;
- const existingMed = parseInt(document.getElementById('existingMed').value);
- const existingRetirement = parseFloat(document.getElementById('existingRetirement').value) || 0;
- // [v3.4] existingEdu 字段已删除(与 liquidAssets 重复),硬编 0
- const existingEdu = 0;
- const existingEduInsurance = parseFloat(document.getElementById('existingEduInsurance').value) || 0;
- // v3.1 · 新增意外险 + 终身寿险输入读取
- const existingAccident = parseFloat(document.getElementById('existingAccident').value) || 0;
- const existingWholeLife = parseFloat(document.getElementById('existingWholeLife').value) || 0;
- const retireAge = parseInt(document.getElementById('retireAge').value) || 60;
- const lifeExpectancy = parseInt(document.getElementById('lifeExpectancy').value) || 90;
- // [v2.8] 新增可选参数
- const retireLifestyleRatio = parseFloat(document.getElementById('retireLifestyleRatio').value) || 0.70;
- const incomeDiscountRate = parseFloat(document.getElementById('incomeDiscountRate').value) || 0;
- const affordabilityCap = parseFloat(document.getElementById('affordabilityCap').value) || 0.20;
- // [v2.9] 重疾倍数可调
- const ciMultiplier = parseFloat(document.getElementById('ciMultiplier').value) || 3;
- if (!age || age < 18 || age > 80) { alert('请填写主理人年龄(18-80)'); return; }
- if (!salary) { alert('请填写主理人年薪'); return; }
- // [v3.6] 意外险计算挪到 totalWealth 之后(在 isHNW 判定之前) — 见下方 §accidentNeed
- // ===== 1. 重疾(年收入 × N · v2.9 倍数可调) =====
- const ciNeed = salary * ciMultiplier; // 万
- const ciGap = Math.max(0, ciNeed - existingCI);
- const ciPremiumRate = lookupPremium(PREMIUM_TABLE.ci, age, gender);
- // [v4.7+ 缴费年限智能化] 重疾默认 20 年缴清,准退休客户(retireAge-age < 20)需缩短并按比例放大年缴
- // 公式:总成本中性假设 — 年缴 × 缴费年限 ≈ 常数,缩短缴费窗口 → 年缴反比例上升
- // 反方:实际精算因短缴期"客户活到缴清概率高 + 资金沉淀快"会比线性低 5-10%,作为估算可接受
- const _yearsToRetireForPremium = Math.max(0, retireAge - age);
- const ciPayYears = Math.min(20, Math.max(5, _yearsToRetireForPremium > 0 ? _yearsToRetireForPremium + 5 : 20));
- const ciPremium = (ciNeed * ciPremiumRate) * (20 / ciPayYears); // 元
- // ===== 2. 高端医疗(800 万固定) =====
- const medNeed = 800; // 万
- const medGap = existingMed === 1 ? 0 : medNeed;
- const medPremium = lookupPremium(PREMIUM_TABLE.medical, age); // 元
- // ===== 3. 寿险(DIME + HNW 双轨) =====
- // [HNW 升级 v2026-06-12] 检测高净值客户,启用双轨公式
- // [v2.8 修复] (a) 教育金从 DIME 中剥离(已由独立教育金险覆盖,寿险不重复计入)
- // (b) I 项加未来收入折现,把 25 年后的工资按现值折回
- const D = mortgage + otherDebt; // 万
- const yearsToRetire = Math.max(0, retireAge - age);
- const totalFamilyIncome = salary + spouseSalary;
- const principalShare = totalFamilyIncome > 0 ? salary / totalFamilyIncome : 1;
- const incomeReplaceRate = Math.max(0.3, principalShare);
- // [v2.8] 折现因子 PV = salary × principalShare × annuityPV(N, r)
- // annuityPV = (1 - (1+r)^-N) / r · 当 r=0 时退化为 N(简单累加)
- const I_undiscounted = salary * yearsToRetire * incomeReplaceRate; // 万 (旧 v2.7 算法)
- let annuityPVFactor;
- if (incomeDiscountRate > 0 && yearsToRetire > 0) {
- annuityPVFactor = (1 - Math.pow(1 + incomeDiscountRate, -yearsToRetire)) / incomeDiscountRate;
- } else {
- annuityPVFactor = yearsToRetire; // 不折现退化
- }
- const I = salary * incomeReplaceRate * annuityPVFactor; // 万,折现后现值
- const eduUnit = EDU_PATH_COST[eduPath] || 600;
- // [v4.0 升级 · Jack 2026-06-15 立法] 教育金改用 PV 现值(去掉 1.05^N 通胀终值)
- // 旧 v3.6:eduUnit × (1.05)^(18-子女年龄) → 子女年龄越小数字越虚高(20 年后名义金额)
- // 新 v4.0:直接 eduUnit(假设教育成本通胀 = 折现率,PV 退化为今天购买力)
- // 理由:客户感知"今天该准备多少钱"比"未来名义总额"更诚信,避免数字虚高
- let totalEduPV = 0;
- let eduCalcDetail = [];
- childAges.forEach((cAge, idx) => {
- const eduPV = eduUnit; // PV 现值(假设通胀 = 折现率)
- totalEduPV += eduPV;
- eduCalcDetail.push(`子${idx+1}(${cAge}岁) ${eduUnit}万 PV(教育通胀 = 折现率,现值)`);
- });
- // 兼容老变量名 totalEduWithInflation(下游引用未改)
- const totalEduWithInflation = totalEduPV;
- const E = Math.max(0, totalEduWithInflation - existingEduInsurance);
- const A = liquid;
- // [v2.8 关键修复] DIME → DIM,去掉教育金 E,避免与独立教育金险重复计入
- const dimeNeed = Math.max(0, D + I - A); // 寿险纯做"债务+收入替代",教育金交给独立险种
- // === HNW 触发逻辑 ===
- // 检测高净值客户:AUM ≥ 5 亿(50000 万)/ 美籍 / 多子女(≥3) / 多婚 + 未成年
- // 由于工具是独立填表,我们用以下信号(均可读自 portrait):
- // - 流动资产 ≥ 5000 (5 亿) → HNW
- // - 子女数 ≥ 3 → HNW
- // 美籍/多婚由 portrait.members 判断,这里用流动资产作为代理指标
- // [v3.4] HNW 触发:总财富(流动+自住+投资) ≥ 5000 万 触发,而非仅 liquid
- // [v3.6] 加第 4 盘"保险现金价值"= 重疾×0.5 + 终身寿×1.0 + 教育金×1.0 + 养老储备×1.0
- // 理由(Jack 2026-06-15 立法):承延高端客户重疾默认储蓄型(增额终身寿+重疾责任 / 港险储蓄型),
- // 不是消费型 — 保单缴费期累积现金价值,应计入家族资产
- const insuranceCashValue =
- existingCI * 0.5 // 储蓄型重疾(中段缴费期约保额 50%)
- + existingWholeLife * 1.0 // 终身寿险(现金价值 ≈ 保额)
- + existingEduInsurance * 1.0 // 教育金险(分红/年金型)
- + existingRetirement * 1.0; // 养老储备(年金型)
- const totalWealth = liquid + primaryResidence + investAssets + insuranceCashValue;
- const isHNW = totalWealth >= 5000 || childCount >= 3;
- // [v3.6] 注:意外险/终身寿险的 need 项在下方 v3.0 段落统一算(accNeed/wlNeed),不在这里重复
- // 用 portrait 完整数据计算 HNW 资产(若有)
- // [Bug fix v2026-06-12 +1] 选了 persona / 用户重置(ctx-bar 隐藏) → 跳过 portrait
- // 只有 ctx-bar 仍 active(真客户上下文)且没选 persona,才读 portrait
- const personaActive = sessionStorage.getItem('cy_persona_id');
- const ctxBarActive = document.getElementById('ctxBar') && document.getElementById('ctxBar').classList.contains('active');
- let portraitTotalAum = 0;
- let portraitNonCashAssets = [];
- let hasUSPerson = false;
- if (!personaActive && ctxBarActive) {
- try {
- const pt = JSON.parse(localStorage.getItem('cy_current_portrait') || 'null');
- if (pt && pt.assets) {
- pt.assets.forEach(a => {
- const cents = a.value_cents || 0;
- let cnyWan = 0;
- if (a.currency === 'CNY') cnyWan = cents / 100 / 10000;
- else if (a.currency === 'USD') cnyWan = cents / 100 * 7 / 10000;
- else if (a.currency === 'HKD') cnyWan = cents / 100 * 0.9 / 10000;
- else cnyWan = cents / 100 / 10000;
- portraitTotalAum += cnyWan;
- // 非现金资产(可装入 PPLI)
- if (['equity_domestic','equity_overseas','real_estate','private_equity','trust'].indexOf(a.category) >= 0) {
- portraitNonCashAssets.push({
- name: a.name || '(未命名)',
- category: a.category,
- cnyWan: Math.round(cnyWan)
- });
- }
- });
- }
- if (pt && pt.members) {
- hasUSPerson = pt.members.some(m => m.is_us_person);
- }
- } catch(e) {}
- }
- // [v2.9 完善] 如果选了 persona 且 persona 自带 aumWan(HNW 画像),用它做 portraitTotalAum
- // 这样 v2.9 的"AUM 当支付能力分母"逻辑在 demo 时能完整生效
- if (sessionStorage.getItem('cy_persona_id') && portraitTotalAum === 0) {
- const personaAum = parseFloat(sessionStorage.getItem('cy_persona_aum_wan') || '0');
- if (personaAum > 0) portraitTotalAum = personaAum;
- }
- // 确定最终 HNW 状态
- // [Phase 4] persona forceHNW 也触发(用于跨境美籍 / 非 AUM 触发的 HNW)
- const personaForceHNW = sessionStorage.getItem('cy_persona_force_hnw') === '1';
- const isHNWFinal = isHNW || portraitTotalAum >= 50000 || hasUSPerson || personaForceHNW;
- // === HNW 双轨计算 ===
- let domesticNeed = 0; // 境内寿险
- let overseasNeed = 0; // 境外 PPLI/VUL
- let lifeNeed = dimeNeed;
- let ppliBreakdown = [];
- if (isHNWFinal) {
- // [v3.6 修订] 定期寿险公式 = HNW 流动性桥梁(不再用 AUM 大比例)
- // 旧逻辑(我之前):主理人 = AUM × 50%,导致 ¥8000 万 AUM 客户配 ¥7500 万定期寿险(过高,
- // 违反"定期寿险 = 收入替代 + 债务覆盖"语义)
- // 新逻辑:工作期主理人 = salary × 5(过渡 5 年)+ 房贷 + 其他负债,上限 totalWealth × 30%
- // 理由:HNW 客户资产已够覆盖收入替代,定期寿险只需要"主理人意外身故 5 年家庭过渡现金流"
- // + 监管/核保上限保护 ¥3-5 亿/单人(64 岁以下)
- const yearsToRetire = Math.max(0, retireAge - age);
- const incomeReplacement = yearsToRetire > 0 ? salary * 5 : 0; // 5 年过渡(已退休则 0)
- const debtCoverage = mortgage + otherDebt;
- const baseLifeRaw = incomeReplacement + debtCoverage;
- const aumLifeCap = Math.round(totalWealth * 0.30); // 上限 = 总财富 × 30%(HNW 流动性补充上限)
- const ageCap = age < 65 ? 50000 : (age < 70 ? 30000 : 10000); // 监管 / 核保上限
- const principalDomestic = Math.min(baseLifeRaw, aumLifeCap, ageCap);
- // 配偶补充:主理人 50%(分散投保 / 同样限上限)
- const spouseDomestic = Math.round(principalDomestic * 0.5);
- domesticNeed = principalDomestic + spouseDomestic;
- // 境外 PPLI: 装入非现金资产 30-50%
- // 杉杉 / 陈氏等通过 portrait 实读
- const aumForPPLI = portraitTotalAum > 0 ? portraitTotalAum : (liquid * 5); // fallback
- const PPLI_RATIOS = {
- 'cash': { ratio: 1.0, label: '流动金融(现金/股票)', priority: 1 },
- 'equity_overseas': { ratio: 1.0, label: '境外股权', priority: 2 },
- 'private_equity': { ratio: 0.5, label: '私募股权', priority: 3 },
- 'equity_domestic': { ratio: 0.3, label: '境内股权(SPV 剥离 30%)', priority: 4 },
- 'real_estate': { ratio: 0.3, label: '不动产(SPV 持有 30%)', priority: 5 },
- 'trust': { ratio: 0.5, label: '现有信托资产', priority: 6 }
- };
- if (portraitNonCashAssets.length) {
- // 用 portrait 真实数据
- const grouped = {};
- portraitNonCashAssets.forEach(a => {
- if (!grouped[a.category]) grouped[a.category] = 0;
- grouped[a.category] += a.cnyWan;
- });
- Object.keys(grouped).forEach(cat => {
- const cfg = PPLI_RATIOS[cat] || { ratio: 0.3, label: cat, priority: 9 };
- const injectWan = Math.round(grouped[cat] * cfg.ratio);
- if (injectWan > 0) {
- ppliBreakdown.push({
- label: cfg.label,
- ratio: cfg.ratio,
- injectWan,
- priority: cfg.priority
- });
- }
- });
- ppliBreakdown.sort((a,b) => a.priority - b.priority);
- overseasNeed = ppliBreakdown.reduce((s,b) => s + b.injectWan, 0);
- } else {
- // [v3.6 修复] 没 portrait 时,境外 PPLI 比例从 0.3 → 0.2(更保守),并加 AUM × 0.5 上限
- const overseasRaw = Math.round(liquid * 0.5 + aumForPPLI * 0.2);
- overseasNeed = overseasRaw;
- ppliBreakdown.push({
- label: '现金 + 流动金融(估算装入,AUM × 0.2)',
- ratio: 0.2,
- injectWan: overseasNeed,
- priority: 1
- });
- }
- // 美籍二代:加 40% 遗产税敞口
- if (hasUSPerson) {
- const usExposure = Math.round(aumForPPLI * 0.5 * 0.4); // 50% 资产 × 40% 税率
- if (usExposure > 0) {
- ppliBreakdown.push({
- label: '🚨 美籍二代遗产税隔离',
- ratio: 0.4,
- injectWan: usExposure,
- priority: 0
- });
- ppliBreakdown.sort((a,b) => a.priority - b.priority);
- overseasNeed += usExposure;
- }
- }
- // [v3.6 修复] 境外 PPLI 总额上限 = AUM × 0.5(避免对小 AUM 家族算出 PPLI > AUM × 60% 不合理)
- const overseasCap = Math.round(aumForPPLI * 0.5);
- if (overseasNeed > overseasCap) {
- // 标记被 cap 的部分
- ppliBreakdown.push({
- label: '⚠ 总额已被 AUM × 50% 上限截断',
- ratio: 0,
- injectWan: -(overseasNeed - overseasCap),
- priority: 99
- });
- overseasNeed = overseasCap;
- }
- // [v3.6 修订] HNW 模式下:lifeNeed = 境内寿险(中端 · "寿险卡"展示)
- // 终身寿险 wlNeed = 境外 PPLI(高端 · "终身寿险卡"展示)— 在 line ~3329 处赋值
- // 这样避免 PPLI 在两个卡片重复计算,也避免 totalCoverage7 = totalCoverage + wlNeed 双重计入
- lifeNeed = domesticNeed;
- }
- let lifeGap = Math.max(0, lifeNeed - existingLife);
- const lifePremiumRate = lookupPremium(PREMIUM_TABLE.life, age, gender);
- // [v4.7+ 缴费年限智能化] 定期寿险默认 30 年缴清,准退休客户缩到 max(5, yearsToRetire+5)
- const lifePayYears = Math.min(30, Math.max(5, yearsToRetire > 0 ? yearsToRetire + 5 : 30));
- let lifePremium = (lifeNeed * lifePremiumRate) * (30 / lifePayYears);
- // ===== 4. 养老金 =====
- // [v4.0 升级 · Jack 2026-06-15 立法] 改用 PV 年金现值因子(避免名义金额虚高)
- // 旧 v3.6 FV factor = ((1+r)^N - 1) / r · 给出未来 N 年累积名义金额(数字大但通胀稀释)
- // 新 v4.0 PV factor = (1 - (1+r)^-N) / r · 给出今天的购买力下,30 年总缺口的现值
- // 通胀率 = 折现率 = 3% 时,PV factor < FV factor,数字更接近"今天该准备多少钱"
- const retireMonthlyExp = salary * retireLifestyleRatio / 12; // 万/月
- const socialPension = 1.2; // 万/月,默认一线
- const monthlyGap = Math.max(0, retireMonthlyExp - socialPension);
- const retireYears = Math.max(0, lifeExpectancy - retireAge);
- const inflationRate = 0.03;
- // PV 年金现值因子(v4.0 替换 FV)
- const annuityFactor = retireYears > 0
- ? (1 - Math.pow(1 + inflationRate, -retireYears)) / inflationRate
- : 0;
- const retireNeed = monthlyGap * 12 * annuityFactor; // 万 · PV 现值(at retirement t=N)
- const retireGap = Math.max(0, retireNeed - existingRetirement);
- const savingYears = Math.max(1, yearsToRetire);
- // [v4.7+ Jack 2026-06-21 立法] 替换原 ×0.65 魔术系数 → 精算 FV 年金未来值因子
- // 精算等价:X × FV_annuity_factor_N(IRR) = retireGap (退休时所需购买力)
- // 其中 FV_annuity_factor = ((1+IRR)^N - 1) / IRR(年末缴费 · 复利累积)
- // IRR = inflationRate = 3%(假设保险公司投资收益率与通胀对冲)
- // 旧公式 0.65/N 在 N=20 时近似(误差 -13%),N=5 时严重低估 -31%(银发族痛点)
- // 新公式动态联动 retireYears + inflationRate,且明确"年金险杠杆"语义
- // 反方:实际产品因运营成本 + 利润 margin 比纯精算高 5-10%,本工具暂不加成,留代理人现场报价空间
- const _retireFvFactor = inflationRate > 0
- ? (Math.pow(1 + inflationRate, savingYears) - 1) / inflationRate
- : savingYears;
- const retirePremium = (retireGap / _retireFvFactor) * 10000; // 元
- // ===== 5. 教育金险(独立) =====
- // 教育金险需求 = 总教育金 - 已储备 - 已配教育金险(避免重复)
- const eduNeed = totalEduWithInflation;
- const eduCoveredByInsurance = existingEduInsurance;
- const eduGap = Math.max(0, eduNeed - existingEdu - eduCoveredByInsurance);
- // [v4.7+ Jack 2026-06-21 立法] 教育金精算公式
- // 旧:(eduGap / 10) × 0.85 — 10 年缴清硬编码 + 0.85 魔术系数
- // 新:与子女年龄联动 + FV 精算
- // eduPremiumYears = max(5, min(15, 18 - 最小子女年龄))(已有同源逻辑)
- // IRR = 3%(教育金险产品保守假设)· 反方:实际教育金险产品 IRR 4-5%,本工具用 3% 保守估算
- const eduIRR = 0.03;
- const eduPremiumYears = (function() {
- if (!Array.isArray(childAges) || childAges.length === 0) return 10; // 无子女兜底(其实 eduGap=0 也不会用)
- const youngest = Math.min.apply(null, childAges);
- return Math.max(5, Math.min(15, 18 - youngest));
- })();
- const _eduFvFactor = eduIRR > 0
- ? (Math.pow(1 + eduIRR, eduPremiumYears) - 1) / eduIRR
- : eduPremiumYears;
- const eduPremium = (eduGap / _eduFvFactor) * 10000; // 元
- // ===== 总计 =====
- // [v3.6 修订] totalCoverage 5 项 = 老的 5 险种合计;意外/终身寿在下方 v3.0 段独立加(accNeed/wlNeed)
- // 最终对外显示是 totalCoverage7 = totalCoverage + accNeed + wlNeed (line ~3342)
- const totalCoverage = ciNeed + medNeed + lifeNeed + retireNeed + eduNeed;
- const totalGap = ciGap + medGap + lifeGap + retireGap + eduGap;
- const totalPremium = ciPremium + medPremium + lifePremium + retirePremium + eduPremium;
- const leverage = totalPremium > 0 ? (totalCoverage * 10000 / totalPremium) : 0;
- // ===== [v3.6] 渲染 7 险种计算依据展开块 =====
- // 把所有上下文打包传给 renderFormulaPanel
- // [v3.6 修订] 用 v3.0 段定义的 accNeed/wlNeed(在 line 3315/3329),不用我之前重复定义的 accidentNeed
- // 注:此处 ctx 写"占位",实际 accNeed/wlNeed 在 v3.0 段算完后,会重写 ctx + 重新调 renderFormulaPanel
- const _eduPathLabels = { 'domestic':'国内本科 ¥100万','domestic_plus':'国内+海外硕士 ¥250万','full_overseas':'全程英美 ¥600万','elite_us':'美高+美本+美研 ¥1000万' };
- const _aumForLifeRender = portraitTotalAum > 0 ? portraitTotalAum : (totalWealth > 0 ? totalWealth : (liquid * 5));
- // [v3.6] 注:这里先不调用 renderFormulaPanel,等 v3.0 段算完 accNeed/wlNeed 再调(line ~3349)
- // ===== 渲染 =====
- // Cover
- document.getElementById('rcTitle').textContent = surname + (gender === 'M' ? '先生' : '女士') + '(' + age + '岁) · 保险配置诊断';
- document.getElementById('rcSubtitle').textContent =
- `年薪 ¥${salary}万 · ${childCount} 个子女 · ${retireAge} 岁退休 · 替代率 ${(retireLifestyleRatio*100).toFixed(0)}% · 折现 ${(incomeDiscountRate*100).toFixed(0)}% · v2.8 DIM 去重 + 支付能力约束`;
- document.getElementById('totalCoverage').textContent = fmtWan(totalCoverage);
- document.getElementById('totalGap').textContent = fmtWan(totalGap);
- document.getElementById('totalPremium').textContent = '¥' + (totalPremium/10000).toFixed(1) + '万';
- document.getElementById('leverage').textContent = leverage.toFixed(1) + ' 倍';
- // ===== [模块打通 Phase 1 · 2026-07-18] 写客户上下文总线 =====
- // IC 算完保额缺口 → patch 到 cy_client_session,供 CRS / 信托 / 身份规划读取。
- // 容错:总线未加载(独立分发/旧缓存)时静默跳过,不影响 IC 本身。
- try {
- if (window.CYClientContext) {
- var _icPersona = '';
- try { _icPersona = sessionStorage.getItem('cy_persona_id') || ''; } catch (e) {}
- var _icCid = window.CYClientContext.get('clientId') || _icPersona || window.CYClientContext.get('portrait') || '';
- window.CYClientContext.patch({
- surname: surname,
- clientId: _icCid, // 供 ActionHub 一致性校验
- portrait: _icPersona || window.CYClientContext.get('portrait') || '',
- insurance: {
- clientId: _icCid,
- gap: Math.round(totalGap * 10000), // 万 → 元
- coverage: Math.round(totalCoverage * 10000),
- premium: Math.round(totalPremium), // 元
- tier: isHNWFinal ? 'hnw' : 'std',
- totalWealthWan: Math.round(totalWealth),
- summary: '保额缺口 ¥' + Math.round(totalGap) + '万',
- measuredAt: Date.now(), // ActionHub 工具驱动点亮依据
- source: 'InsuranceCalculator_v5.0'
- }
- });
- }
- } catch (e) { console.warn('[IC] CYClientContext patch skipped', e); }
- // ════════════════════════════════════════════════════════════════
- // [v4.2 重构] 终身寿险公式段提前到 UI 渲染之前(避免 ReferenceError TDZ)
- // ════════════════════════════════════════════════════════════════
- // v4.2 四大改动(对比 v4.0):
- // A · 境内/境外按客户实际资产分布(不是整体 AUM × 比例)
- // - 境内增额终身寿 = 境内资产 × 30-50%(主+配合计)
- // - 境外 IUL/VUL/PPLI = 境外资产 × 30%/50%(普通/跨境美籍)
- // B · 境内增额终身寿用 max(salary×10, AUM×20%) 拉下限,确保 UHNW 合计 ≥ 30% 境内
- // C · PPLI 装入资产 × 1.0(去掉 ×1.05 corridor,离岸 PPLI 不受 §7702 约束)
- // D · 一次性赔付 ≤ AUM 铁律 + 优先级缩减(境外→境内→定寿→基础三层永不缩减)
- //
- // PPLI 门槛 $2000 万美金不变(v4.0 立法保留)
- const totalAumForWL = portraitTotalAum > 0 ? portraitTotalAum : (totalWealth > 0 ? totalWealth : liquid * 5);
- const aumUSD = totalAumForWL / 7;
- const PPLI_THRESHOLD_USD = 2000;
- const enablePPLI = aumUSD >= PPLI_THRESHOLD_USD;
- // [v4.2] 境内/境外资产分离(核心改动 A)
- // overseasAssetsEffective = 实际境外资产 + (toggle 勾选 ? AUM × 30% : 0)
- const overseasAssetsEffective = overseasAssetsRaw + (overseasFuturePlan ? Math.round(totalAumForWL * 0.30) : 0);
- const domesticAssets = Math.max(0, totalAumForWL - overseasAssetsEffective);
- // 杠杆倍数(Benchmark middle-funded · 国际惯例 max-funded 取下限)
- const ageMultiplier =
- age <= 45 ? 80 :
- age <= 55 ? 40 :
- age <= 65 ? 20 : 10;
- let wlDomestic = 0;
- let wlOverseasIUL = 0;
- let wlOverseasPPLI = 0;
- let ppliInjectable = 0;
- let annualPremiumIULWan = 0;
- let wlOverseasTier = '';
- let wlOverseasMethod = '';
- if (isHNWFinal) {
- // === 境内增额终身寿 (主理人 + 配偶) · v4.3 优化 ===
- // 主理人下限 = max(salary × 10, 境内资产 × 30%)
- // 主理人上限 = ageCap(5亿/3亿/1亿,监管不可越)
- // [v4.3 优化 ①] 配偶比例 = min(0.5, spouseSalary/salary),无收入则 0
- // 避免"配偶无收入仍配 50%"的虚假需求
- // [v4.3 优化 ②] 合计上限 = 境内资产 × 50%(防止 max 公式过激)
- const ageCapWL = age < 65 ? 50000 : (age < 70 ? 30000 : 10000);
- const wlPrincipal_lower = Math.max(salary * 10, Math.round(domesticAssets * 0.30));
- let wlPrincipal = Math.min(wlPrincipal_lower, ageCapWL);
- // 配偶比例(按收入比例,无收入则 0)
- const spouseRatio = (spouseSalary > 0 && salary > 0)
- ? Math.min(0.5, spouseSalary / salary)
- : 0;
- let wlSpouse = Math.round(wlPrincipal * spouseRatio);
- wlDomestic = wlPrincipal + wlSpouse;
- // 合计上限 = 境内资产 × 50%(防止过激)
- const wlDomesticCap = Math.round(domesticAssets * 0.50);
- if (wlDomestic > wlDomesticCap && wlDomesticCap > 0) {
- const cutRatio = wlDomesticCap / wlDomestic;
- wlPrincipal = Math.round(wlPrincipal * cutRatio);
- wlSpouse = Math.round(wlSpouse * cutRatio);
- wlDomestic = wlPrincipal + wlSpouse;
- }
- // === 境外 IUL/VUL · 按实际境外资产 × needRatio ===
- const overseasNeedRatio = hasUSPerson ? 0.50 : 0.30;
- if (overseasAssetsEffective > 0) {
- // 入门档 / 中段档(IUL/VUL,默认所有 HNW 走这个,除非启用 PPLI)
- wlOverseasIUL = Math.round(overseasAssetsEffective * overseasNeedRatio);
- annualPremiumIULWan = Math.round(wlOverseasIUL / ageMultiplier);
- }
- // === PPLI(单选 · aumUSD ≥ $2000 万 + 客户实际有海外资产时启用 · 替代 IUL/VUL)===
- // PPLI 装入资产合计 = liquid×100% + primaryResidence×0% + investAssets×30%
- // PPLI 保额 = 装入资产合计(去掉 ×1.05 corridor,离岸 PPLI 不受 §7702 约束)
- if (enablePPLI && overseasAssetsEffective > 0) {
- ppliInjectable = Math.round(
- liquid * 1.00 +
- primaryResidence * 0.00 +
- investAssets * 0.30
- );
- wlOverseasPPLI = ppliInjectable; // [v4.2] 装入多少 = 保多少,不再 ×1.05
- // PPLI 单选模式:替代 IUL/VUL,不并行
- wlOverseasIUL = 0;
- annualPremiumIULWan = 0;
- }
- // 推荐档位(用于 UI 显示)
- if (overseasAssetsEffective <= 0) {
- wlOverseasTier = '无境外资产 · 境外寿险 = 0';
- wlOverseasMethod = '客户境外资产为 0,境外寿险无配置需求(toggle 勾选未来计划可估算)';
- } else if (aumUSD < 500) {
- wlOverseasTier = 'IUL 入门';
- wlOverseasMethod = `境外资产 ¥${overseasAssetsEffective}万 × ${(overseasNeedRatio*100).toFixed(0)}% = ¥${wlOverseasIUL}万 · 年保费 ¥${annualPremiumIULWan}万`;
- } else if (!enablePPLI) {
- wlOverseasTier = 'IUL / VUL';
- wlOverseasMethod = `境外资产 ¥${overseasAssetsEffective}万 × ${(overseasNeedRatio*100).toFixed(0)}% = ¥${wlOverseasIUL}万 · AUM 未达 $2000 万 PPLI 门槛`;
- } else {
- wlOverseasTier = 'PPLI(替代 IUL/VUL · 单选模式)';
- wlOverseasMethod = `PPLI 装入 ¥${ppliInjectable}万(流动 100% + 投资 30% + 自住 0%)= 保额 ¥${wlOverseasPPLI}万`;
- }
- } else {
- // 普通家庭 · 仅境内增额终身寿(传承隔离基线 · 境外 = 0)
- wlDomestic = Math.round(domesticAssets * 0.30);
- wlOverseasIUL = 0;
- wlOverseasPPLI = 0;
- wlOverseasTier = '';
- }
- let wlOverseas = wlOverseasIUL + wlOverseasPPLI;
- let wlNeed = wlDomestic + wlOverseas;
- const wlExisting = existingWholeLife;
- let wlGap = Math.max(0, wlNeed - wlExisting);
- // [v4.7+ Jack 2026-06-21 立法] 终身寿险费率查表(替换原 0.025 × (20/N) 线性反推)
- // 真实保险产品费率:短缴期客户活到缴清概率高 + 资金沉淀久 → 短缴费率不是简单 4 倍
- // 行业基准(40 岁健康标体非吸烟,IUL/增额终身寿)·若客户更老/吸烟实际更高,本工具保守估算
- // N=5 → 7.5%(年缴 5 年累计 ≈ 37.5% 保额)
- // N=10 → 4.0%(累计 ≈ 40%)
- // N=15 → 3.0%(累计 ≈ 45%)
- // N=20 → 2.5%(累计 ≈ 50% · 标准档)
- // N=30 → 2.0%(累计 ≈ 60%)
- // 反方:不分年龄 / 性别 / 健康状况 / 产品类型(IUL vs 增额终身寿) — 仍是粗估
- // 但比"线性反推 0.025×(20/N)"更接近真实(N=5 时从 10% 降到 7.5% 减少高估)
- function _wlRateLookup(payYears) {
- // 锚点 + 线性插值 · rate(N) = low + (N-lowN)/(highN-lowN) × (high-low)
- if (payYears <= 5) return 0.075;
- if (payYears <= 10) return 0.075 + (payYears - 5) / 5 * (0.040 - 0.075); // 5→10: 7.5%→4.0%
- if (payYears <= 15) return 0.040 + (payYears - 10) / 5 * (0.030 - 0.040); // 10→15: 4.0%→3.0%
- if (payYears <= 20) return 0.030 + (payYears - 15) / 5 * (0.025 - 0.030); // 15→20: 3.0%→2.5%
- if (payYears <= 30) return 0.025 + (payYears - 20) / 10 * (0.020 - 0.025); // 20→30: 2.5%→2.0%
- return 0.020;
- }
- const wlPayYears = Math.min(20, Math.max(5, yearsToRetire > 0 ? yearsToRetire : 20));
- const _wlRate = _wlRateLookup(wlPayYears);
- let wlPremium = Math.round(wlNeed * _wlRate * 10000);
- // 1. 重疾
- document.getElementById('ciAmount').innerHTML = fmtWan(ciNeed).replace('万', '<span class="unit">万</span>').replace('亿', '<span class="unit">亿</span>');
- document.getElementById('ciExisting').textContent = fmtWan(existingCI);
- document.getElementById('ciGapText').textContent = fmtWan(ciGap);
- document.getElementById('ciCalc').textContent = `= ¥${salary}万 × ${ciMultiplier} = ¥${ciNeed}万`;
- document.getElementById('ciPremium').textContent = '¥' + Math.round(ciPremium).toLocaleString();
- setBars('ci', existingCI, ciGap, ciNeed);
- renderPolicyStatus('ci', existingCI, ciGap, ciNeed);
- // 2. 高端医疗
- document.getElementById('medExisting').textContent = existingMed === 1 ? '¥800万级' : '无';
- document.getElementById('medGapText').textContent = fmtWan(medGap);
- document.getElementById('medPremium').textContent = '¥' + Math.round(medPremium).toLocaleString();
- setBars('med', existingMed === 1 ? medNeed : 0, medGap, medNeed);
- renderPolicyStatus('med', existingMed === 1 ? medNeed : 0, medGap, medNeed);
- // 3. 寿险(DIME / HNW 双轨)
- document.getElementById('lifeAmount').innerHTML = fmtWan(lifeNeed).replace('万', '<span class="unit">万</span>').replace('亿', '<span class="unit">亿</span>');
- document.getElementById('lifeExisting').textContent = fmtWan(existingLife);
- document.getElementById('lifeGapText').textContent = fmtWan(lifeGap);
- document.getElementById('lifePremium').textContent = '¥' + Math.round(lifePremium).toLocaleString();
- setBars('life', existingLife, lifeGap, lifeNeed);
- renderPolicyStatus('life', existingLife, lifeGap, lifeNeed);
- const lifeCard = document.getElementById('lifeCard');
- const hnwBadge = document.getElementById('hnwBadge');
- const dimeFormula = document.getElementById('dimeFormula');
- const hnwTabsWrap = document.getElementById('hnwTabsWrap');
- const wlNonHnwHint = document.getElementById('wlNonHnwHint'); // v1.2 新增
- if (isHNWFinal) {
- // === HNW 模式 ===
- lifeCard.classList.add('hnw-mode');
- hnwBadge.style.display = 'inline-block';
- // v1.2 dimeFormula 始终保留(定期寿险/中端层 · 所有客户都需要主理人收入替代)
- dimeFormula.style.display = 'block';
- hnwTabsWrap.style.display = 'block';
- if (wlNonHnwHint) wlNonHnwHint.style.display = 'none'; // 隐藏非 HNW 提示
- // [v3.6] 寿险卡 = 境内,境外 PPLI 已分到终身寿险卡 → 主标修改提示
- document.getElementById('lifeAmountSub').textContent =
- 'HNW 双轨之中端 · 境内寿险(主理人收入替代 + 流动性补充);境外终身寿(IUL/VUL/PPLI)已迁至终身寿险卡';
- // [v3.6] 境内 Tab · 增额终身寿(主理人 + 配偶分散投保)
- // 公式:主理人 = min(salary × 10, 总财富 × 50%, 监管上限) / 配偶 = 主理人 × 50%
- // 注:这里的 domesticAmount 显示的是 wlDomestic(终身寿,不是定期寿险)
- document.getElementById('domesticAmount').innerHTML =
- fmtWan(wlDomestic).replace('万', '<span class="unit">万</span>').replace('亿', '<span class="unit">亿</span>');
- const _ageCapWLShow = age < 65 ? 50000 : (age < 70 ? 30000 : 10000);
- const _wlPrincipalRawShow = salary * 10;
- const _wlPrincipalShow = Math.min(_wlPrincipalRawShow, Math.round(totalAumForWL * 0.50), _ageCapWLShow);
- const _wlSpouseShow = Math.round(_wlPrincipalShow * 0.5);
- document.getElementById('domesticCalc1').textContent =
- `▸ 主理人增额终身寿 = min(salary ${salary}×10=${_wlPrincipalRawShow}, 总财富${(totalAumForWL/10000).toFixed(2)}亿×50%=${Math.round(totalAumForWL*0.5)}, ${(_ageCapWLShow/10000)}亿监管) = ¥${_wlPrincipalShow}万`;
- document.getElementById('domesticCalc2').textContent =
- `▸ 配偶补充(主理人 50%)= ¥${_wlSpouseShow}万`;
- // [v4.0] 境外 Tab · IUL/VUL/PPLI 公式按产品本质重写
- // IUL/VUL: 保额 = AUM × needRatio(普通 80% / 跨境美籍 150%),反推年保费 = 保额 / 杠杆
- // PPLI: 保额 = 装入资产合计(按流动性权重 · v4.2 立法去掉 ×1.05 corridor · 离岸 PPLI 不受 §7702 约束)
- document.getElementById('overseasAmount').innerHTML =
- fmtWan(wlOverseas).replace('万', '<span class="unit">万</span>').replace('亿', '<span class="unit">亿</span>');
- const _overseasSubEl = document.getElementById('overseasAmountSub');
- if (_overseasSubEl) {
- _overseasSubEl.textContent = `境外终身寿 · 推荐 ${wlOverseasTier}(AUM ${(aumUSD/100).toFixed(0)} 百万美金) · 建议 3-5 张保单分批配置`;
- }
- const _overseasNeedRatioShow = hasUSPerson ? 1.50 : 0.80;
- document.getElementById('overseasCalc1').textContent =
- `▸ IUL/VUL 保额 = AUM ${(totalAumForWL/10000).toFixed(2)}亿 × ${(_overseasNeedRatioShow*100).toFixed(0)}% = ¥${wlOverseasIUL}万`;
- document.getElementById('overseasCalc2').textContent =
- enablePPLI
- ? `▸ PPLI 保额 = 装入资产合计 ¥${ppliInjectable}万(按流动性权重:流动 100% + 自住 0% + 投资 30%) · IUL/VUL + PPLI 双壳并行`
- : `▸ 反推年保费 = ¥${wlOverseasIUL}万 / 杠杆 ${ageMultiplier}x = ¥${annualPremiumIULWan}万 (占 AUM ${(annualPremiumIULWan/totalAumForWL*100).toFixed(2)}%)`;
- const _calc3 = document.getElementById('overseasCalc3');
- if (_calc3) {
- _calc3.style.color = 'var(--accent)';
- _calc3.innerHTML = enablePPLI
- ? `✓ AUM ≥ $2000 万美金 · PPLI 启用 · 建议 3-5 张保单分批配置(单笔 ¥3000-5000 万)`
- : `⚠ AUM < $2000 万美金不启用 PPLI · 优先 IUL / VUL · 建议 3-5 张保单分批配置(单笔 ¥3000-5000 万)`;
- }
- // 境外装入表(PPLI 启用时显示装入资产明细;IUL/VUL 档显示杠杆反推)
- const ppliBody = document.getElementById('ppliTableBody');
- if (enablePPLI) {
- // PPLI 装入明细(国际惯例 · 4 盘分类)
- const rows = [];
- if (liquid > 0) rows.push({ label: '💧 流动金融(现金/债券/基金/上市股/黄金 ETF)', ratio: 1.00, val: Math.round(liquid * 1.00) });
- if (primaryResidence > 0) rows.push({ label: '🏠 自住房产(违反 investor control · 不可装入)', ratio: 0.00, val: 0 });
- if (investAssets > 0) rows.push({ label: '📈 其他投资(私募/PE/REITs · 仅 30% 通过 LP 间接装)', ratio: 0.30, val: Math.round(investAssets * 0.30) });
- ppliBody.innerHTML = rows.map(r => `
- <tr>
- <td>${r.label}</td>
- <td>${Math.round(r.ratio * 100)}%</td>
- <td class="num">${fmtWan(r.val)}</td>
- </tr>
- `).join('') + `<tr><td><strong>装入合计</strong></td><td>—</td><td class="num"><strong>${fmtWan(ppliInjectable)}</strong></td></tr>`
- + `<tr style="background:rgba(201,168,76,.08)"><td><strong>PPLI 保额(按流动性合计)</strong></td><td>—</td><td class="num"><strong style="color:var(--accent)">${fmtWan(wlOverseasPPLI)}</strong></td></tr>`;
- } else {
- // IUL/VUL 档:展示 AUM × needRatio + 杠杆反推
- ppliBody.innerHTML = `
- <tr>
- <td>📋 IUL/VUL 保额需求(AUM × ${(_overseasNeedRatioShow*100).toFixed(0)}%)</td>
- <td>${(_overseasNeedRatioShow*100).toFixed(0)}%</td>
- <td class="num"><strong>${fmtWan(wlOverseasIUL)}</strong></td>
- </tr>
- <tr>
- <td>💰 反推年保费(保额 / 杠杆 ${ageMultiplier}x)</td>
- <td>÷ ${ageMultiplier}</td>
- <td class="num">${fmtWan(annualPremiumIULWan)} <span style="font-size:10.5px;color:var(--text-dim)">(占 AUM ${(annualPremiumIULWan/totalAumForWL*100).toFixed(2)}%)</span></td>
- </tr>
- <tr style="background:rgba(201,168,76,.08)">
- <td><strong>⚠ 实操建议</strong></td>
- <td>—</td>
- <td class="num" style="font-size:10.5px;color:var(--accent);font-weight:600">3-5 张保单分批配置</td>
- </tr>`;
- }
- // 双轨比例 · 终身寿合计 = 境内 + 境外
- const _wlTotal = wlDomestic + wlOverseas;
- const _domRatio = _wlTotal > 0 ? Math.round(wlDomestic / _wlTotal * 100) : 0;
- const _ovRatio = 100 - _domRatio;
- const _dualRatioEl = document.getElementById('dualRatio');
- const _dualTotalEl = document.getElementById('dualTotal');
- if (_dualRatioEl) _dualRatioEl.textContent = `境内 ${_domRatio}% : 境外 ${_ovRatio}%`;
- if (_dualTotalEl) _dualTotalEl.textContent = fmtWan(_wlTotal);
- } else {
- // === 普通家庭 DIME 模式(P3.2 · 双轨永久展示 · 用占位符填充)===
- lifeCard.classList.remove('hnw-mode');
- hnwBadge.style.display = 'none';
- dimeFormula.style.display = 'block';
- hnwTabsWrap.style.display = 'block'; // P3.2 · 强制展示
- if (wlNonHnwHint) wlNonHnwHint.style.display = 'block';
- document.getElementById('lifeAmountSub').textContent =
- '建议保额 · 主理人意外身故时的家庭保障';
- // P3.2 · 普通家庭模式下双轨用占位符(不混淆数据)
- document.getElementById('domesticAmount').innerHTML = '— <span class="unit">未达 HNW</span>';
- document.getElementById('domesticCalc1').textContent = '▸ 主理人寿险:未达 HNW 标准,境内寿险按定期寿险充足';
- document.getElementById('domesticCalc2').textContent = '▸ 配偶补充:同上';
- document.getElementById('overseasAmount').innerHTML = '— <span class="unit">未达 HNW</span>';
- const ppliBody = document.getElementById('ppliTableBody');
- if (ppliBody) {
- ppliBody.innerHTML = '<tr><td colspan="3" style="text-align:center;color:var(--text-dim);padding:14px;font-size:11.5px">⚪ 当前未达 HNW 标准(AUM ≥ ¥5 亿 / 美籍二代 / 多子女),境外 IUL/VUL/PPLI 配置暂不适用 · 仅供参考结构</td></tr>';
- }
- const dualRatioEl = document.getElementById('dualRatio');
- const dualTotalEl = document.getElementById('dualTotal');
- if (dualRatioEl) dualRatioEl.textContent = '— · 待 HNW 触发';
- if (dualTotalEl) dualTotalEl.textContent = '—';
- document.getElementById('lifeCalcD').textContent = `D 房贷+负债 = ${mortgage} + ${otherDebt} = ¥${D}万`;
- const discountLabel = incomeDiscountRate > 0
- ? ` · 折现 ${(incomeDiscountRate*100).toFixed(0)}% (PV因子 ${annuityPVFactor.toFixed(2)})`
- : ' · 不折现(简单累加)';
- document.getElementById('lifeCalcI').textContent =
- `I 收入替代 = ${salary} × ${(incomeReplaceRate*100).toFixed(0)}% (主理人占比${principalShare<0.3?',30%保底':''}) × ${yearsToRetire}年${discountLabel} = ¥${Math.round(I)}万${incomeDiscountRate>0?' (vs 简单累加 ¥'+Math.round(I_undiscounted)+'万)':''}`;
- document.getElementById('lifeCalcE').textContent =
- `E 教育金 = ¥0万 (v2.8 已剥离 · 由独立教育金险覆盖,避免重复计入)`;
- document.getElementById('lifeCalcE').style.opacity = '0.55';
- document.getElementById('lifeCalcA').textContent = `A 现有资产 = ¥${A}万 → DIM 寿险需求 = D + I - A = ¥${Math.round(lifeNeed)}万`;
- }
- // 4. 养老金
- document.getElementById('retireAmount').innerHTML = fmtWan(retireNeed).replace('万', '<span class="unit">万</span>').replace('亿', '<span class="unit">亿</span>');
- document.getElementById('retireExisting').textContent = fmtWan(existingRetirement);
- document.getElementById('retireGapText').textContent = fmtWan(retireGap);
- document.getElementById('retireCalc1').textContent =
- `退休后月支出 = ¥${salary}万 × ${(retireLifestyleRatio*100).toFixed(0)}% (替代率) / 12 = ¥${retireMonthlyExp.toFixed(2)}万/月`;
- document.getElementById('retireCalc2').textContent =
- `月缺口 ¥${monthlyGap.toFixed(2)}万 × 12 × 年金现值因子 ${annuityFactor.toFixed(2)} (${retireYears}年通胀3%折现) = ¥${Math.round(retireNeed)}万 PV`;
- document.getElementById('retirePremium').textContent = '¥' + Math.round(retirePremium).toLocaleString();
- setBars('retire', existingRetirement, retireGap, retireNeed);
- renderPolicyStatus('retire', existingRetirement, retireGap, retireNeed);
- // 5. 教育金
- document.getElementById('eduAmount').innerHTML = fmtWan(eduNeed).replace('万', '<span class="unit">万</span>').replace('亿', '<span class="unit">亿</span>');
- document.getElementById('eduExisting').textContent = fmtWan(existingEdu + eduCoveredByInsurance);
- document.getElementById('eduGapText').textContent = fmtWan(eduGap);
- document.getElementById('eduCalc').innerHTML = eduCalcDetail.length
- ? eduCalcDetail.map(l => '▸ ' + l).join('<br>') + '<br>合计 = ¥' + Math.round(eduNeed) + '万'
- + (eduCoveredByInsurance > 0 ? '<br>已配教育金险 ¥' + eduCoveredByInsurance + '万' : '')
- + (existingEdu > 0 ? '<br>现金/理财储备 ¥' + existingEdu + '万' : '')
- + '<br><strong>缺口 = ¥' + Math.round(eduGap) + '万</strong>'
- : '无子女,无教育金需求';
- document.getElementById('eduPremium').textContent = '¥' + Math.round(eduPremium).toLocaleString();
- setBars('edu', existingEdu + eduCoveredByInsurance, eduGap, eduNeed);
- renderPolicyStatus('edu', existingEdu + eduCoveredByInsurance, eduGap, eduNeed);
- // ════════════════════════════════════════════════════════════════
- // === v3.0 新增 2 险种诊断(意外险 / 终身寿险 · v1.1 已去掉护理险/满期金)===
- // ════════════════════════════════════════════════════════════════
- // 年支出估算:工资 × 60%(简化版 · 后续 Phase 2 可从 portrait.family.annual_expense_cny 读)
- const annualExpenseWan = Math.max(20, Math.round((salary + spouseSalary) * 0.6));
- // 6. 意外险(基础风险层)· [v4.5.3] 差异化定位 · 与定期寿险互补
- // 旧 v3.6:HNW = 0 / 普通 = salary × 8(身故 + 伤残合并)→ 与定寿身故场景重叠
- // 新 v4.5.3 立法(Jack 2026-06-20):意外险**只定位为伤残保障**(意外身故由定寿覆盖)
- // • HNW = salary × 3(伤残应急现金 3 年 · AUM 充足但需短期流动性)
- // • 普通 = salary × 5(伤残期 5 年家庭过渡 · 主理人不能工作但活着)
- // 定位:意外险 = 伤残保障(独有价值)/ 定期寿险 = 任何身故保障
- const accNeed = isHNWFinal ? Math.round(salary * 3) : Math.round(salary * 5);
- const accExisting = existingAccident;
- const accGap = Math.max(0, accNeed - accExisting);
- const accPremium = Math.round(accNeed * 0.0015 * 10000); // 0.15% 费率
- document.getElementById('accAmount').innerHTML = fmtWan(accNeed).replace('万', '<span class="unit">万</span>').replace('亿', '<span class="unit">亿</span>');
- document.getElementById('accExisting').textContent = fmtWan(accExisting);
- document.getElementById('accGapText').textContent = fmtWan(accGap);
- document.getElementById('accCalc').textContent = isHNWFinal
- ? `= HNW 伤残应急现金 = 年薪 ¥${salary} 万 × 3 = ¥${accNeed} 万(意外身故由定寿覆盖)`
- : `= 普通家庭伤残期 5 年家庭过渡 = 年薪 ¥${salary} 万 × 5 = ¥${accNeed} 万`;
- document.getElementById('accPremium').textContent = '¥' + accPremium.toLocaleString();
- setBars('acc', accExisting, accGap, Math.max(1, accNeed));
- renderPolicyStatus('acc', accExisting, accGap, accNeed);
- // ════════════════════════════════════════════════════════════════
- // 7. 终身寿险 UI 渲染段(v4.0 · 公式段已移到 calculate() 早期 line ~3186 之前以避免 TDZ)
- // ════════════════════════════════════════════════════════════════
- // 这里只做 UI 渲染,不做计算
- document.getElementById('wlAmount').innerHTML = fmtWan(wlNeed).replace('万', '<span class="unit">万</span>').replace('亿', '<span class="unit">亿</span>');
- document.getElementById('wlExisting').textContent = fmtWan(wlExisting);
- document.getElementById('wlGapText').textContent = fmtWan(wlGap);
- document.getElementById('wlCalc').textContent = isHNWFinal
- ? (enablePPLI
- ? `= 境内增额终身寿 ¥${wlDomestic} 万 + 境外 ${wlOverseasTier}(IUL/VUL ¥${wlOverseasIUL} 万 + PPLI ¥${wlOverseasPPLI} 万)= ¥${wlNeed} 万`
- : `= 境内增额终身寿 ¥${wlDomestic} 万 + 境外 ${wlOverseasTier} ¥${wlOverseasIUL} 万(年保费 ¥${annualPremiumIULWan} 万 × 杠杆 ${ageMultiplier}x)= ¥${wlNeed} 万`)
- : `= 总财富 ¥${Math.round(totalAumForWL)} 万 × 30% = ¥${wlNeed} 万(传承隔离基线)`;
- document.getElementById('wlPremium').textContent = '¥' + wlPremium.toLocaleString();
- setBars('wl', wlExisting, wlGap, Math.max(1, wlNeed));
- renderPolicyStatus('wl', wlExisting, wlGap, wlNeed);
- // ════════════════════════════════════════════════════════════════
- // [v4.3 软提示] 一次性赔付保额 vs AUM(Jack 2026-06-16 立法)
- // ════════════════════════════════════════════════════════════════
- // v4.2 旧:硬 100% Cap + 优先级缩减
- // v4.3 新:软提示(超过 AUM 100% 仅显示警示,不强制缩减)
- // 理由:
- // 1. 加上 v4.3 上游优化(配偶按 salary 比例 + 境内 50% Cap)后,数字已大幅可控
- // 2. 保险逻辑 ≠ 资产匹配 — 跨境美籍 / UHNW 跨境 100-150% AUM 是行业实操常态
- // 3. 真实约束应在保费支付能力,不是结果端硬砍
- // 4. 中产家庭一次性赔付 200%+ AUM 是合理的(基础保障 vs 资产基础)
- // 适用范围:HNW 模式 + 普通家庭模式都适用(都显示警示)
- let onetimeBeforeCap = ciNeed + medNeed + lifeNeed + wlDomestic + wlOverseas + accNeed;
- let onetimeCapped = false; // [v4.3] 不再表示"已缩减",而是"是否超过 80-100% 区间"
- let cappedDetail = '';
- let cappedOriginal = onetimeBeforeCap;
- let onetimeRatio = totalAumForWL > 0 ? (onetimeBeforeCap / totalAumForWL) : 0;
- // [v4.3] 软提示触发 · [v4.7 + Jack 2026-06-21] 按客户档位分级阈值,数字去小数
- // 行业逻辑(Jack 立法):基础保障 vs 资产基础不同,中产可超 200% AUM 合理,UHNW 30-60% 即可
- // 普通家庭 (totalWealth < 2000 万) : 100-300% AUM 合理(基础保障倍数高)
- // 中端档 (totalWealth ∈ [2000, 5000)) : 80-150% AUM
- // HNW (totalWealth ∈ [5000, 50000)) : 50-100% AUM(PPLI 装入比例小)
- // UHNW (totalWealth ≥ 50000) : 30-80% AUM(大额装入私行体系 + 多保单分批)
- if (totalAumForWL > 0) {
- let _tierLabel, _tierLow, _tierHigh, _tierTriggerPct;
- if (isHNWFinal && totalAumForWL >= 50000) {
- _tierLabel = 'UHNW(≥¥5亿 AUM)'; _tierLow = 30; _tierHigh = 80; _tierTriggerPct = 80;
- } else if (isHNWFinal) {
- _tierLabel = 'HNW(¥5000万-5亿 AUM)'; _tierLow = 50; _tierHigh = 100; _tierTriggerPct = 100;
- } else if (totalAumForWL >= 2000) {
- _tierLabel = '中端档(¥2000-5000 万)'; _tierLow = 80; _tierHigh = 150; _tierTriggerPct = 150;
- } else {
- _tierLabel = '普通家庭(<¥2000 万)'; _tierLow = 100; _tierHigh = 300; _tierTriggerPct = 300;
- }
- const _ratioPct = onetimeRatio * 100;
- if (_ratioPct > _tierTriggerPct) {
- onetimeCapped = true;
- cappedDetail = '当前一次性赔付 ¥' + Math.round(onetimeBeforeCap) + '万 = AUM ' + Math.round(_ratioPct) +
- '%,超过' + _tierLabel + '常规配置区间(' + _tierLow + '-' + _tierHigh + '% AUM)。' +
- '建议:配合保费融资 + 多保单分批 + 跨境合规通道,代理人 1v1 服务做精确测算。';
- }
- }
- // v3.0 · 7 险种总计重算(覆盖原 line 2346 的 5 险种总计)
- const totalCoverage7 = totalCoverage + accNeed + wlNeed;
- const totalGap7 = totalGap + accGap + wlGap;
- const totalPremium7 = totalPremium + accPremium + wlPremium;
- document.getElementById('totalCoverage').textContent = fmtWan(totalCoverage7);
- document.getElementById('totalGap').textContent = fmtWan(totalGap7);
- document.getElementById('totalPremium').textContent = '¥' + (totalPremium7 / 10000).toFixed(1) + '万';
- // ════════════════════════════════════════════════════════════════
- // [v4.0] 总保额三栏汇总(口径分离 · Jack 2026-06-15 立法)
- // ════════════════════════════════════════════════════════════════
- // 旧 v3.6:totalCoverage7 = 7 项简单累加(把"一次性赔付"+"长周期累积"混算)→ 误导大数字
- // 新 v4.0:三栏分离
- // A · 一次性赔付保额合计 = 重疾 + 医疗 + 定寿 + 终身寿(双轨)+ 意外
- // B · 长周期累积需求合计 = 养老 + 教育(30 年 / 22 年累积名义金额)
- // C · 客户实际年成本 = 7 项年缴保费合计(占 AUM 比例)
- // D · 保障杠杆 = 一次性赔付 / 总投入(20 年保费)
- const totalOnetimeCoverage = ciNeed + medNeed + lifeNeed + wlNeed + accNeed;
- const totalLongtermNeed = retireNeed + eduNeed;
- const totalAnnualPremium = totalPremium7; // 7 项年缴保费合计
- const annualPremiumPctOfWealth = totalAumForWL > 0
- ? (totalAnnualPremium / 10000 / totalAumForWL * 100).toFixed(2)
- : '0.00';
- // 三栏赋值
- document.getElementById('totalOnetimeCoverage').textContent = fmtWan(totalOnetimeCoverage);
- document.getElementById('totalLongtermNeed').textContent = fmtWan(totalLongtermNeed);
- document.getElementById('totalAnnualPremium').textContent = '¥' + (totalAnnualPremium / 10000).toFixed(1) + '万';
- document.getElementById('totalAnnualPremiumSub').textContent =
- `年缴保费 · 占总财富 ${annualPremiumPctOfWealth}% · 20 年累计 ¥${(totalAnnualPremium * 20 / 10000 / 10000).toFixed(2)}亿`;
- // [v4.7 + Jack 2026-06-21] 保障缺口 Hero tile · totalGap7 = 7 险种 need 累计 - existing 累计
- const _totalGapHeroEl = document.getElementById('totalGapHero');
- const _totalGapHeroSubEl = document.getElementById('totalGapHeroSub');
- if (_totalGapHeroEl) {
- _totalGapHeroEl.textContent = fmtWan(totalGap7);
- // 副文案:已配多少 / 占完整需求百分比 → 帮代理人现场讲"还差 X% 没补齐"
- const _coverageReady = totalCoverage7 - totalGap7; // 已有保单覆盖部分
- const _gapPct = totalCoverage7 > 0 ? (totalGap7 / totalCoverage7 * 100) : 0;
- if (_totalGapHeroSubEl) {
- if (totalGap7 <= 0) {
- _totalGapHeroSubEl.textContent = '✓ 7 险种已配齐 · 无缺口';
- } else {
- _totalGapHeroSubEl.textContent =
- '已配 ¥' + (_coverageReady>=10000 ? (_coverageReady/10000).toFixed(2)+'亿' : Math.round(_coverageReady)+'万') +
- ' · 仍缺 ' + _gapPct.toFixed(0) + '%';
- }
- }
- }
- // [v4.3] 软提示 UI · 一次性赔付超过 100% AUM 时显示警示条(不强制缩减)
- const _capWarnEl = document.getElementById('capWarningV43');
- if (_capWarnEl) {
- if (onetimeCapped) {
- _capWarnEl.style.display = 'block';
- _capWarnEl.innerHTML = '⚠ <strong>v4.3 软提示</strong>:' + cappedDetail;
- } else {
- _capWarnEl.style.display = 'none';
- }
- }
- // [v4.7] 保障杠杆 = 一次性赔付保额 / 20 年【纯保障型】保费(剔除养老/教育/终身寿储蓄部分)
- // 旧 v4.6:把养老金 / 终身寿 / 教育金的储蓄保费也算分母,导致银发族杠杆 ≈ 0.6×(储蓄稀释了纯保障杠杆)
- // 新 v4.7:分母 = acc + med + ci + life(纯保障层),银发族杠杆从 0.6× 回升到 3-15× 区间(行业本意)
- const protectionAnnualPremium = (accPremium || 0) + (medPremium || 0) + (ciPremium || 0) + (lifePremium || 0);
- const leverageV4 = protectionAnnualPremium > 0
- ? (totalOnetimeCoverage * 10000 / (protectionAnnualPremium * 20))
- : 0;
- document.getElementById('leverage').textContent = leverageV4.toFixed(1) + ' 倍';
- // [v4.7] 暴露给 renderPremiumTimeline 杠杆比 KPI 卡片复用同一口径
- window._cyProtectionAnnualPremiumYuan = protectionAnnualPremium;
- // ===== [v3.6] 渲染 7 险种计算依据展开块 · 等 v3.0 段算完 accNeed/wlNeed 后调用 =====
- // 数据保证一致:lifeNeed = HNW 模式境内 / wlNeed = HNW 模式境外 PPLI(普通家庭 = 资产×30%)
- renderFormulaPanel({
- // 控制流
- isHNWFinal, hasUSPerson,
- // 家庭信息
- salary, spouseSalary, age, childCount,
- eduUnit, eduPathLabel: _eduPathLabels[eduPath] || eduPath,
- // 7 险种 need/gap/premium · 用 v3.0 真实变量
- accidentNeed: accNeed, accidentGap: accGap, accidentPremium: accPremium,
- ciNeed, ciGap, ciPremium, ciMultiplier,
- medNeed, medPremium, existingMed,
- lifeNeed, lifeGap, lifePremium,
- domesticNeed, overseasNeed,
- wlNeed, wlGap, wlPremium, totalAumForWL,
- // [v4.0] 终身寿双轨参数(7 险种 modal 拆解用)
- wlDomestic, wlOverseas, wlOverseasIUL, wlOverseasPPLI,
- wlOverseasTier, ageMultiplier, annualPremiumIULWan, ppliInjectable, enablePPLI,
- aumUSD,
- retireNeed, retireGap, retirePremium, retireLifestyleRatio,
- retireYears: Math.max(0, lifeExpectancy - retireAge),
- eduNeed, eduGap, eduPremium,
- // 寿险 DIM 子项
- D, I, liquid,
- // [v4.4 修复] 寿险 DIM 法 I 项 ctx(明确折现率 + 主理人占比 + 工作期年数)
- incomeDiscountRate, principalShare, incomeReplaceRate,
- yearsToRetire, // 寿险 I 项专用 = 主理人到退休的年数(不同于 retireYears 养老金 30 年)
- // [v4.7+ 缴费年限智能化] 把动态 payYears 也传给 formula panel,替换硬编码 '20 年' / '20-30 年'
- ciPayYears, lifePayYears, wlPayYears, retirePayYears: Math.max(1, yearsToRetire),
- // [v4.7+ Jack 2026-06-21] 教育金缴费窗口直接复用算法侧 eduPremiumYears(已与子女年龄联动)
- eduPayYears: (Array.isArray(childAges) && childAges.length > 0) ? eduPremiumYears : 0,
- // 寿险 AUM 比例化(只 HNW 用)
- _lifeAgeMin: age < 65 ? 5000 : (age < 70 ? 3000 : 1000),
- _lifeAgeCap: age < 65 ? 50000 : (age < 70 ? 30000 : 10000),
- _lifeAumRatio: age < 65 ? 0.5 : (age < 70 ? 0.3 : 0.2),
- _aumForLife: _aumForLifeRender,
- // 总计 · 用 7 险种合计(对外显示)
- totalCoverage: totalCoverage7, totalGap: totalGap7, totalPremium: totalPremium7
- });
- // v2026-06-13 v1.4 · P2.1 · 年缴保费 donut 渲染
- renderPremiumDonut({
- acc: accPremium, med: medPremium, ci: ciPremium,
- edu: eduPremium, retire: retirePremium, life: lifePremium,
- wl: wlPremium, total: totalPremium7
- });
- // 高净值建议(画像驱动 + 数字驱动双层)
- const marriage = document.getElementById('marriage').value;
- renderUhnwSuggestions({
- age, salary, spouseSalary, lifeNeed, ciNeed, retireGap, eduGap,
- mortgage, otherDebt, childCount, gender, marriage,
- hasUS: hasUSPerson, isHNW: isHNWFinal
- });
- // [v4.8 · 2026-06-26] 客户家庭报告 · 一页总结(报告尾部"客户带走"卡)
- renderClientSummary({
- gaps: { acc: accGap, med: medGap, ci: ciGap, life: lifeGap,
- edu: eduGap, retire: retireGap, wl: wlGap },
- needs: { acc: accNeed, med: medNeed, ci: ciNeed, life: lifeNeed,
- edu: eduNeed, retire: retireNeed, wl: wlNeed },
- exists: { acc: existingAccident,
- med: existingMed === 1 ? medNeed : 0,
- ci: existingCI,
- life: existingLife,
- edu: existingEdu + existingEduInsurance,
- retire: existingRetirement,
- wl: existingWholeLife },
- salary, spouseSalary, totalPremium: totalPremium7
- });
- // 配置优先级 Timeline(v3.0 · 7 险种 · 按金字塔层 + 缺口规模排序)
- renderPriorityTimeline({
- lifeGap, lifeNeed, medGap, medNeed,
- ciGap, ciNeed, eduGap, eduNeed,
- retireGap, retireNeed,
- accGap, accNeed, wlGap, wlNeed,
- isHNW: isHNWFinal
- });
- // === Phase 3 · 7 险种缺口对比柱状图(v1.3 已移除 · 由金字塔体检卡取代)===
- // renderGapChart({ ... });
- // === v3.2 · 金字塔体检卡渲染(7 险种水位动画驱动)===
- renderCalcPyramidCheck({
- acc: { need: accNeed, existing: existingAccident },
- med: { need: medNeed, existing: existingMed === 1 ? medNeed : 0 },
- ci: { need: ciNeed, existing: existingCI },
- life: { need: lifeNeed, existing: existingLife },
- edu: { need: eduNeed, existing: existingEdu + existingEduInsurance },
- retire: { need: retireNeed, existing: existingRetirement },
- wl: { need: wlNeed, existing: existingWholeLife }
- });
- // === v3.4 · 家庭总财富画像(三盘合并视角)===
- // [v3.6] 加 insuranceCashValue 作为第 4 盘
- renderWealthPicture({
- liquid, primaryResidence, investAssets, insuranceCashValue, totalWealth,
- salary, spouseSalary, isHNW: isHNWFinal,
- portraitAum: portraitTotalAum
- });
- // === v2.8 · 支付能力健康度 + 行业基准对比 ===
- // [v4.4.5] 调用顺序:必须在 renderPremiumTimeline 之前 — 它会暴露 window._cyAffordableTotalYuan
- // [v4.4 修复 #7] 改用 totalPremium7(7 项合计,含意外+终身寿)统一口径
- renderAffordabilityCheck({
- salary, spouseSalary, totalCoverage: totalCoverage7, totalPremium: totalPremium7,
- affordabilityCap,
- isHNW: isHNWFinal,
- portraitAum: portraitTotalAum, // 万,从 portrait 读到的总 AUM
- liquidAssets: liquid, // 万,fallback 流动资产
- totalWealth: totalWealth, // [v3.4] 流动 + 自住 + 投资,优先于 liquid×5 fallback
- primaryResidence, investAssets, // [v3.4] 单独传给画像段使用
- eduPath, childAges, // [v2.9] 教育金分级缩减需要
- age, retireAge, // [v4.7] yearsToRetire ≤ 10 智能护栏需要
- premiums: {
- acc: accPremium, med: medPremium, ci: ciPremium,
- life: lifePremium, edu: eduPremium, retire: retirePremium,
- wl: wlPremium
- }
- });
- // === [v4.4] 现金流规划 · LDI 视角(年保费支出趋势图) ===
- // 数据驱动:每次 calculate() 触发时同步重绘 Canvas,实现"数据 → 趋势图"自动跟随
- // [v4.4.5] Canvas 红线 = affordableTotal(双轨 B 列实际可负担,与已有 UI 完全一致)
- // 而非 salary × cap% 的理论上限(避免 17.7 vs 16 万的认知冲突)
- // [v4.4.6] renderAffordabilityCheck 已在上方调用,window._cyAffordableTotalYuan 已就绪
- const _denomYuan = isHNWFinal
- ? (totalAumForWL > 0 ? totalAumForWL * 10000 : liquid * 5 * 10000)
- : (salary + spouseSalary) * 10000;
- const _HNW_CAP_MAP = {0.10:0.01, 0.15:0.015, 0.20:0.02, 0.30:0.03};
- const _capRatio = isHNWFinal
- ? (_HNW_CAP_MAP[affordabilityCap] !== undefined ? _HNW_CAP_MAP[affordabilityCap] : affordabilityCap*0.1)
- : affordabilityCap;
- // 优先使用 renderAffordabilityCheck 暴露的 affordableTotal(已运行过)
- const _affordableTotalYuan = (typeof window._cyAffordableTotalYuan === 'number')
- ? window._cyAffordableTotalYuan
- : (_capRatio * _denomYuan);
- const _isOverflow = !!window._cyIsOverflow;
- // [v4.4.6] 调试日志:每次重算时输出关键变量,便于 Jack 验证可负担上限红线动态变化
- if (window.console && console.log) {
- console.log('[v4.4.6 LDI 趋势图] isHNW:', isHNWFinal, '| affordabilityCap:', affordabilityCap,
- '| 理论上限 ¥', (_capRatio * _denomYuan / 10000).toFixed(1), '万 (salary/AUM × cap%)',
- '| 双轨B列 ¥', (_affordableTotalYuan/10000).toFixed(1), '万 (可负担方案,Canvas 红线用此值)',
- '| isOverflow:', _isOverflow);
- }
- renderPremiumTimeline({
- accidentPremium: accPremium,
- medPremium,
- ciPremium,
- lifePremium,
- retirePremium,
- eduPremium,
- wlPremium,
- // [v4.7+ Jack 2026-06-21] 教育金缴费窗口复用算法侧 eduPremiumYears(已与子女年龄联动)· 无子女兜底 15
- eduPayYears: (Array.isArray(childAges) && childAges.length > 0) ? eduPremiumYears : 15,
- // [v4.7+ 缴费年限智能化 v2] 把 PAY_CYCLES 用的智能 payYears 也透传给 Canvas 渲染端
- ciPayYears, lifePayYears, wlPayYears, retirePayYears: Math.max(1, yearsToRetire),
- totalAumForWL,
- isHNW: isHNWFinal,
- age, // [v4.4] 横轴投保人年龄起点
- salary, // [v4.4] 用于"建议 vs 可负担"对比
- affordableCap: _capRatio,
- denominatorYuan: _denomYuan,
- affordableTotalYuan: _affordableTotalYuan,
- isOverflow: _isOverflow,
- // [v4.5] 领取期参数
- retireAge, // 退休年龄(form 读)
- retireNeed, // 万,养老金需求总额(/30 年 = 月领化)
- childAges, // 子女年龄数组(教育金返还 Y(18-cAge) 起 4 年)
- eduUnit, // 万,单子女单年教育金(eduUnit/4 = 大学每年返还)
- // [v4.5.1] 风险对冲覆盖(一次性赔付保额合计 = 重疾+医疗+定寿+终身寿+意外)
- totalOnetimeCoverage // 万,KPI 卡片大数字
- });
- // === v2.8 · 支付能力健康度 + 行业基准对比 ===
- // [v4.4.6] 已在 renderPremiumTimeline 之前调用(line ~3946),此处不再重复
- // === Phase 3 · 推荐产品(从 products-bundle.js 匹配)===
- renderProductRecommendations({
- age, gender, salary, lifeNeed, isHNW: isHNWFinal,
- domesticNeed, overseasNeed, retireNeed, eduGap
- });
- // [2026-07-12 移植] 更新客户家庭档案卡(替代原保险配置诊断展示位)
- try { v01UpdateFamilyCard(); } catch (e) { console.warn('[v01FamilyCard] render skipped:', e); }
- // [2026-07-12 移植] 更新体检报告 Hero(第5 Tab · 三环/3KPI/4mini 可视化)
- try { v01UpdateHero(); } catch (e) { console.warn('[v01Hero] render skipped:', e); }
- // [2026-07-12 移植自 FAV] 家族保单(第6 Tab) + 生命周期(Tab A) + 水位金字塔(Tab C)
- try { if (window.favUpdateAll) window.favUpdateAll(); } catch (e) { console.warn('[favModule] render skipped:', e); }
- // 显示 + 滚动(静默重算时跳过滚动)
- document.getElementById('result').style.display = 'block';
- if (!window._cySilentRecalc) {
- setTimeout(() => {
- document.getElementById('result').scrollIntoView({ behavior:'smooth', block:'start' });
- }, 50);
- }
- // [v4.4.4] 启用 form 字段实时监听 — 用户改 salary/spouseSalary/资产/cap 等 → 自动节流重算 + 重绘 Canvas
- // 只在首次"计算保额"后绑定一次,避免重复绑定
- if (!window._cyLiveListenerBound) {
- window._cyLiveListenerBound = true;
- let _liveDebounce = null;
- const _liveHandler = function(e) {
- const t = e.target;
- if (!t || (t.tagName !== 'INPUT' && t.tagName !== 'SELECT')) return;
- // 排除非影响计算的元素
- if (t.id === 'portraitSwitcher') return; // 切换画像走 switchPortrait
- if (t.closest && t.closest('#result')) return; // 排除 result 区内部的 input
- // 节流 250ms
- clearTimeout(_liveDebounce);
- _liveDebounce = setTimeout(() => {
- const resultEl = document.getElementById('result');
- if (resultEl && resultEl.style.display !== 'none') {
- // 静默重算 — 不滚动,不弹 toast
- window._cySilentRecalc = true;
- try { calculate(); } finally { window._cySilentRecalc = false; }
- }
- }, 250);
- };
- // 直接绑到 document,覆盖所有 form 元素(form-grid 有多个,绑 body 最稳)
- document.addEventListener('input', _liveHandler);
- document.addEventListener('change', _liveHandler);
- console.log('[v4.4.4] 实时监听已绑定 — 修改 form 字段会自动重算 Canvas + 所有数字');
- }
- }
- // [2026-07-12 移植自「家庭保障体检报告 v0.1」] 客户家庭档案卡渲染器 · 客户身份护照 one-pager
- // 自包含:只读 form 输入字段 + 写自身 v01Fc* 节点,不依赖体检报告的 rings/hero 引擎
- function v01UpdateFamilyCard() {
- const card = document.getElementById('v01FamilyCard');
- if (!card) return;
- function _v(id, def) {
- const el = document.getElementById(id);
- if (!el) return def || '';
- return el.value !== undefined ? el.value : (el.textContent || '').trim();
- }
- function _num(id) { const v = _v(id); return parseFloat(v) || 0; }
- function _fmtWan(wan) {
- if (!wan || wan === 0) return '¥0';
- if (wan >= 10000) return '¥' + (wan / 10000).toFixed(2).replace(/\.?0+$/, '') + '亿';
- return '¥' + (wan >= 100 ? Math.round(wan) : wan.toFixed(1).replace(/\.?0+$/, '')) + '万';
- }
- // ─── 数据收集 ───
- const surname = _v('surname') || '客户';
- const age = _num('age');
- const gender = _v('gender');
- const genderLabel = gender === 'F' ? '女' : gender === 'M' ? '男' : '';
- const marriage = _v('marriage');
- const marriageLabel = marriage === 'married' ? '已婚' : marriage === 'single' ? '未婚' : '';
- const childCount = _num('childCount');
- const childAges = [_num('childAge1'), _num('childAge2'), _num('childAge3')].filter(function(a){return a > 0});
- const eduPath = _v('eduPath');
- const eduLabel = ({
- domestic: '国内路径',
- domestic_plus: '混合(部分海外)',
- elite_us: '精英留学',
- full_overseas: '全程海外'
- })[eduPath] || '';
- const salary = _num('salary');
- const spouseSalary = _num('spouseSalary');
- const totalIncome = salary + spouseSalary;
- const liquid = _num('liquidAssets');
- const house = _num('primaryResidence');
- const invest = _num('investAssets');
- const overseasUSD = _num('overseasAssets');
- const overseasWan = overseasUSD * 7;
- const totalWealth = liquid + house + invest + overseasWan;
- const retireAge = _num('retireAge');
- const yearsToRetire = Math.max(0, retireAge - age);
- const lifeExp = _num('lifeExpectancy');
- const annualSpend = totalIncome * 0.6; // 假设支出 60% 收入
- const monthlySpend = annualSpend / 12;
- // ─── 渲染头部 Title 区 ───
- let titleStr = '';
- if (surname) titleStr += surname;
- if (totalIncome >= 1000 || totalWealth >= 100000) {
- titleStr += '氏 · UHNW 家族';
- } else if (childCount >= 2) {
- titleStr += '氏 · 多子女家庭';
- } else if (childCount === 1) {
- titleStr += '氏 · 三口之家';
- } else if (marriage === 'married') {
- titleStr += '氏 · DINK 家庭';
- } else {
- titleStr += '客户';
- }
- document.getElementById('v01FcTitle').textContent = titleStr;
- const subParts = [];
- if (age > 0) subParts.push(age + ' 岁');
- if (genderLabel) subParts.push(genderLabel);
- if (marriageLabel) subParts.push(marriageLabel);
- if (childCount > 0) {
- let cs = childCount + ' 子';
- if (childAges.length > 0) cs += '(' + childAges.map(function(a){return a+'岁'}).join('/') + ')';
- subParts.push(cs);
- } else if (childCount === 0 && marriage === 'married') {
- subParts.push('无子女');
- }
- if (eduLabel) subParts.push(eduLabel);
- document.getElementById('v01FcSubtitle').textContent = subParts.length ? subParts.join(' · ') : '请选择画像或从计算器跳转';
- // ─── 三柱核心指标 ───
- document.getElementById('v01FcIncome').textContent = _fmtWan(totalIncome);
- document.getElementById('v01FcIncomeSub').textContent = spouseSalary > 0
- ? '主 ' + _fmtWan(salary) + ' + 配偶 ' + _fmtWan(spouseSalary)
- : '主理人 ' + _fmtWan(salary);
- document.getElementById('v01FcWealth').textContent = _fmtWan(totalWealth);
- const wealthPieces = [];
- if (liquid > 0) wealthPieces.push('流动');
- if (house > 0) wealthPieces.push('自住');
- if (invest > 0) wealthPieces.push('投资');
- if (overseasWan > 0) wealthPieces.push('境外');
- document.getElementById('v01FcWealthSub').textContent = wealthPieces.length
- ? wealthPieces.join(' / ') + ' 共 ' + wealthPieces.length + ' 盘'
- : '4 盘合计';
- // ─── [2026-07-12 提案① 对齐 FAV] 已配置保额 · 7 险种现有保单合计(万) ───
- // 自读表单(不依赖后文才定义的 exAcc 等 const · 避免时间死区 ReferenceError · IC 模块调用顺序坑)
- const _exAcc = _num('existingAccident'), _exCI = _num('existingCI'), _exLife = _num('existingLife');
- const _exEdu = _num('existingEduInsurance'), _exRet = _num('existingRetirement'), _exWl = _num('existingWholeLife');
- const _hasMed = _v('existingMed') === '1';
- // 意外/重疾/定寿/教育/养老/终身寿为保额(万);医疗为固定 800 万 cover(勾选即计)
- const insuredWan = _exAcc + _exCI + _exLife + _exEdu + _exRet + _exWl + (_hasMed ? 800 : 0);
- const insuredEl = document.getElementById('v01FcInsured');
- const insuredSubEl = document.getElementById('v01FcInsuredSub');
- if (insuredEl) insuredEl.textContent = insuredWan > 0 ? _fmtWan(insuredWan) : '¥0';
- if (insuredSubEl) {
- const covered = [
- _exAcc>0?'意外':null, _hasMed?'医疗':null, _exCI>0?'重疾':null, _exLife>0?'定寿':null,
- _exEdu>0?'教育':null, _exRet>0?'养老':null, _exWl>0?'终身寿':null
- ].filter(Boolean);
- insuredSubEl.textContent = covered.length ? covered.join('/') + ' 共 ' + covered.length + ' 项' : '尚未配置';
- }
- // ─── [2026-07-12 提案① 对齐 FAV] 保障缺口 · 镜像计算器 totalGapHero(单源·错题#9) ───
- const gapSrc = document.getElementById('totalGapHero');
- const gapEl = document.getElementById('v01FcGap');
- const gapSubEl = document.getElementById('v01FcGapSub');
- if (gapEl) gapEl.textContent = (gapSrc && gapSrc.textContent.trim() && gapSrc.textContent.indexOf('-') !== 0)
- ? gapSrc.textContent.trim() : '¥ —';
- if (gapSubEl) {
- // 缺口占需求比(需求 = 已配 + 缺口 的粗口径提示)
- const gapNum = gapSrc ? parseFloat(gapSrc.textContent.replace(/[^0-9.]/g,'')) || 0 : 0;
- gapSubEl.textContent = gapNum > 0 ? '7 险种 · 需补足' : (insuredWan > 0 ? '已基本配齐' : '需求 − 现有');
- }
- document.getElementById('v01FcRetire').textContent = retireAge > 0
- ? retireAge + ' 岁(还 ' + yearsToRetire + ' 年)'
- : '—';
- document.getElementById('v01FcRetireSub').textContent = monthlySpend > 0
- ? '月支出 ¥' + (monthlySpend >= 10 ? Math.round(monthlySpend) : monthlySpend.toFixed(1)) + '万 · ' + (lifeExp || 95) + ' 岁寿期'
- : '寿期 ' + (lifeExp || 95) + ' 岁';
- // ─── 资产 4 盘 chip 行 ───
- const assetChips = [];
- if (liquid > 0) assetChips.push({icon:'💧', label:'流动资产', val:_fmtWan(liquid)});
- if (house > 0) assetChips.push({icon:'🏠', label:'自住房产', val:_fmtWan(house)});
- if (invest > 0) assetChips.push({icon:'🏛', label:'其他投资', val:_fmtWan(invest)});
- if (overseasWan > 0) assetChips.push({icon:'🌏', label:'境外资产', val:_fmtWan(overseasWan)});
- document.getElementById('v01FcAssets').innerHTML = assetChips.map(function(c){
- return '<div class="v01-fc-asset-chip">' +
- '<span class="v01-fc-asset-chip-icon">' + c.icon + '</span>' +
- '<span>' + c.label + '</span>' +
- '<span class="v01-fc-asset-chip-val">' + c.val + '</span>' +
- '</div>';
- }).join('');
- // ─── 7 险种保单网格 ───
- const exAcc = _num('existingAccident');
- const hasMed = _v('existingMed') === '1';
- const exCI = _num('existingCI');
- const exLife= _num('existingLife');
- const exEdu = _num('existingEduInsurance');
- const exRet = _num('existingRetirement');
- const exWl = _num('existingWholeLife');
- const policies = [
- {icon:'⚡', name:'意外险', val: exAcc > 0 ? _fmtWan(exAcc) : '未配置', has: exAcc > 0},
- {icon:'🏥', name:'医疗险', val: hasMed ? '✓ ¥800万' : '未配置', has: hasMed},
- {icon:'🩺', name:'重疾险', val: exCI > 0 ? _fmtWan(exCI) : '未配置', has: exCI > 0},
- {icon:'🛡', name:'定期寿险', val: exLife > 0 ? _fmtWan(exLife) : '未配置', has: exLife > 0},
- {icon:'🎓', name:'教育金', val: exEdu > 0 ? _fmtWan(exEdu) : '未配置', has: exEdu > 0},
- {icon:'💰', name:'养老金', val: exRet > 0 ? _fmtWan(exRet) : '未配置', has: exRet > 0},
- {icon:'💎', name:'终身寿险', val: exWl > 0 ? _fmtWan(exWl) : '未配置', has: exWl > 0}
- ];
- document.getElementById('v01FcPolicies').innerHTML = policies.map(function(p){
- const cls = p.has ? 'v01-fc-policy is-covered' : 'v01-fc-policy is-empty';
- return '<div class="' + cls + '">' +
- '<div class="v01-fc-policy-icon">' + p.icon + '</div>' +
- '<div class="v01-fc-policy-name">' + p.name + '</div>' +
- '<div class="v01-fc-policy-val">' + p.val + '</div>' +
- '</div>';
- }).join('');
- // ─── CFPI 保障完整度金环仪表盘 ───
- // [2026-07-12] 得分已由 renderClientSummary() 先算好写入 csMetricScore/csMetricScoreLabel
- // (调用顺序:calculate() 内 renderClientSummary 在 v01UpdateFamilyCard 之前),此处读取渲染
- (function renderCfpiGauge() {
- const scoreEl = document.getElementById('csMetricScore');
- const labelEl = document.getElementById('csMetricScoreLabel');
- const numEl = document.getElementById('v01CfpiNum');
- const ringEl = document.getElementById('v01CfpiRingFill');
- const badgeEl = document.getElementById('v01CfpiBadge');
- const descEl = document.getElementById('v01CfpiDesc');
- if (!numEl || !ringEl || !badgeEl) return;
- // 从已渲染节点解析 0-10 得分(csMetricScore innerHTML 形如 "7.8 <span>/ 10</span>")
- let score = 0;
- if (scoreEl) {
- const m = (scoreEl.textContent || '').match(/[\d.]+/);
- if (m) score = parseFloat(m[0]) || 0;
- }
- const scoreLabel = labelEl ? (labelEl.textContent || '').trim() : '';
- // 数字 + 环填充(周长 2π×44 ≈ 276.46)
- numEl.textContent = score.toFixed(1);
- const CIRC = 276.46;
- ringEl.setAttribute('stroke-dasharray', CIRC.toFixed(1));
- ringEl.setAttribute('stroke-dashoffset', (CIRC * (1 - Math.min(1, score / 10))).toFixed(1));
- // 徽章文案 + 配色档(优秀/良好=绿 · 及格/待补齐=琥珀 · 待启动=红)
- badgeEl.textContent = scoreLabel || '— 待评';
- badgeEl.classList.remove('is-warn', 'is-bad');
- if (score < 4.0) badgeEl.classList.add('is-bad');
- else if (score < 7.0) badgeEl.classList.add('is-warn');
- // 一句话描述(复用最大缺口险种,若已配齐则鼓励)
- if (descEl) {
- const maxGapEl = document.getElementById('csMetricMaxGap');
- const maxGapName = maxGapEl ? (maxGapEl.textContent || '').trim() : '';
- if (maxGapName && maxGapName !== '已配齐' && maxGapName !== '—') {
- descEl.textContent = '最大风险敞口:' + maxGapName;
- } else if (score > 0) {
- descEl.textContent = '7 险种基本配齐 · 定期复盘即可';
- }
- }
- })();
- // 显示卡片(默认 display:none · 只有数据填充后才显示)
- if (totalIncome > 0 || totalWealth > 0 || age > 0) {
- card.style.display = 'block';
- }
- }
- function setBars(prefix, existing, gap, total) {
- if (!total) total = 1;
- const eP = Math.min(100, (existing / total) * 100);
- const gP = Math.min(100 - eP, (gap / total) * 100);
- document.getElementById(prefix + 'BarExist').style.width = eP + '%';
- document.getElementById(prefix + 'BarGap').style.width = gP + '%';
- }
- /* === 缺口状态图标渲染(v2026-06-13) ===
- 逻辑:
- - 总额 ≤ 0(无需求):自动 covered ✓
- - 缺口 = 0(已配齐):covered ✓
- - 缺口 ≤ 30% 总额(部分缺口):gap-partial ⚠
- - 缺口 > 30% 总额(大缺口):gap-large ❗ + 脉冲动画
- */
- function renderPolicyStatus(prefix, existing, gap, total) {
- const el = document.getElementById(prefix + 'Status');
- if (!el) return;
- let status, label, title;
- if (!total || total <= 0) {
- status = 'na'; label = '— 不需要'; title = '该成员当前无配置需求';
- } else if (gap <= 0 || existing >= total * 0.95) {
- status = 'covered'; label = '✓ 已配齐'; title = '配置充足(覆盖率 ≥ 95%)';
- } else if (existing >= total * 0.5) {
- const pct = Math.round((1 - existing / total) * 100);
- status = 'gap-partial'; label = '⚡ 缺 ' + pct + '%'; title = '部分缺口 · 建议补足';
- } else {
- const pct = Math.round((1 - existing / total) * 100);
- status = 'gap-large'; label = '⚠ 缺 ' + pct + '%'; title = '大缺口 · 优先配置';
- }
- el.className = 'pc-status ' + status;
- el.textContent = label;
- el.title = title;
- // P3.1 · 100% 覆盖卡片默认折叠 + 点击切换展开
- // [v4.8 · 2026-06-26 修正] 改为"所有 7 张卡片默认折叠",而非仅 covered 卡片
- // 客户点击 card → 展开;再次点击 → 折叠;userExpanded 标记防止重渲染重置
- const card = el.closest('.policy-card');
- if (card) {
- // 默认全部折叠(除非用户已手动展开)
- if (card.dataset.userExpanded !== '1') {
- card.classList.add('is-collapsed');
- }
- // 一次性绑定 click 切换(每张卡片只绑一次)
- if (!card.dataset.toggleBound) {
- card.dataset.toggleBound = '1';
- card.addEventListener('click', (ev) => {
- // 排除内部 Tab / 按钮 / 链接 等可交互元素的冒泡触发
- if (ev.target.closest('.life-track-tab,.cell-gap-cta,.hnw-toggle,.hnw-detail-body,a,button,input,select,textarea')) return;
- const wasCollapsed = card.classList.contains('is-collapsed');
- card.classList.toggle('is-collapsed');
- // 用户主动展开 → 标记,避免下次重渲染又被折叠
- card.dataset.userExpanded = wasCollapsed ? '1' : '';
- });
- }
- }
- }
- /* === v2026-06-13 v1.4 · P2.1 · 年缴保费 donut 圆环图 === */
- function renderPremiumDonut(p) {
- const card = document.getElementById('premiumAllocCard');
- if (!card) return;
- // [v4.8 · 2026-06-26] show/hide 由 wrap(全宽白带容器)接管,避免空白带
- const wrap = document.getElementById('premiumAllocWrap') || card;
- const total = p.total || 0;
- if (total <= 0) { wrap.style.display = 'none'; return; }
- wrap.style.display = 'block';
- card.style.display = 'grid';
- // 7 险种 + 颜色映射(对齐金字塔 5 色调色板:基础红 / 中端金&橙&绿 / 高端紫)
- const items = [
- { key: 'acc', name: '⚡ 意外险', val: p.acc || 0, tier: 'base', color: '#D54E42' },
- { key: 'med', name: '🏥 医疗险', val: p.med || 0, tier: 'base', color: '#E07A3B' },
- { key: 'ci', name: '⚕ 重疾险', val: p.ci || 0, tier: 'base', color: '#A6121C' },
- { key: 'retire', name: '💰 养老年金', val: p.retire || 0, tier: 'mid', color: '#4FA672' },
- { key: 'edu', name: '🎓 教育年金', val: p.edu || 0, tier: 'mid', color: '#E5BB3D' },
- { key: 'life', name: '🛡 定期寿险', val: p.life || 0, tier: 'mid', color: '#E48A35' },
- { key: 'wl', name: '💎 终身寿险', val: p.wl || 0, tier: 'high', color: '#7A3FA0' }
- ];
- // 中心数字
- document.getElementById('paCenterNum').textContent = '¥' + (total / 10000).toFixed(1) + '万';
- document.getElementById('paCenterSub').textContent = '7 险种合计 · 年缴';
- // SVG donut(viewBox 220x220, 圆心 110, 外径 90, 内径 60)
- const svg = document.getElementById('premiumDonutSvg');
- const cx = 110, cy = 110, R = 90, r = 60;
- let startAngle = -Math.PI / 2; // 从 12 点钟方向起
- const slices = items.map(it => {
- if (it.val <= 0) return null;
- const frac = it.val / total;
- const endAngle = startAngle + frac * Math.PI * 2;
- // donut 切片:外圆弧(R) + 内圆弧(r 反向)
- const x1o = cx + R * Math.cos(startAngle), y1o = cy + R * Math.sin(startAngle);
- const x2o = cx + R * Math.cos(endAngle), y2o = cy + R * Math.sin(endAngle);
- const x1i = cx + r * Math.cos(endAngle), y1i = cy + r * Math.sin(endAngle);
- const x2i = cx + r * Math.cos(startAngle), y2i = cy + r * Math.sin(startAngle);
- const largeArc = frac > 0.5 ? 1 : 0;
- const path = `M ${x1o} ${y1o} A ${R} ${R} 0 ${largeArc} 1 ${x2o} ${y2o} L ${x1i} ${y1i} A ${r} ${r} 0 ${largeArc} 0 ${x2i} ${y2i} Z`;
- const pct = Math.round(frac * 100);
- const result = { path, color: it.color, pct, ...it };
- startAngle = endAngle;
- return result;
- }).filter(Boolean);
- svg.innerHTML = `
- <defs>
- <filter id="paShadow" x="-10%" y="-10%" width="120%" height="120%">
- <feGaussianBlur in="SourceAlpha" stdDeviation="2"/>
- <feOffset dx="0" dy="2"/>
- <feComponentTransfer><feFuncA type="linear" slope="0.18"/></feComponentTransfer>
- <feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge>
- </filter>
- </defs>
- <g filter="url(#paShadow)">
- ${slices.map(s => `<path d="${s.path}" fill="${s.color}" stroke="#fff" stroke-width="1.5"/>`).join('')}
- </g>
- `;
- // 三层 tier 占比
- const tierSum = { base: 0, mid: 0, high: 0 };
- items.forEach(it => { tierSum[it.tier] += it.val; });
- const tierPills = [
- { id: 'base', emoji: '🟧', name: '基础', val: tierSum.base },
- { id: 'mid', emoji: '🟨', name: '中端', val: tierSum.mid },
- { id: 'high', emoji: '🟡', name: '高端', val: tierSum.high }
- ];
- document.getElementById('paTierSummary').innerHTML = tierPills.map(t => {
- const pct = Math.round((t.val / total) * 100);
- return `<span class="pa-tier-pill ptp-${t.id}">
- <span class="ptp-emoji">${t.emoji}</span>
- <span>${t.name}</span>
- <span class="ptp-pct">${pct}%</span>
- </span>`;
- }).join('');
- // 7 险种图例(按金额降序)
- const legendItems = items.slice().sort((a, b) => b.val - a.val);
- document.getElementById('paLegend').innerHTML = legendItems.map(it => {
- const pct = Math.round((it.val / total) * 100);
- return `<div class="pa-legend-item">
- <span class="pa-legend-dot" style="background:${it.color}"></span>
- <span class="pa-legend-name">${it.name}</span>
- <span class="pa-legend-pct">${pct}%</span>
- </div>`;
- }).join('');
- }
- /* === 配置优先级渲染(v3.0 · 7 险种 · v1.1 去掉护理险/满期金)·按金字塔层 + 缺口规模排序 === */
- function renderPriorityTimeline(d) {
- const list = document.getElementById('priorityList');
- if (!list) return;
- // v3.0 · 7 险种数据汇总(标 tier · 基础层优先 P0,中端 P1,高端 P2)
- const policies = [
- // 🟧 基础风险层(进/防 · 没钱)
- {
- key: 'acc', icon: '⚡', name: '意外险', tier: 'base',
- gap: d.accGap, total: d.accNeed,
- action: '<strong>百万意外险</strong> · 高保额低保费(年支出 × 5)· 综合意外身故/伤残 · 1500-3000 元/年 · 30 天内激活'
- },
- {
- key: 'med', icon: '🏥', name: '医疗险', tier: 'base',
- gap: d.medGap, total: d.medNeed,
- action: '<strong>国际医疗险</strong> · 覆盖境内顶级私立 + 海外医疗 · 800 万保额年缴 ¥1.8-3.5 万 · 30 天内激活'
- },
- {
- key: 'ci', icon: '⚕', name: '重疾险', tier: 'base',
- gap: d.ciGap, total: d.ciNeed,
- action: '<strong>5 年康复期收入替代</strong> · 终身重疾险 ¥' + Math.round(d.ciNeed || 0) + '万(年龄锁定 30 年缴期)· 黄金窗口期(年龄 < 45)· 90 天内完成核保'
- },
- // 🟨 中端风险层(出/增 · 花钱)
- {
- key: 'life', icon: '🛡', name: '定期寿险', tier: 'mid',
- gap: d.lifeGap, total: d.lifeNeed,
- action: d.isHNW
- ? '<strong>HNW 双轨配置</strong> · 境内增额终身寿 ¥3-5 亿(64 岁前为最后投保窗口)+ 境外 PPLI ¥XX 亿装入股权(持牌跨境通道)· 90 天内启动'
- : '<strong>定期寿险</strong> · ¥' + Math.round(d.lifeNeed || 0) + '万(主理人收入替代 · 30 年缴期)· 受益人单一指定 · 6 个月内完成投保'
- },
- {
- key: 'edu', icon: '🎓', name: '教育年金', tier: 'mid',
- gap: d.eduGap, total: d.eduNeed,
- action: '<strong>美元教育金分红险</strong> · 香港分红型(5/15/25/35 阶梯领取)· 子女 < 10 岁是最佳起点 · 12 月内启动'
- },
- {
- key: 'retire', icon: '🌅', name: '养老年金', tier: 'mid',
- gap: d.retireGap, total: d.retireNeed,
- action: '<strong>美元增额年金险</strong> · 香港分红型养老 · 退休前 5-10 年是黄金缴费期 · 通胀对冲 + 终身现金流 · 12-24 月内启动'
- },
- // 🟡 高端风险层(保/传 · 留钱)
- {
- key: 'wl', icon: '💎', name: '终身寿险', tier: 'high',
- gap: d.wlGap, total: d.wlNeed,
- action: '<strong>增额终身寿 / PPLI / IUL / VUL</strong> · 总资产 × 30% 传承隔离 · 装入家族信托 · 跨代受益 · 24-36 月内规划'
- }
- ];
- // 按 tier 优先级 + 缺口规模排序
- const tierWeight = { base: 0, mid: 1, high: 2 };
- const sorted = policies.sort((a, b) => {
- if (a.gap <= 0 && b.gap > 0) return 1;
- if (b.gap <= 0 && a.gap > 0) return -1;
- if (a.gap > 0 && b.gap > 0) {
- // 都有缺口:基础层 > 中端层 > 高端层
- if (tierWeight[a.tier] !== tierWeight[b.tier]) return tierWeight[a.tier] - tierWeight[b.tier];
- return b.gap - a.gap;
- }
- return 0;
- });
- // 自动分档:P0(缺口最大 1-2 项) / P1(中等 2 项) / P2(小缺口) / 已完成
- function fmtAmount(wan) {
- if (wan <= 0) return '已配齐';
- if (wan >= 10000) return '¥' + parseFloat((wan/10000).toFixed(2)) + '亿';
- return '¥' + Math.round(wan) + '万';
- }
- const totalGap = sorted.reduce((s, p) => s + Math.max(0, p.gap), 0);
- let cumulative = 0;
- let rank = 1;
- list.innerHTML = sorted.map((p) => {
- let tier, tierLabel;
- if (p.gap <= 0) {
- tier = 'done'; tierLabel = '已完成';
- } else {
- // 取缺口前 50% 总缺口的 = P0,前 80% 的 = P1,其余 = P2
- cumulative += p.gap;
- const ratio = cumulative / totalGap;
- if (rank <= 2 && ratio <= 0.7) tier = 'p0';
- else if (ratio <= 0.95) tier = 'p1';
- else tier = 'p2';
- }
- const rankDisplay = p.gap <= 0 ? '✓' : rank;
- if (p.gap > 0) rank++;
- const tierLabelMap = { p0: 'P0 紧急', p1: 'P1 重要', p2: 'P2 常规', done: '已完成' };
- const action = p.gap <= 0
- ? '<strong>已配齐</strong> · 建议每年保单复盘 1 次 · 跟家庭资产再平衡同步'
- : p.action;
- const amountClass = p.gap <= 0 ? 'pi-amount done' : 'pi-amount';
- return `<div class="priority-item ${tier}">
- <div class="pi-rank ${tier}">
- <span class="pi-rank-num">${rankDisplay}</span>
- ${tierLabelMap[tier]}
- </div>
- <div class="pi-icon-wrap">${p.icon}</div>
- <div class="pi-content">
- <div class="pi-name">${p.name}缺口 <span class="${amountClass}">${fmtAmount(p.gap)}</span></div>
- <div class="pi-action">${action}</div>
- </div>
- </div>`;
- }).join('');
- }
- /* === HNW 寿险卡境内/境外 Tab 切换 === */
- function switchLifeTrack(track, el) {
- document.querySelectorAll('.life-track-tab').forEach(t => t.classList.remove('active'));
- document.querySelectorAll('.life-track-pane').forEach(p => p.classList.remove('active'));
- if (el) el.classList.add('active');
- document.getElementById(track === 'domestic' ? 'lifeTrackDomestic' : 'lifeTrackOverseas').classList.add('active');
- }
- /* === v3.1 · 终身寿险卡境内/境外双轨详情折叠开关 === */
- function toggleHnwTabs(headerEl) {
- // event 冒泡阻止 — 避免触发外层 P3.1 卡片折叠
- if (window.event) window.event.stopPropagation();
- const wrap = document.getElementById('hnwTabsWrap');
- if (!wrap) return;
- const collapsed = wrap.getAttribute('data-collapsed') === '1';
- const arrow = headerEl ? headerEl.querySelector('.hnw-toggle-arrow') : null;
- const hint = headerEl ? headerEl.querySelector('.hnw-toggle-hint') : null;
- const body = wrap.querySelector('.hnw-detail-body');
- if (collapsed) {
- wrap.setAttribute('data-collapsed', '0');
- if (body) body.style.display = 'block';
- if (arrow) arrow.style.transform = 'rotate(90deg)';
- if (hint) hint.textContent = '点击收起';
- } else {
- wrap.setAttribute('data-collapsed', '1');
- if (body) body.style.display = 'none';
- if (arrow) arrow.style.transform = 'rotate(0deg)';
- if (hint) hint.textContent = '点击展开';
- }
- }
- /* === v3.2 · 金字塔体检卡渲染(7 险种水位动画驱动)=== */
- function renderCalcPyramidCheck(d) {
- // v3.2 · 接受 7 险种 each {need, existing}, 派生 7 险种 coverage + 三层平均
- const cov = (n, e) => n > 0 ? Math.min(1, (e || 0) / n) : 0;
- const c = {
- acc: cov(d.acc.need, d.acc.existing),
- med: cov(d.med.need, d.med.existing),
- ci: cov(d.ci.need, d.ci.existing),
- life: cov(d.life.need, d.life.existing),
- edu: cov(d.edu.need, d.edu.existing),
- retire: cov(d.retire.need, d.retire.existing),
- wl: cov(d.wl.need, d.wl.existing)
- };
- // 派生三层平均覆盖率(用于诊断阈值 + score · 加权聚合各层险种)
- const sumNeed = (...arr) => arr.reduce((s,x) => s + (x.need || 0), 0);
- const sumExist = (...arr) => arr.reduce((s,x) => s + (x.existing || 0), 0);
- const baseNeed = sumNeed(d.acc, d.med, d.ci);
- const baseExist = sumExist(d.acc, d.med, d.ci);
- const midNeed = sumNeed(d.life, d.edu, d.retire);
- const midExist = sumExist(d.life, d.edu, d.retire);
- const highNeed = sumNeed(d.wl);
- const highExist = sumExist(d.wl);
- const baseCov = baseNeed > 0 ? Math.min(1, baseExist / baseNeed) : 0;
- const midCov = midNeed > 0 ? Math.min(1, midExist / midNeed) : 0;
- const highCov = highNeed > 0 ? Math.min(1, highExist / highNeed) : 0;
- // v1.4 · 同步三层 banner 进度条(P1.2 · 与右侧 tier-rows 数据同源)
- ['base', 'mid', 'high'].forEach(tier => {
- const layerCov = tier === 'base' ? baseCov : tier === 'mid' ? midCov : highCov;
- const pct = Math.round(layerCov * 100);
- const cap = tier.charAt(0).toUpperCase() + tier.slice(1);
- const fillEl = document.getElementById('tb' + cap + 'Fill');
- const pctEl = document.getElementById('tb' + cap + 'Pct');
- const iconEl = document.getElementById('tb' + cap + 'Icon');
- if (fillEl) fillEl.style.width = pct + '%';
- if (pctEl) pctEl.textContent = pct + '%';
- if (iconEl) {
- const icon = pct >= 60 ? '✓' : pct >= 30 ? '⚡' : '⚠';
- const color = pct >= 60 ? '#2D6A4F' : pct >= 30 ? '#8B6F1A' : '#A6121C';
- iconEl.textContent = icon;
- iconEl.style.color = color;
- }
- });
- // 倒金字塔四档诊断(与 cy-policy-meta.js 阈值一致)
- let level, color, bg, icon, message, diagnosis;
- if (baseCov < 0.10 && highCov > 0.80) {
- level='severe'; color='#8B0000'; bg='#FBE3E3'; icon='🚨';
- message='严重倒金字塔'; diagnosis='底层完全空虚 + 顶层重金投入 · 极不平衡 · 建议立即补充基础层';
- } else if (baseCov < 0.30 && highCov > 0.50) {
- level='warning'; color='#D32F2F'; bg='#FCE4E4'; icon='⚠️';
- message='倒金字塔风险'; diagnosis='底层薄弱 + 顶层偏重 · 结构倒置 · 建议先夯实基础';
- } else if (baseCov < 0.50) {
- level='caution'; color='#F9A825'; bg='#FFF8E1'; icon='⚡';
- message='底层偏弱'; diagnosis='基础层未达健康线(50%)· 建议优先补充意外/医疗/重疾';
- } else if (baseCov >= 0.60 && midCov >= 0.30) {
- level='healthy'; color='#2E7D32'; bg='#E8F5E9'; icon='✅';
- message='结构合理'; diagnosis='金字塔结构合理 · 各层覆盖均衡';
- } else {
- level='neutral'; color='#9E9E9E'; bg='#F5F5F5'; icon='○';
- message='中性'; diagnosis='覆盖度数据已收集 · 等待诊断';
- }
- // v3.2 · SVG 三角形渲染(传 7 险种 coverage 驱动水位动画)
- renderCalcPyramidSvg(c);
- // 标题徽章
- const badge = document.getElementById('pccLabelBadge');
- badge.textContent = icon + ' ' + message;
- badge.style.background = bg;
- badge.style.color = color;
- badge.style.border = '1px solid ' + color;
- // 三层覆盖率行(v2.1 倒序:high → mid → base · 与左侧金字塔层级对齐)
- // [2026-07-16] 上方金字塔右侧改用下方 FAV 同款 rtier-group 胶囊卡风格(彩色边框块 + 药丸标签 + 内嵌 gap 明细常显)
- const RTIER_CAP = {
- high: { short:'高端', desc:'传承 · 终身寿', cov:highCov, c:'#7A3FA0', bg:'rgba(122,63,160,.09)', bd:'rgba(122,63,160,.35)' },
- mid: { short:'中端', desc:'保钱 · 定寿/教育/养老', cov:midCov, c:'#C48A1E', bg:'rgba(196,138,30,.10)', bd:'rgba(196,138,30,.38)' },
- base: { short:'基础', desc:'保命 · 意外/医疗/重疾', cov:baseCov, c:'#D54E42', bg:'rgba(213,78,66,.08)', bd:'rgba(213,78,66,.35)' }
- };
- document.getElementById('pccTierRows').innerHTML = ['high','mid','base'].map(rt => {
- const t = RTIER_CAP[rt];
- const pct = Math.round((t.cov || 0) * 100);
- const inner = (window.favTierDetailHTML ? window.favTierDetailHTML(rt) : '');
- // [2026-07-16] 头部常显该层覆盖率进度条;点击展开各险种明细(.rtier-body 默认折叠)
- return `<div class="rtier-group" style="--rt-c:${t.c};--rt-bg:${t.bg};--rt-bd:${t.bd}"><div class="rtier-cap" onclick="toggleRtierGroup(this)"><span class="rtier-name">${t.short}</span><span class="rtier-desc">${t.desc}</span><span class="rtier-cov"><span class="rtier-cov-bar"><span class="rtier-cov-fill" style="width:0%" data-w="${pct}"></span></span><span class="rtier-cov-pct">${pct}%</span></span><span class="rtier-caret">▸</span></div><div class="rtier-body">${inner}</div></div>`;
- }).join('');
- // 头部覆盖率进度条涨条动画(明细内的 gap-fill 在展开时才动画)
- requestAnimationFrame(() => setTimeout(() => {
- document.querySelectorAll('#pccTierRows .rtier-cov-fill').forEach(el => { el.style.width = el.dataset.w + '%'; });
- }, 60));
- // 诊断框
- const diagBox = document.getElementById('pccDiagnosis');
- diagBox.style.background = bg;
- diagBox.style.borderLeftColor = color;
- diagBox.style.color = color;
- document.getElementById('pccDiagMsg').textContent = icon + ' ' + message;
- document.getElementById('pccDiagText').textContent = diagnosis;
- document.getElementById('pccDiagText').style.color = 'var(--text)';
- // 评分(0-10 加权 · 高若楠 6-24 反馈重构 · 60 分基线 + 加分项)
- // [v4.8 · 2026-06-26] 旧算法:加权平均 × 10 → 客户买了 50 万重疾被评 0.4 / 10,打击客户
- // 新算法:hasAnyExisting → 6.0 起评(对齐"已买保险都 60+"业务直觉)
- // + 各层覆盖率 bonus(基础 1.5 / 中端 1.0 / 高端 0.8)
- // + 险种均衡度 bonus(配齐 > 3 险种,每多 1 项加 0.1)
- const hasAnyExisting = (baseCov + midCov + highCov) > 0;
- const baseline = hasAnyExisting ? 6.0 : 2.0;
- const baseBonus = baseCov * 1.5;
- const midBonus = midCov * 1.0;
- const highBonus = highCov * 0.8;
- // 险种均衡度:统计已配置险种数(existing > 0)
- const existingPolicyCount = [d.acc, d.med, d.ci, d.life, d.edu, d.retire, d.wl]
- .filter(p => p && p.existing > 0).length;
- const balancedBonus = Math.max(0, Math.min(0.4, (existingPolicyCount - 3) * 0.1));
- const rawScore = baseline + baseBonus + midBonus + highBonus + balancedBonus;
- const score = Math.min(10, Math.round(rawScore * 10) / 10);
- document.getElementById('pccScoreNum').innerHTML = score + '<span class="pcc-ss-suffix">/ 10</span>';
- }
- /* === v3.2.1 · 金字塔工具开关持久化 + 缓存最近数据 === */
- let _lastCalcCoverages = null;
- // [2026-07-16] 上方金字塔 rtier-group 胶囊卡:点击头部折叠/展开该层险种明细(默认隐藏)
- function toggleRtierGroup(capEl) {
- const group = capEl.closest('.rtier-group');
- if (!group) return;
- const open = group.classList.toggle('is-open');
- if (open) {
- // 展开后触发缺口条涨条动画
- requestAnimationFrame(() => setTimeout(() => {
- group.querySelectorAll('.gap-fill').forEach(el => { el.style.width = el.dataset.w + '%'; });
- }, 40));
- }
- }
- // [2026-07-12] 金字塔三层行点击展开:懒加载该层各险种明细缺口条(调 fav 模块 favTierDetailHTML)
- function togglePccTierDetail(rtier, rowEl) {
- const detail = document.getElementById('pccTierDetail-' + rtier);
- if (!detail) return;
- const open = detail.classList.contains('is-open');
- if (open) {
- detail.classList.remove('is-open');
- rowEl.classList.remove('is-expanded');
- return;
- }
- // 懒加载明细(每次展开都重新取,保证跟随最新计算)
- if (window.favTierDetailHTML) {
- try { detail.innerHTML = window.favTierDetailHTML(rtier); }
- catch (e) { detail.innerHTML = '<div class="fav-note">明细加载失败</div>'; }
- } else {
- detail.innerHTML = '<div class="fav-note">明细模块未就绪,请重新计算</div>';
- }
- detail.classList.add('is-open');
- rowEl.classList.add('is-expanded');
- // 展开后触发缺口条动画
- requestAnimationFrame(() => setTimeout(() => {
- detail.querySelectorAll('.gap-fill').forEach(el => { el.style.width = el.dataset.w + '%'; });
- }, 40));
- }
- function _calcPyramidPref(key, def) {
- const v = localStorage.getItem('cy_calc_pyramid_' + key);
- if (v === null) return def;
- return v === '1';
- }
- function initCalcPyramidToggles() {
- const root = document.querySelector('.pyramid-controls[data-card="cy_calc"]');
- if (!root) return;
- // v3.3.2 · 简化 label · 仅保留 emoji + 状态(节省横向空间)
- const LBL = {
- anim: { on: '💧 实际', off: '💧 满覆盖' },
- stereo: { on: '🎨 3D', off: '🎨 平面' }
- };
- const setLabel = (btn, key, on) => {
- const el = btn.querySelector('.tg-label');
- if (el && LBL[key]) el.textContent = on ? LBL[key].on : LBL[key].off;
- };
- root.querySelectorAll('.pc-toggle').forEach(btn => {
- const key = btn.getAttribute('data-key');
- const on = _calcPyramidPref(key, true);
- btn.setAttribute('data-on', on ? '1' : '0');
- setLabel(btn, key, on);
- if (btn.dataset.bound) return;
- btn.dataset.bound = '1';
- btn.addEventListener('click', () => {
- const newOn = btn.getAttribute('data-on') === '1' ? '0' : '1';
- btn.setAttribute('data-on', newOn);
- setLabel(btn, key, newOn === '1');
- localStorage.setItem('cy_calc_pyramid_' + key, newOn);
- // v3.3.1 · 立刻重渲染 · 即使 _lastCalcCoverages 为空也用默认值演示一遍
- const cov = _lastCalcCoverages || { wl:0.55, retire:0.40, edu:0.35, life:0.65, acc:0.85, med:0.75, ci:0.55 };
- renderCalcPyramidSvg(cov);
- });
- });
- }
- function renderCalcPyramidSvg(coverages) {
- const svg = document.getElementById('calcPyramidSvg');
- if (!svg) return;
- _lastCalcCoverages = coverages;
- // v3.3 · 读取用户偏好(动画 / 立体感)
- const animOn = _calcPyramidPref('anim', true);
- const stereoOn = _calcPyramidPref('stereo', true);
- // 确保 toggle 状态条已绑定
- initCalcPyramidToggles();
- // viewBox 480×450 · 顶部标题 y=10-60 · 金字塔 y=70-420
- svg.setAttribute('viewBox', '0 0 480 450');
- const cl = (v) => Math.min(1, Math.max(0, v || 0));
- // ═══════════════════════════════════════════════════════════════
- // v3.3.2 · 单套居中几何 · 立体感通过装饰层(金色 rim + 阴影线 + 烟雾粒子) 营造
- // apex (240,70), 主面底 40-440 等腰三角形居中
- // 立体 ON: 在层间绘制金色高光线 + 阴影线模拟"大理石阶梯"厚度感 + 烟雾氛围
- // ═══════════════════════════════════════════════════════════════
- let sideSegments = []; // v3.3.2 · 不再使用侧面
- let edgePts = []; // v3.3.2 · 不再使用棱线
- let segments = [
- { key:'wl', label:'终身寿险', cov:cl(coverages.wl),
- yT:70, yB:205, polygon:'240,70 317,205 163,205',
- grad:'L1G', labelX:240, labelY:178, pctY:196, cx:240, cy:160 },
- { key:'retire', label:'养老年金', cov:cl(coverages.retire),
- yT:205, yB:260, polygon:'163,205 317,205 349,260 131,260',
- grad:'L2G', labelX:240, labelY:228, pctY:248, cx:240, cy:232 },
- { key:'edu', label:'教育年金', cov:cl(coverages.edu),
- yT:260, yB:315, polygon:'131,260 349,260 380,315 100,315',
- grad:'L3G', labelX:240, labelY:283, pctY:303, cx:240, cy:287 },
- { key:'life', label:'定期寿险', cov:cl(coverages.life),
- yT:315, yB:370, polygon:'100,315 380,315 411,370 69,370',
- grad:'L4G', labelX:240, labelY:338, pctY:358, cx:240, cy:342 },
- { key:'acc', label:'意外险', cov:cl(coverages.acc),
- yT:370, yB:420, polygon:'69,370 183,370 173,420 40,420',
- grad:'L5G', labelX:116, labelY:392, pctY:411, cx:116, cy:395 },
- { key:'med', label:'医疗险', cov:cl(coverages.med),
- yT:370, yB:420, polygon:'183,370 297,370 307,420 173,420',
- grad:'L5G', labelX:240, labelY:392, pctY:411, cx:240, cy:395 },
- { key:'ci', label:'重疾险', cov:cl(coverages.ci),
- yT:370, yB:420, polygon:'297,370 411,370 440,420 307,420',
- grad:'L5G', labelX:364, labelY:392, pctY:411, cx:364, cy:395 }
- ];
- const grads = [
- { id:'L1G', light:'#9B61C2', main:'#7A3FA0', dark:'#4A1F70' },
- { id:'L2G', light:'#6FC192', main:'#4FA672', dark:'#2D7044' },
- { id:'L3G', light:'#F2D366', main:'#E5BB3D', dark:'#B58A21' },
- { id:'L4G', light:'#F0A55B', main:'#E48A35', dark:'#B26420' },
- { id:'L5G', light:'#E5746A', main:'#D54E42', dark:'#962C24' }
- ];
- // ════════ defs ════════
- let defs = '';
- grads.forEach(g => {
- // 主面渐变(亮 · 顶光打亮)
- defs += `<linearGradient id="${g.id}" x1="0" y1="0" x2="0" y2="1">
- <stop offset="0%" stop-color="${g.light}"/>
- <stop offset="6%" stop-color="${g.main}"/>
- <stop offset="100%" stop-color="${g.dark}"/>
- </linearGradient>`;
- // 主面背景(超淡 · 空容器底)
- defs += `<linearGradient id="${g.id}_bg" x1="0" y1="0" x2="0" y2="1">
- <stop offset="0%" stop-color="${g.main}" stop-opacity="0.10"/>
- <stop offset="100%" stop-color="${g.dark}" stop-opacity="0.20"/>
- </linearGradient>`;
- // 侧面渐变(v3.3.1 · 用 main 色但更暗一档,模拟 3D 阴影面 · 不再黑得过头)
- defs += `<linearGradient id="${g.id}_side" x1="0" y1="0" x2="0" y2="1">
- <stop offset="0%" stop-color="${g.main}" stop-opacity="0.78"/>
- <stop offset="100%" stop-color="${g.dark}" stop-opacity="0.92"/>
- </linearGradient>`;
- // 侧面背景(v3.3.1 · 与主面 bg 同色系 · 但深一档 · 让侧面与主面在视觉上是"同一座山的两面")
- defs += `<linearGradient id="${g.id}_sideBg" x1="0" y1="0" x2="0" y2="1">
- <stop offset="0%" stop-color="${g.main}" stop-opacity="0.18"/>
- <stop offset="100%" stop-color="${g.dark}" stop-opacity="0.32"/>
- </linearGradient>`;
- });
- segments.forEach(s => {
- defs += `<clipPath id="clip_${s.key}"><polygon points="${s.polygon}"/></clipPath>`;
- });
- sideSegments.forEach(s => {
- defs += `<clipPath id="clip_${s.key}"><polygon points="${s.polygon}"/></clipPath>`;
- });
- // 立体阴影 / 平面阴影
- if (stereoOn) {
- defs += `<filter id="cpDS3D" x="-15%" y="-15%" width="130%" height="130%">
- <feGaussianBlur in="SourceAlpha" stdDeviation="7"/>
- <feOffset dx="3" dy="9"/>
- <feComponentTransfer><feFuncA type="linear" slope="0.45"/></feComponentTransfer>
- <feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge>
- </filter>`;
- defs += `<filter id="cpGoldGlow" x="-50%" y="-50%" width="200%" height="200%">
- <feGaussianBlur in="SourceAlpha" stdDeviation="2"/>
- <feFlood flood-color="#C9A84C" flood-opacity="0.55"/>
- <feComposite in2="SourceAlpha" operator="in"/>
- <feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge>
- </filter>`;
- } else {
- defs += `<filter id="cpDS3D" x="-10%" y="-10%" width="120%" height="120%">
- <feGaussianBlur in="SourceAlpha" stdDeviation="4"/>
- <feOffset dx="0" dy="5"/>
- <feComponentTransfer><feFuncA type="linear" slope="0.28"/></feComponentTransfer>
- <feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge>
- </filter>`;
- }
- defs += `<filter id="cpTextShadow" x="-20%" y="-20%" width="140%" height="140%">
- <feGaussianBlur in="SourceAlpha" stdDeviation="0.6"/>
- <feOffset dx="0" dy="1"/>
- <feComponentTransfer><feFuncA type="linear" slope="0.55"/></feComponentTransfer>
- <feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge>
- </filter>`;
- // v3.3.2 · 烟雾立体氛围(仅立体 ON 时启用) · vignette + ground mist + 金色阶梯 rim 渐变
- if (stereoOn) {
- defs += `<radialGradient id="cpStereoVignette" cx="50%" cy="55%" r="68%">
- <stop offset="0%" stop-color="rgba(255,250,235,0)"/>
- <stop offset="65%" stop-color="rgba(60,40,15,0.05)"/>
- <stop offset="100%" stop-color="rgba(40,25,10,0.14)"/>
- </radialGradient>`;
- defs += `<radialGradient id="cpMistGround" cx="50%" cy="50%" r="50%">
- <stop offset="0%" stop-color="rgba(201,168,76,0.42)"/>
- <stop offset="60%" stop-color="rgba(201,168,76,0.10)"/>
- <stop offset="100%" stop-color="rgba(201,168,76,0)"/>
- </radialGradient>`;
- defs += `<linearGradient id="cpRimGold" x1="0" y1="0" x2="1" y2="0">
- <stop offset="0%" stop-color="rgba(201,168,76,0.30)"/>
- <stop offset="20%" stop-color="rgba(245,222,140,0.95)"/>
- <stop offset="50%" stop-color="rgba(255,238,180,1)"/>
- <stop offset="80%" stop-color="rgba(245,222,140,0.95)"/>
- <stop offset="100%" stop-color="rgba(201,168,76,0.30)"/>
- </linearGradient>`;
- defs += `<radialGradient id="cpApexHalo" cx="50%" cy="50%" r="50%">
- <stop offset="0%" stop-color="rgba(255,250,220,0.95)"/>
- <stop offset="40%" stop-color="rgba(245,222,140,0.55)"/>
- <stop offset="100%" stop-color="rgba(245,222,140,0)"/>
- </radialGradient>`;
- // v3.3.3 · 金色 rim 柔光滤镜(补偿去掉阴影后的对比度 · 金线自带光晕看起来更"印刷品质感")
- defs += `<filter id="cpRimGlow" x="-30%" y="-30%" width="160%" height="160%">
- <feGaussianBlur in="SourceGraphic" stdDeviation="0.8" result="blur"/>
- <feMerge><feMergeNode in="blur"/><feMergeNode in="SourceGraphic"/></feMerge>
- </filter>`;
- }
- // ════════ 顶部标题(v3.3.1 · 香槟金主题)════════
- const titleHtml = `<defs>
- <linearGradient id="cpTitleGold" x1="0" y1="0" x2="0" y2="1">
- <stop offset="0%" stop-color="#E5C76A"/>
- <stop offset="55%" stop-color="#C9A84C"/>
- <stop offset="100%" stop-color="#9B7C3A"/>
- </linearGradient>
- </defs>
- <g text-anchor="middle">
- <text x="240" y="42" font-family="'Noto Serif SC','PingFang SC',serif"
- font-size="26" font-weight="700" fill="url(#cpTitleGold)" letter-spacing="6"
- ${stereoOn ? 'filter="url(#cpGoldGlow)"' : ''}>风险金字塔</text>
- <text x="240" y="60" font-family="'Cormorant Garamond','Noto Serif SC',Georgia,serif"
- font-size="11" font-weight="600" fill="#9B7C3A" letter-spacing="5">RISK PYRAMID</text>
- </g>`;
- // ════════ 背景层(v3.3.2 · 立体 ON 时先铺烟雾氛围 → 主面背景)════════
- let bgHtml = '';
- if (stereoOn) {
- // 1) vignette 暗角
- bgHtml += `<rect x="0" y="0" width="480" height="450" fill="url(#cpStereoVignette)"/>`;
- // 2) v3.3.5 · 底部金色雾气已去掉(用户反馈底座那块"显脏" · 整体由 vignette + 粒子承担氛围)
- // bgHtml += `<ellipse cx="240" cy="432" rx="240" ry="22" fill="url(#cpMistGround)"/>`;
- // 3) 金色尘埃粒子(14 颗 · 不覆盖金字塔本体 · 散在四周)
- const particles = [
- { x:30, y:90, r:1.4, o:0.55 },
- { x:55, y:150, r:1.0, o:0.42 },
- { x:48, y:220, r:1.2, o:0.50 },
- { x:35, y:300, r:1.6, o:0.60 },
- { x:50, y:380, r:0.9, o:0.40 },
- { x:445, y:95, r:1.2, o:0.50 },
- { x:432, y:160, r:1.5, o:0.55 },
- { x:455, y:240, r:1.0, o:0.42 },
- { x:438, y:320, r:1.3, o:0.50 },
- { x:435, y:395, r:1.1, o:0.45 },
- { x:140, y:50, r:0.9, o:0.38 },
- { x:330, y:48, r:1.1, o:0.42 },
- { x:200, y:435, r:0.8, o:0.35 },
- { x:280, y:435, r:1.0, o:0.40 }
- ];
- particles.forEach(p => {
- bgHtml += `<circle cx="${p.x}" cy="${p.y}" r="${p.r}" fill="rgba(245,222,140,${p.o})"/>`;
- });
- }
- // 4) v3.3.3 · 主面背景多边形(已迁移到 layersHtml 的 .pyr-layer 内,这里仅保留 atmosphere)
- // (空: bgHtml 此时只含 vignette + mist + particles)
- // ════════ v3.3.3 · 每层独立 .pyr-layer 组(bg + 水位 + 标签 + 百分比 全部包在内 · 支持点击放大)════════
- // 用 viewBox 用户单位指定 transform-origin,确保点击放大以层中心为原点
- // v3.4.1 · 水滴 ON = 实际水位(显示缺口) · 水滴 OFF = 满覆盖原色(对照参照),两者切换让差距一目了然
- const buildWaterRect = (s) => {
- const fillH = (s.yB - s.yT) * s.cov;
- const waterY = s.yB - fillH;
- // 水滴 OFF · 显示完整层颜色(满覆盖参照 · 用作"应有"基线)
- if (!animOn) {
- const fullH = s.yB - s.yT;
- return `<rect x="0" y="${s.yT}" width="480" height="${fullH}"
- fill="url(#${s.grad})" clip-path="url(#clip_${s.key})"/>`;
- }
- // 水滴 ON · 实际覆盖率水位 + 涨水动画(显示"实际"vs"应有"的差距)
- if (fillH <= 0) return '';
- return `<rect x="0" y="${s.yB}" width="480" height="0"
- fill="url(#${s.grad})" clip-path="url(#clip_${s.key})">
- <animate attributeName="y" from="${s.yB}" to="${waterY}" dur="1.4s" begin="0.2s"
- fill="freeze" calcMode="spline" keyTimes="0;1" keySplines="0.22 1 0.36 1"/>
- <animate attributeName="height" from="0" to="${fillH}" dur="1.4s" begin="0.2s"
- fill="freeze" calcMode="spline" keyTimes="0;1" keySplines="0.22 1 0.36 1"/>
- </rect>`;
- };
- let layersHtml = '<g class="pyr-layers" filter="url(#cpDS3D)">';
- segments.forEach(s => {
- const pct = Math.round(s.cov * 100);
- layersHtml += `<g class="pyr-layer" data-key="${s.key}" style="transform-origin:${s.cx}px ${s.cy}px">`;
- // bg 多边形
- layersHtml += `<polygon points="${s.polygon}" fill="url(#${s.grad}_bg)"
- stroke="rgba(0,0,0,0.08)" stroke-width="0.6"/>`;
- // 水位 rect(clip 到本层 polygon)
- layersHtml += buildWaterRect(s);
- // 标签 + 百分比
- if (animOn) {
- layersHtml += `<text x="${s.labelX}" y="${s.labelY}" text-anchor="middle" fill="#fff"
- font-family="'Noto Serif SC','PingFang SC',serif"
- font-size="20" font-weight="700" letter-spacing="3"
- filter="url(#cpTextShadow)" opacity="0">
- ${s.label}
- <animate attributeName="opacity" from="0" to="1" dur="0.5s" begin="0.6s" fill="freeze"/>
- </text>`;
- layersHtml += `<text x="${s.labelX}" y="${s.pctY}" text-anchor="middle"
- font-family="'JetBrains Mono','Cormorant Garamond',monospace"
- font-size="13" font-weight="800" letter-spacing="0.5"
- fill="rgba(255,255,255,0.96)" filter="url(#cpTextShadow)" opacity="0">
- ${pct}%
- <animate attributeName="opacity" from="0" to="1" dur="0.6s" begin="1.2s" fill="freeze"/>
- </text>`;
- } else {
- layersHtml += `<text x="${s.labelX}" y="${s.labelY}" text-anchor="middle" fill="#fff"
- font-family="'Noto Serif SC','PingFang SC',serif"
- font-size="20" font-weight="700" letter-spacing="3"
- filter="url(#cpTextShadow)">${s.label}</text>`;
- layersHtml += `<text x="${s.labelX}" y="${s.pctY}" text-anchor="middle"
- font-family="'JetBrains Mono','Cormorant Garamond',monospace"
- font-size="13" font-weight="800" letter-spacing="0.5"
- fill="rgba(255,255,255,0.96)"
- filter="url(#cpTextShadow)">${pct}%</text>`;
- }
- layersHtml += '</g>';
- });
- layersHtml += '</g>';
- // ════════ 立体装饰(v3.3.3 · A方案最终: 仅金色 rim + 底座接地阴影 + apex halo · 去掉层间阴影线)════════
- let rimHtml = '';
- if (stereoOn) {
- // (a) 4 条层间金色 rim 高光线 + 底座金色 rim · 全部加 cpRimGlow 柔光,补偿去掉阴影后的对比度
- rimHtml = `<g stroke-linecap="round" fill="none" filter="url(#cpRimGlow)">
- <line x1="163" y1="205" x2="317" y2="205" stroke="url(#cpRimGold)" stroke-width="2.2"/>
- <line x1="131" y1="260" x2="349" y2="260" stroke="url(#cpRimGold)" stroke-width="2.2"/>
- <line x1="100" y1="315" x2="380" y2="315" stroke="url(#cpRimGold)" stroke-width="2.2"/>
- <line x1="69" y1="370" x2="411" y2="370" stroke="url(#cpRimGold)" stroke-width="2.2"/>
- <line x1="40" y1="420" x2="440" y2="420" stroke="url(#cpRimGold)" stroke-width="2.4"/>
- </g>`;
- // (b) v3.3.4 · 底座接地阴影已去掉(用户反馈底座黑线显冷峻 · 整体已由金色 rim + 雾气提供视觉收尾)
- // (c) L5 三分竖线(仅金色 rim · 去掉阴影竖线)
- rimHtml += `<g stroke-linecap="round" fill="none" filter="url(#cpRimGlow)">
- <line x1="183" y1="370" x2="173" y2="420" stroke="url(#cpRimGold)" stroke-width="1.6"/>
- <line x1="297" y1="370" x2="307" y2="420" stroke="url(#cpRimGold)" stroke-width="1.6"/>
- </g>`;
- // (d) apex 顶部光晕(金色光球)
- rimHtml += `<circle cx="240" cy="70" r="14" fill="url(#cpApexHalo)"/>`;
- rimHtml += `<circle cx="240" cy="70" r="3.5" fill="rgba(255,250,220,0.95)"/>`;
- }
- // ════════ 层间分隔(v3.3.2 · 立体 ON 时已由 rim 替代,仅 OFF 时保留白线)════════
- let dividerHtml = '';
- if (!stereoOn) {
- dividerHtml = `<g stroke="#fff" stroke-width="2.5" fill="none" opacity="0.95">
- <line x1="163" y1="205" x2="317" y2="205"/>
- <line x1="131" y1="260" x2="349" y2="260"/>
- <line x1="100" y1="315" x2="380" y2="315"/>
- <line x1="69" y1="370" x2="411" y2="370"/>
- </g>
- <g stroke="#fff" stroke-width="2.5" opacity="0.95">
- <line x1="183" y1="370" x2="173" y2="420"/>
- <line x1="297" y1="370" x2="307" y2="420"/>
- </g>`;
- }
- // ════════ v3.3.3 · 标签已迁移到 .pyr-layer 内 · 这里清空 labelHtml ════════
- let labelHtml = '';
- svg.innerHTML = `<defs>${defs}</defs>${titleHtml}${bgHtml}${layersHtml}${rimHtml}${dividerHtml}${labelHtml}`;
- // v3.3.3 · 点击放大动效:绑定每层 click,选中后 1.4s 自动收回(再次点击同层立即收回)
- svg.querySelectorAll('.pyr-layer').forEach(el => {
- if (el.dataset.bound) return;
- el.dataset.bound = '1';
- el.addEventListener('click', () => {
- const wasActive = el.classList.contains('is-active');
- svg.querySelectorAll('.pyr-layer.is-active').forEach(o => o.classList.remove('is-active'));
- if (!wasActive) {
- el.classList.add('is-active');
- // 自动收回(避免用户离开后视觉残留)
- clearTimeout(el._activeTimer);
- el._activeTimer = setTimeout(() => el.classList.remove('is-active'), 1600);
- }
- });
- });
- }
- function renderGapChart(data) {
- const body = document.getElementById('gapChartBody');
- if (!body) return;
- // v3.0 · 7 险种分三层(基础 / 中端 / 高端)
- const items = [
- // 🟧 基础风险层
- { key: 'acc', icon: '⚡', label: '意外险', tier: 'base', tierEmoji: '🟧', ...data.acc },
- { key: 'med', icon: '🏥', label: '医疗险', tier: 'base', tierEmoji: '🟧', ...data.med },
- { key: 'ci', icon: '⚕', label: '重疾险', tier: 'base', tierEmoji: '🟧', ...data.ci },
- // 🟨 中端风险层
- { key: 'life', icon: '🛡', label: '定期寿险', tier: 'mid', tierEmoji: '🟨', ...data.life },
- { key: 'education', icon: '🎓', label: '教育年金', tier: 'mid', tierEmoji: '🟨', ...data.education },
- { key: 'retirement', icon: '🌅', label: '养老年金', tier: 'mid', tierEmoji: '🟨', ...data.retirement },
- // 🟡 高端风险层
- { key: 'wl', icon: '💎', label: '终身寿险', tier: 'high', tierEmoji: '🟡', ...data.wl }
- ];
- // 找最大值用于归一化
- const maxTotal = Math.max(...items.map(i => i.total || 1));
- // tier 颜色 mapping
- const tierColors = {
- base: { fill: '#E07A3B', light: '#FBE3D2' },
- mid: { fill: '#D4A93A', light: '#F5EBC8' },
- high: { fill: '#7A3FA0', light: '#EFE3F5' } // v2026-06-14 · 同步金字塔顶层 L1 紫
- };
- body.innerHTML = items.map(item => {
- const total = item.total || 0;
- const existing = item.existing || 0;
- const gap = item.gap || 0;
- const totalPct = (total / maxTotal) * 100;
- const existingPct = total > 0 ? (existing / total) * totalPct : 0;
- const gapStartPct = existingPct;
- const gapWidthPct = total > 0 ? (gap / total) * totalPct : 0;
- const gapDisplay = gap >= 10000 ? '¥' + (gap/10000).toFixed(1) + '亿'
- : gap >= 1 ? '¥' + Math.round(gap) + '万' : '¥0';
- const tc = tierColors[item.tier];
- return `<div class="gap-row" data-tier="${item.tier}" style="border-left:3px solid ${tc.fill}; padding-left:8px">
- <div class="gap-label"><span>${item.icon}</span><span>${item.label}</span><span style="font-size:9px;opacity:0.6">${item.tierEmoji}</span></div>
- <div class="gap-bar-wrap">
- ${existingPct > 0 ? `<div class="gap-bar-existing" style="width:${existingPct}%; background:${tc.light}">${existing > 0 ? '已' : ''}</div>` : ''}
- ${gapWidthPct > 0 ? `<div class="gap-bar-gap" style="left:${gapStartPct}%;width:${gapWidthPct}%; background:${tc.fill}">缺</div>` : ''}
- </div>
- <div class="gap-amount">缺口 <span class="gap-num">${gapDisplay}</span></div>
- </div>`;
- }).join('');
- }
- /* === Phase 3 · 推荐产品(从 products-bundle.js 匹配) === */
- function matchProducts(category, criteria) {
- if (!window.CY_PRODUCTS || !window.CY_PRODUCTS[category]) return [];
- const products = window.CY_PRODUCTS[category] || [];
- // 简单匹配:hot_selling 优先 + featured_rank 排序
- return [...products]
- .sort((a, b) => {
- if (a.hot_selling !== b.hot_selling) return a.hot_selling ? -1 : 1;
- return (a.featured_rank || 99) - (b.featured_rank || 99);
- })
- .slice(0, 6); // 最多展示 6 款
- }
- function renderProductCard(p) {
- const isHot = p.hot_selling;
- const features = (p.key_features || []).slice(0, 3);
- let priceRange = '';
- if (p.premium_range_cny) {
- const min = p.premium_range_cny.min;
- const max = p.premium_range_cny.max;
- priceRange = '¥' + (min >= 10000 ? Math.round(min/10000) + '万' : min) +
- ' - ¥' + (max >= 10000 ? Math.round(max/10000) + '万' : max);
- } else if (p.premium_range_usd) {
- const min = p.premium_range_usd.min;
- const max = p.premium_range_usd.max;
- priceRange = '$' + (min >= 1000000 ? (min/1000000).toFixed(1) + 'M' : min) +
- ' - $' + (max >= 1000000 ? (max/1000000).toFixed(1) + 'M' : max);
- }
- return `<div class="product-item ${isHot ? 'hot' : ''}" onclick="showProductModal('${p.id}')" style="cursor:pointer">
- <div class="product-name">
- ${p.name_cn || ''}
- ${isHot ? '<span class="hot-badge">HOT</span>' : ''}
- </div>
- <div class="product-issuer">${p.issuer || ''} · ${p.region || ''} · ${p.type_label || ''}</div>
- ${p.tagline ? `<div class="product-tagline">"${p.tagline}"</div>` : ''}
- <ul class="product-feats">
- ${features.map(f => `<li>${f}</li>`).join('')}
- </ul>
- <div class="product-meta">
- <span>保费 <span class="v">${priceRange || '—'}</span></span>
- <span style="color:var(--accent);font-weight:600">点击查看详情 →</span>
- </div>
- </div>`;
- }
- /* === v2.8 · 支付能力健康度 + 行业基准对比 + 双轨配置 ===
- [v2.9 升级]
- (a) HNW 客户支付能力分母切换:工资 → AUM(他们用 AUM 缴保费,不是工资)
- AUM-based 上限映射:用户选 20% → HNW 实际 = AUM × 2%(1% 行业惯例 × 2 容忍度)
- 具体映射表 = { 10:0.5%, 15:1%, 20:2%, 30:3%, 100:100% }
- (b) 教育金分级保留:留学子女(elite_us / full_overseas)floor 70%,
- 国内+混合(domestic_plus)floor 50%,纯国内 floor 30%。
- 缩减时优先保护教育金(签证 + 时间窗口),养老金可延后补足。
- */
- /* === v3.4 · 家庭总财富画像渲染 ===
- 三盘视角(流动 / 自住 / 投资)+ 智能洞察 + 跳转 AssetCenter / LetsSee
- */
- /* === [v3.6] 7 险种计算依据 展开块 ===
- 触发:result-cover 卡片上的 📐 按钮
- 渲染:7 险种逐项公式 + 数字 + 总保额合计
- 口径:客户感知口径(标注在 disclaimer)
- */
- window._lastFormulaCtx = null; // 保存上次计算上下文,toggleFormulaPanel 时用
- /* === [v4.4.2] 通用 ⓘ Popover 折叠组件 · 全局 === */
- function toggleInfoPopover(id) {
- const overlay = document.getElementById('info-' + id);
- if (!overlay) return;
- // 关闭其他所有 popover
- document.querySelectorAll('.info-popover-overlay.is-open').forEach(el => {
- if (el.id !== overlay.id) el.classList.remove('is-open');
- });
- overlay.classList.toggle('is-open');
- }
- /* === [v4.5.2] 现金流方案切换器 · 建议 vs 可负担 · [v4.6] 加自定义方案 === */
- function switchCfScenario(scenario) {
- if (scenario !== 'full' && scenario !== 'affordable' && scenario !== 'custom') return;
- window._cyShowScenario = scenario;
- // 更新按钮 active 状态
- document.querySelectorAll('.cf-scenario-btn').forEach(btn => {
- btn.classList.remove('is-active');
- btn.classList.remove('is-affordable');
- btn.classList.remove('is-custom');
- if (btn.getAttribute('data-scenario') === scenario) {
- btn.classList.add('is-active');
- if (scenario === 'affordable') btn.classList.add('is-affordable');
- if (scenario === 'custom') btn.classList.add('is-custom');
- } else if (btn.getAttribute('data-scenario') === 'custom') {
- // 非激活态的自定义按钮也保留 is-custom 标识(用于 hover 蓝色)
- btn.classList.add('is-custom');
- }
- });
- // 触发重算 → Canvas + KPI 联动
- const resultEl = document.getElementById('result');
- if (resultEl && resultEl.style.display !== 'none' && typeof calculate === 'function') {
- window._cySilentRecalc = true;
- try { calculate(); } finally { window._cySilentRecalc = false; }
- }
- }
- // 点击 overlay 自身(非内容区)关闭
- document.addEventListener('click', function(e) {
- if (e.target && e.target.classList && e.target.classList.contains('info-popover-overlay')) {
- e.target.classList.remove('is-open');
- }
- });
- // ESC 关闭
- document.addEventListener('keydown', function(e) {
- if (e.key === 'Escape') {
- document.querySelectorAll('.info-popover-overlay.is-open').forEach(el => el.classList.remove('is-open'));
- }
- });
- function toggleFormulaPanel() {
- const panel = document.getElementById('formulaPanel');
- if (!panel) return;
- const visible = panel.style.display !== 'none';
- if (visible) {
- panel.style.display = 'none';
- } else {
- panel.style.display = 'block';
- // 滚动到 panel
- setTimeout(() => panel.scrollIntoView({ behavior: 'smooth', block: 'center' }), 50);
- }
- }
- function renderFormulaPanel(ctx) {
- // ctx 包含所有计算需要的上下文,在 calculate 末尾调用 setFormulaCtx 保存
- window._lastFormulaCtx = ctx;
- const body = document.getElementById('formulaPanelBody');
- if (!body) return;
- // 数字 → 友好格式
- const fmt = (wan) => {
- if (wan >= 10000) return '¥' + (wan/10000).toFixed(2) + ' 亿';
- if (wan === 0) return '¥0';
- return '¥' + Math.round(wan).toLocaleString('zh-CN') + ' 万';
- };
- const fmtPremium = (yuan) => '¥' + (yuan/10000).toFixed(2) + ' 万 / 年';
- const isHNW = ctx.isHNWFinal;
- // 7 险种公式 + 数字
- const rows = [];
- // 1. 意外险 · [v4.5.3] 差异化定位 · 伤残保障(独有价值)
- if (isHNW) {
- rows.push({
- icon: '💢', name: '意外险(伤残保障)', tier: '基础',
- formula: 'HNW 伤残应急 = 年薪 ' + ctx.salary + ' 万 × 3 = ¥' + ctx.accidentNeed + ' 万(意外身故由定寿覆盖)',
- payYears: '1 年',
- need: ctx.accidentNeed, gap: ctx.accidentGap, premium: ctx.accidentPremium,
- note: '🟢 **意外伤残**全残 100% / 部分伤残按等级 10-90% · 与定寿差异化(意外险=伤残 / 定寿=身故)'
- });
- } else {
- rows.push({
- icon: '💢', name: '意外险(伤残保障)', tier: '基础',
- formula: '伤残期 5 年家庭过渡 = 年薪 ' + ctx.salary + ' 万 × 5(主理人不能工作但活着)',
- payYears: '1 年',
- need: ctx.accidentNeed, gap: ctx.accidentGap, premium: ctx.accidentPremium,
- note: '🟢 **意外伤残**全残 100% / 部分伤残按等级 10-90% · 与定寿差异化(意外险=伤残 / 定寿=身故)'
- });
- }
- // 2. 重疾
- rows.push({
- icon: '🔴', name: '重疾(储蓄型)', tier: '基础',
- formula: '年薪 ' + ctx.salary + ' 万 × ' + ctx.ciMultiplier + '(重疾倍数)',
- payYears: (ctx.ciPayYears || 20) + ' 年',
- need: ctx.ciNeed, gap: ctx.ciGap, premium: ctx.ciPremium,
- note: '🟢 一次性给付:诊断重疾即赔 + **意外身故也赔保额**(储蓄型有身故责任) + 现金价值累积(Benchmark 标配储蓄型)'
- });
- // 3. 高端医疗
- rows.push({
- icon: '💚', name: '高端医疗', tier: '基础',
- formula: '推荐固定值 800 万(覆盖境内顶级私立 + 海外医疗)',
- payYears: '1 年',
- need: ctx.medNeed,
- gap: ctx.existingMed === 1 ? 0 : ctx.medNeed,
- premium: ctx.medPremium,
- note: '⚠ 年度报销上限(每年重置 · 不是一次性给付 · 简化计入总保额)'
- });
- // 4. 寿险(HNW 模式 = 境内定期寿险 / 普通家庭 = 定期寿险 DIM 法)
- // [v4.3] 改名:寿险(DIM 法) → 定期寿险(明确产品类型 · 与终身寿险区分)
- if (isHNW) {
- rows.push({
- icon: '🛡', name: '定期寿险(境内)', tier: '中端',
- formula: '主理人 max(¥' + (ctx._lifeAgeMin/10000) + '亿, min(AUM × ' + (ctx._lifeAumRatio*100).toFixed(0) + '%, ¥' + (ctx._lifeAgeCap/10000) + '亿))<br>+ 配偶(主理人 50%)',
- payYears: (ctx.lifePayYears || 30) + ' 年',
- need: ctx.lifeNeed, gap: ctx.lifeGap, premium: ctx.lifePremium,
- note: '🟢 **任何原因身故**(意外+疾病)赔保额 · ⚠ 意外身故时与意外险**双重赔付**(保险公司不冲抵) · 与意外险差异化(定寿=身故 / 意外险=伤残)'
- });
- } else {
- // [v4.4] 普通家庭 DIM 法定期寿险 · 明确 I 收入替代公式 + 主理人占比 30% 下限说明
- const _yearsToRetire = ctx.yearsToRetire || 0;
- const _principalSharePct = ((ctx.principalShare || 0) * 100).toFixed(0);
- const _incomeReplacePct = ((ctx.incomeReplaceRate || 0) * 100).toFixed(0);
- const _discountRatePct = ((ctx.incomeDiscountRate || 0) * 100).toFixed(1);
- const _floorTriggered = (ctx.principalShare || 0) < 0.3;
- rows.push({
- icon: '🛡', name: '定期寿险(DIM 法)', tier: '中端',
- formula:
- '<strong>DIM 公式</strong>:D 房贷+负债 + I 收入替代 - A 现有资产<br>' +
- '<strong>D 房贷+负债</strong> = ¥' + ctx.D + ' 万<br>' +
- '<strong>I 收入替代</strong> = 年薪 ¥' + ctx.salary + '万 × 主理人占比 ' + _incomeReplacePct + '% × ' + _yearsToRetire + ' 年现值因子(折现率 ' + _discountRatePct + '%)<br>' +
- ' = ¥' + Math.round(ctx.I) + ' 万' + (_floorTriggered ? '<span style="color:#A61C2B"> · ⚠ 主理人占比 30% 保底触发(实际 ' + _principalSharePct + '%)</span>' : '') + '<br>' +
- '<strong>假设</strong>:<br>' +
- ' • 主理人占比 = max(salary/家庭总收入, <strong>30% 下限</strong>) — 意外身故对家庭情感+经济冲击不低于 30%<br>' +
- ' • 折现率(' + _discountRatePct + '%) = 国债收益率假设(form 可调:0/3/4/5/6%,默认 3%)<br>' +
- ' • 工作期 = 当前年龄至退休的剩余年数<br>' +
- '<strong>A 现有资产</strong>(流动金融)= ¥' + ctx.liquid + ' 万<br>' +
- '<strong>合计</strong> = D + I - A = ¥' + Math.round(ctx.lifeNeed) + ' 万',
- payYears: (ctx.lifePayYears || 30) + ' 年',
- need: ctx.lifeNeed, gap: ctx.lifeGap, premium: ctx.lifePremium,
- note: '🟢 **任何原因身故**(意外+疾病)赔保额 · ⚠ 意外身故时与意外险**双重赔付**(保险公司不冲抵) · 教育金已剥离独立险种'
- });
- }
- // 5. 养老金
- rows.push({
- icon: '💰', name: '养老金', tier: '中端',
- formula:
- '<strong>① 退休后月缺口</strong> = 年薪 × ' + (ctx.retireLifestyleRatio*100).toFixed(0) + '% / 12 - 社保 1.2 万<br>' +
- '<strong>② 退休时所需保额</strong> = 月缺口 × 12 × 年金现值因子(' + ctx.retireYears + ' 年通胀 3% PV)<br>' +
- '<strong>③ 缺口</strong> = 所需保额 − 已有储备<br>' +
- '<strong>④ 年缴(精算)</strong> = 缺口 / FV 年金未来值因子(' + (ctx.retirePayYears || 20) + ' 年缴, IRR 3%)<br>' +
- '<span style="color:#7A6028;font-size:10px">v4.7 替换原 ×0.65 魔术系数 → 精算 FV 因子,与缴费年限/IRR 联动</span>',
- payYears: (ctx.retirePayYears || 20) + ' 年',
- need: ctx.retireNeed, gap: ctx.retireGap, premium: ctx.retirePremium,
- note: '✓ PV 现值(今天该准备的购买力 · 精算 FV 折扣反映年金险杠杆)'
- });
- // 6. 教育金
- rows.push({
- icon: '🎓', name: '教育金', tier: '中端',
- formula:
- '<strong>① 单子女总需求</strong> = ' + ctx.eduUnit + ' 万(' + ctx.eduPathLabel + ')PV 现值' + (ctx.childCount > 1 ? ' × ' + ctx.childCount + ' 子女' : '') + '<br>' +
- '<strong>② 缺口</strong> = 总需求 − 已有储备 − 已配教育金险<br>' +
- '<strong>③ 年缴(精算)</strong> = 缺口 / FV 年金未来值因子(' + (ctx.eduPayYears > 0 ? ctx.eduPayYears : '—') + ' 年缴, IRR 3%)<br>' +
- '<span style="color:#7A6028;font-size:10px">v4.7 替换原 ×0.85 / 10 年硬编码 → 精算 FV 因子,与子女年龄/IRR 联动</span>',
- payYears: (ctx.eduPayYears > 0 ? ctx.eduPayYears + ' 年' : '—'),
- need: ctx.eduNeed, gap: ctx.eduGap, premium: ctx.eduPremium,
- note: '✓ PV 现值 + FV 精算(子女越小缴期越长,年缴越低)'
- });
- // 7. 终身寿险(高端) · v4.0 双轨拆解
- if (isHNW) {
- const _wlD = ctx.wlDomestic || 0;
- const _wlIUL = ctx.wlOverseasIUL || 0;
- const _wlPPLI = ctx.wlOverseasPPLI || 0;
- const _ageMul = ctx.ageMultiplier || 80;
- const _annualIULWan = ctx.annualPremiumIULWan || 0;
- const _ppliInjectable = ctx.ppliInjectable || 0;
- const _enablePPLI = ctx.enablePPLI || false;
- const _needRatio = ctx.hasUSPerson ? '50%' : '30%';
- rows.push({
- icon: '🏛', name: '终身寿险(双轨)', tier: '高端',
- formula:
- '<strong style="color:#A61C2B">境内增额终身寿</strong> ¥' + _wlD + ' 万<br>' +
- '主理人 = min(max(salary × 10, 境内 × 30%), ageCap) + 配偶(按 spouseSalary/salary 比例,无收入 0)<br>' +
- '合计 ≤ 境内 × 50%(v4.3 上限)<br><br>' +
- '<strong style="color:#3D6F8C">境外 ' + (ctx.wlOverseasTier || 'IUL/VUL/PPLI') + '</strong> ¥' + (ctx.wlOverseas || 0) + ' 万<br>' +
- (_enablePPLI
- ? 'PPLI 保额 = 装入资产合计 ¥' + _ppliInjectable + ' 万(流动 100% + 自住 0% + 投资 30%)'
- : 'IUL/VUL = 境外资产 × ' + _needRatio + ' = ¥' + _wlIUL + ' 万<br>反推年保费 ¥' + _annualIULWan + ' 万 = 保额 / 杠杆 ' + _ageMul + 'x(健康标体非吸烟)'),
- payYears: (ctx.wlPayYears || 20) + ' 年',
- need: ctx.wlNeed, gap: ctx.wlGap, premium: ctx.wlPremium,
- note: _enablePPLI
- ? '🟢 双轨配置:境内传承隔离 + 境外 IUL/VUL/PPLI(PPLI 装入非现金资产)· 建议 3-5 张保单分批'
- : '🟢 双轨配置:境内传承隔离 + 境外 IUL/VUL(AUM < $2000 万美金不启用 PPLI)· 建议 3-5 张保单分批'
- });
- } else {
- rows.push({
- icon: '🏛', name: '终身寿险(传承)', tier: '高端',
- formula: '总资产 ¥' + Math.round(ctx.totalAumForWL) + ' 万 × 30%(传承隔离基线)',
- payYears: (ctx.wlPayYears || 20) + ' 年',
- need: ctx.wlNeed, gap: ctx.wlGap, premium: ctx.wlPremium,
- note: '○ 普通家庭可选购增额终身寿,做现金价值积累 + 传承隔离'
- });
- }
- // 渲染
- let html = '<table style="width:100%;border-collapse:collapse;table-layout:fixed">';
- html += '<colgroup>' +
- '<col style="width:18%">' + // 险种
- '<col style="width:38%">' + // 公式(压缩)
- '<col style="width:13%">' + // 建议保额(加宽)
- '<col style="width:11%">' + // 缺口
- '<col style="width:13%">' + // 年缴保费(加宽)
- '<col style="width:7%">' + // 缴费年限(只显示数字 + 年)
- '</colgroup>';
- html += '<thead><tr style="border-bottom:2px solid #C9A84C">' +
- '<th style="text-align:left;padding:6px 10px;font-size:11.5px;color:#7A6028">险种</th>' +
- '<th style="text-align:left;padding:6px 10px;font-size:11.5px;color:#7A6028">公式</th>' +
- '<th style="text-align:center;padding:6px 10px;font-size:13px;color:#3D2914;font-weight:700">建议保额</th>' +
- '<th style="text-align:center;padding:6px 10px;font-size:13px;color:#3D2914;font-weight:700">保障缺口</th>' +
- '<th style="text-align:center;padding:6px 10px;font-size:13px;color:#3D2914;font-weight:700">年缴保费</th>' +
- '<th style="text-align:center;padding:6px 6px;font-size:11.5px;color:#7A6028">缴费<br>年限</th>' +
- '</tr></thead><tbody>';
- rows.forEach((r, idx) => {
- const tierColor = { '基础': '#9B7C3A', '中端': '#A61C2B', '高端': '#7A5A8E' };
- // [v4.0] 按口径分组上色:对应顶部三栏汇总
- // 一次性赔付组(意外/重疾/医疗/寿险/终身寿险) → 金色 #9B7C3A
- // 长周期累积组(养老金/教育金) → 蓝色 #3D6F8C
- const isLongterm = r.name.includes('养老') || r.name.includes('教育');
- const needColor = isLongterm ? '#3D6F8C' : '#9B7C3A';
- const premiumColor = isLongterm ? '#3D6F8C' : '#9B7C3A';
- const rowBg = isLongterm ? 'rgba(141,185,213,.04)' : 'rgba(196,151,58,.03)';
- html += '<tr style="border-bottom:1px dashed rgba(155,124,58,.2);background:' + rowBg + '">' +
- '<td style="padding:8px 10px;vertical-align:top">' +
- '<div style="font-weight:600;color:#1A0F05;font-size:12.5px">' + r.icon + ' ' + r.name +
- ' <span style="font-size:10px;color:' + tierColor[r.tier] + ';font-weight:500">[' + r.tier + ']</span>' +
- ' <span style="font-size:9.5px;color:' + needColor + ';font-weight:600;letter-spacing:0.4px;margin-left:4px">[' + (isLongterm ? '长周期' : '一次性') + ']</span></div>' +
- '<div style="font-size:10.5px;color:#7A6028;margin-top:3px">' + r.note + '</div>' +
- '</td>' +
- '<td style="padding:8px 10px;font-size:10.5px;color:#3D2914;vertical-align:top;line-height:1.55;word-break:break-word">' + r.formula + '</td>' +
- '<td style="padding:8px 8px;text-align:center;font-family:Cormorant Garamond,serif;font-feature-settings:lnum,tnum;font-weight:800;color:' + needColor + ';white-space:nowrap;font-size:16px">' + fmt(r.need) + '</td>' +
- '<td style="padding:8px 6px;text-align:center;font-family:Cormorant Garamond,serif;font-feature-settings:lnum,tnum;font-weight:800;color:' + (r.gap > 0 ? '#A61C2B' : '#666') + ';white-space:nowrap;font-size:15.5px">' + fmt(r.gap) + '</td>' +
- '<td style="padding:8px 8px;text-align:center;font-family:Cormorant Garamond,serif;font-feature-settings:lnum,tnum;font-weight:800;color:' + premiumColor + ';white-space:nowrap;font-size:15px">' + (r.premium > 0 ? fmtPremium(r.premium) : '—') + '</td>' +
- '<td style="padding:8px 4px;text-align:center;font-size:11px;color:#5C4810;vertical-align:middle;white-space:nowrap;font-weight:600">' + (r.payYears || '—') + '</td>' +
- '</tr>';
- });
- // [v4.0 → v4.7] 合计行 · 简化为只显示总缺口(去掉"一次性赔付"+"长周期累积"双栏分离)
- // Jack 2026-06-21:底部合计保留"建议保额 + 保障缺口 + 年缴保费"三列居中对齐
- const _totalNeed = rows.reduce(function(s, r){ return s + (r.need || 0); }, 0);
- const _totalGap = rows.reduce(function(s, r){ return s + (r.gap || 0); }, 0);
- html += '<tr style="background:linear-gradient(90deg,rgba(196,151,58,.12),rgba(141,185,213,.10));font-weight:700;border-top:2px solid #C9A84C">' +
- '<td colspan="2" style="padding:12px;color:#1A0F05;font-size:13.5px;font-weight:800">📊 合计</td>' +
- '<td style="padding:12px 8px;text-align:center;font-family:Cormorant Garamond,serif;font-feature-settings:lnum,tnum;font-weight:800;color:#9B7C3A;white-space:nowrap;font-size:18px">' + fmt(_totalNeed) + '</td>' +
- '<td style="padding:12px 6px;text-align:center;font-family:Cormorant Garamond,serif;font-feature-settings:lnum,tnum;font-weight:800;color:#A61C2B;white-space:nowrap;font-size:18px">' + fmt(_totalGap) + '</td>' +
- '<td style="padding:12px 8px;text-align:center;font-family:Cormorant Garamond,serif;font-feature-settings:lnum,tnum;font-weight:800;color:#9B7C3A;white-space:nowrap;font-size:16.5px">' + fmtPremium(ctx.totalPremium) + '</td>' +
- '<td style="padding:12px 4px"></td>' +
- '</tr>';
- // v4.3 disclaimer 提示行
- html += '<tr style="background:rgba(196,151,58,.04)">' +
- '<td colspan="6" style="padding:10px 12px;font-size:10.5px;line-height:1.65;color:#7A6028">' +
- '💡 <strong>v4.3 口径分离 + 缴费年限</strong>:一次性赔付(出险即赔,金色)/ 长周期累积(养老/教育 PV 现值,蓝色)/ 年缴保费(客户实际成本)。**缴费年限**列展示各险种的缴费周期(纯消费 1 年续保 / 储蓄型 20 年缴清 / 定期寿 20-30 年保障),帮助客户理解年现金流支出节奏(为 LDI 投资规划做准备)。' +
- '</td>' +
- '</tr>';
- html += '</tbody></table>';
- body.innerHTML = html;
- }
- /* === v3.4 · 家庭总财富画像渲染 === */
- function renderWealthPicture(d) {
- // [v3.6] 4 盘:流动 / 自住 / 其他投资 / 保险现金价值
- const insurValue = d.insuranceCashValue || 0;
- const total = d.totalWealth || (d.liquid + d.primaryResidence + d.investAssets + insurValue);
- const fmtMoney = (wan) => {
- if (wan >= 10000) return '¥' + (wan/10000).toFixed(2) + '亿';
- return '¥' + Math.round(wan) + '万';
- };
- // 总额
- document.getElementById('wpTotalAmt').textContent = fmtMoney(total);
- if (total === 0) {
- document.getElementById('wpInsight').innerHTML =
- '⚠ 四盘均为 0 · 请在「家庭财务信息」段填写流动资产 / 自住房产 / 其他投资,以查看完整画像';
- ['wpSegLiquid','wpSegHouse','wpSegInvest','wpSegInsur'].forEach(id => {
- const el = document.getElementById(id);
- if (el) el.style.width = '0%';
- });
- return;
- }
- // 四盘金额 + 占比
- const liquidPct = total > 0 ? d.liquid / total : 0;
- const housePct = total > 0 ? d.primaryResidence / total : 0;
- const investPct = total > 0 ? d.investAssets / total : 0;
- const insurPct = total > 0 ? insurValue / total : 0;
- document.getElementById('wpLiquidAmt').textContent = fmtMoney(d.liquid);
- document.getElementById('wpHouseAmt').textContent = fmtMoney(d.primaryResidence);
- document.getElementById('wpInvestAmt').textContent = fmtMoney(d.investAssets);
- const insurAmtEl = document.getElementById('wpInsurAmt');
- if (insurAmtEl) insurAmtEl.textContent = fmtMoney(insurValue);
- document.getElementById('wpLiquidPct').textContent = (liquidPct*100).toFixed(0) + '%';
- document.getElementById('wpHousePct').textContent = (housePct*100).toFixed(0) + '%';
- document.getElementById('wpInvestPct').textContent = (investPct*100).toFixed(0) + '%';
- const insurPctEl = document.getElementById('wpInsurPct');
- if (insurPctEl) insurPctEl.textContent = (insurPct*100).toFixed(0) + '%';
- // 堆叠条 · 4 段
- const segLiq = document.getElementById('wpSegLiquid');
- const segHouse = document.getElementById('wpSegHouse');
- const segInvest = document.getElementById('wpSegInvest');
- const segInsur = document.getElementById('wpSegInsur');
- if (segLiq) { segLiq.style.width = (liquidPct*100).toFixed(2) + '%'; segLiq.textContent = liquidPct >= 0.10 ? (liquidPct*100).toFixed(0) + '%' : ''; }
- if (segHouse) { segHouse.style.width = (housePct*100).toFixed(2) + '%'; segHouse.textContent = housePct >= 0.10 ? (housePct*100).toFixed(0) + '%' : ''; }
- if (segInvest) { segInvest.style.width = (investPct*100).toFixed(2) + '%'; segInvest.textContent = investPct >= 0.10 ? (investPct*100).toFixed(0) + '%' : ''; }
- if (segInsur) { segInsur.style.width = (insurPct*100).toFixed(2) + '%'; segInsur.textContent = insurPct >= 0.10 ? (insurPct*100).toFixed(0) + '%' : ''; }
- // 智能洞察
- const familyIncome = d.salary + d.spouseSalary;
- const wealthToIncomeRatio = familyIncome > 0 ? total / familyIncome : 0;
- let insight = '';
- // 1) 资产结构判断
- if (housePct >= 0.70) {
- insight += '🏠 <strong>自住房产占比 ' + (housePct*100).toFixed(0) + '%(过高)</strong> · 典型"房子比家底厚"中产结构 —— 流动性弱,一旦主理人意外,家人虽有房可住但缺现金支付教育/医疗。<strong>建议</strong>:把寿险作为流动性补充,不要用自住房做"现有资产"扣减寿险需求。';
- } else if (liquidPct >= 0.60 && total < 1000) {
- insight += '💧 <strong>流动资产占比高(' + (liquidPct*100).toFixed(0) + '%)且总财富仍小</strong> · 典型早期积累期 —— 配置重点应该是<strong>保障型</strong>(重疾/寿险/医疗),不要急于做激进资产配置。';
- } else if (investPct >= 0.40) {
- insight += '🏛 <strong>其他投资资产占比 ' + (investPct*100).toFixed(0) + '%(主动配置型)</strong> —— 您已经有相当的资产配置经验。建议<strong>跳转资产配置中心</strong>细化股票/基金/黄金/私募的具体仓位,让保险作为"对冲层"而非"主仓位"。';
- } else if (total >= 5000) {
- insight += '🏛 <strong>总财富 ' + fmtMoney(total) + '(HNW 级别)</strong> —— 已超过 HNW 触发线 ¥5000 万,系统已切换为 AUM 分母模式计算保费占比(行业惯例 1-3% AUM)。';
- } else {
- insight += '✓ <strong>三盘结构相对均衡</strong> —— 流动 ' + (liquidPct*100).toFixed(0) + '% / 自住 ' + (housePct*100).toFixed(0) + '% / 投资 ' + (investPct*100).toFixed(0) + '%。';
- }
- // 2) 财富 / 收入倍数
- if (wealthToIncomeRatio > 0) {
- insight += '<br>📐 <strong>总财富 ' + wealthToIncomeRatio.toFixed(1) + '× 家庭年收入</strong>';
- if (wealthToIncomeRatio < 3) insight += '(早期积累期 · < 3× 是中产典型)';
- else if (wealthToIncomeRatio < 10) insight += '(中产成熟期 · 3-10× 健康范围)';
- else if (wealthToIncomeRatio < 30) insight += '(财富富裕期 · 10-30× 上层中产)';
- else insight += '(HNW / UHNW · ≥ 30× 财富主导收入)';
- }
- // 3) 提示自住房不进 DIM
- if (d.primaryResidence > 0) {
- insight += '<br>💡 <strong>注意</strong>:自住房产 ' + fmtMoney(d.primaryResidence) + ' <strong>不参与</strong>寿险 DIM 公式 A 项扣减(主理人去世后家人仍需居住,不能变现还债)。仅用于总财富画像 + HNW 触发判定。';
- }
- document.getElementById('wpInsight').innerHTML = insight;
- }
- /* === v3.4 · 跳转资产配置中心(带数据预填)===
- 把当前表单的家庭财务 + 三盘资产数据写入 localStorage,跳转 AssetCenter 后由其读取预填
- */
- // 回 ClientProfile · ActionHub(IC 已写总线 clientId+measuredAt → 触发保险板块工具驱动点亮)
- // 直接带 ?tab=actionhub 深链落到 ActionHub Tab(比 navJumpTo 更精准,后者会丢 tab 参数)
- function jumpActionHubIC(){
- var url=(window.CY_PAGES&&window.CY_PAGES.clientprofile)?window.CY_PAGES.clientprofile
- :'承延融合平台v3.6(v3.5方案A通用版·纯Tab无双列+v3.5接通+动态画像渲染)-顾问端ClientProfile.html';
- var sep=url.indexOf('?')>=0?'&':'?';
- location.href=url+sep+'tab=actionhub';
- }
- // 返回:从 ActionHub 进来(?from=actionhub)→ 精确回 ActionHub Tab;否则浏览器返回
- function goBackIC(){
- try {
- if (new URLSearchParams(location.search).get('from') === 'actionhub') { jumpActionHubIC(); return; }
- } catch(e){}
- history.back();
- }
- function jumpToAssetCenter() {
- // [v3.5] 从当前 persona 的 v29_params 取扩展字段(name_en / nationality / residence_city / industry)
- const personaId = sessionStorage.getItem('cy_persona_id');
- const persona = personaId && window.CLIENT_PERSONAS ? window.CLIENT_PERSONAS.find(p => p.id === personaId) : null;
- const v29 = (persona && persona.v29_params) ? persona.v29_params : {};
- // childAges 数组 (从 form 字段读)
- const childCount = parseInt(document.getElementById('childCount').value) || 0;
- const childAges = [];
- for (let i = 1; i <= 3; i++) {
- if (i <= childCount) {
- const v = parseInt(document.getElementById('childAge' + i).value);
- if (!isNaN(v)) childAges.push(v);
- }
- }
- const seed = {
- source: 'InsuranceCalculator',
- sourceVersion: 'v3.5',
- timestamp: Date.now(),
- family: {
- surname: document.getElementById('surname').value || '',
- age: parseInt(document.getElementById('age').value) || 0,
- gender: document.getElementById('gender').value || '',
- marriage: document.getElementById('marriage').value || '',
- childCount: childCount,
- childAges: childAges,
- eduPath: document.getElementById('eduPath').value || '',
- // [v3.5] 扩展字段从 v29_params 带过去(让 ActionHub 能出真实建议)
- surname_en: v29.surname_en || '',
- name_en: v29.name_en || '',
- family_name_en: v29.family_name_en || '',
- nationality: v29.nationality || 'cn',
- residence_city: v29.residence_city || '',
- industry: v29.industry || ''
- },
- finance: {
- salary: parseFloat(document.getElementById('salary').value) || 0,
- spouseSalary: parseFloat(document.getElementById('spouseSalary').value) || 0,
- mortgage: parseFloat(document.getElementById('mortgage').value) || 0,
- otherDebt: parseFloat(document.getElementById('otherDebt').value) || 0
- },
- wealth: {
- liquid: parseFloat(document.getElementById('liquidAssets').value) || 0,
- primaryResidence: (function(){ const el = document.getElementById('primaryResidence'); return el ? (parseFloat(el.value) || 0) : 0; })(),
- investAssets: (function(){ const el = document.getElementById('investAssets'); return el ? (parseFloat(el.value) || 0) : 0; })()
- },
- insurance: {
- ci: parseFloat(document.getElementById('existingCI').value) || 0,
- med: parseInt(document.getElementById('existingMed').value) || 0,
- life: parseFloat(document.getElementById('existingLife').value) || 0,
- wholeLife: parseFloat(document.getElementById('existingWholeLife').value) || 0,
- eduInsurance: parseFloat(document.getElementById('existingEduInsurance').value) || 0,
- retirement: parseFloat(document.getElementById('existingRetirement').value) || 0,
- accident: parseFloat(document.getElementById('existingAccident').value) || 0
- },
- retireAge: parseInt(document.getElementById('retireAge').value) || 60,
- lifeExpectancy: parseInt(document.getElementById('lifeExpectancy').value) || 90
- };
- try {
- localStorage.setItem('cy_asset_center_seed', JSON.stringify(seed));
- showInlineToast('✅ 数据已暂存 · 跳转资产配置中心...');
- } catch(e) {
- console.error('Seed save failed', e);
- }
- // [v3.4 task #1] 走 cy-renderer 集中路由(navJumpTo → CY_PAGES → 硬编码 三层 fallback)
- setTimeout(() => {
- if (typeof navJumpTo === 'function') {
- navJumpTo('assetcenter');
- } else if (window.CY_PAGES && window.CY_PAGES.assetcenter) {
- window.location.href = window.CY_PAGES.assetcenter;
- } else {
- window.location.href = '承延融合平台v3.2(5Tab·演示版·全接通)-顾问端AssetCenter.html';
- }
- }, 500);
- }
- /* === v3.4 · 跳转 LetsSee(带数据预填)=== */
- function jumpToLetsSee() {
- // LetsSee 走 portrait 路径,这里用同一份 seed 当 fallback
- const seed = {
- source: 'InsuranceCalculator',
- sourceVersion: 'v3.4',
- timestamp: Date.now(),
- salary: parseFloat(document.getElementById('salary').value) || 0,
- spouseSalary: parseFloat(document.getElementById('spouseSalary').value) || 0,
- liquid: parseFloat(document.getElementById('liquidAssets').value) || 0,
- primaryResidence: (function(){ const el = document.getElementById('primaryResidence'); return el ? (parseFloat(el.value) || 0) : 0; })(),
- investAssets: (function(){ const el = document.getElementById('investAssets'); return el ? (parseFloat(el.value) || 0) : 0; })(),
- retireAge: parseInt(document.getElementById('retireAge').value) || 60,
- lifeExpectancy: parseInt(document.getElementById('lifeExpectancy').value) || 90
- };
- try {
- localStorage.setItem('cy_letssee_seed', JSON.stringify(seed));
- showInlineToast('✅ 数据已暂存 · 跳转 Let\'s See...');
- } catch(e) {}
- // [v3.4 task #1] 三层 fallback 同 jumpToAssetCenter
- setTimeout(() => {
- if (typeof navJumpTo === 'function') {
- navJumpTo('letssee');
- } else if (window.CY_PAGES && window.CY_PAGES.letssee) {
- window.location.href = window.CY_PAGES.letssee;
- } else {
- window.location.href = '承延融合平台v2.3(+蒙特卡罗置信区间)-顾问端LetsSee.html';
- }
- }, 500);
- }
- /* === [v4.4] 现金流规划 · LDI 视角 · 年保费支出趋势图 === */
- /* === [v4.5] 扩展为"60 年生命周期净现金流"·支出期(Y0-Y30 向上)+ 领取期(Y30-Y60 向下) === */
- /* 设计:Canvas 双向柱状图,7 险种支出向上 + 养老/教育/终身寿返还向下,服务于全周期 LDI 规划 */
- function renderPremiumTimeline(d) {
- // [v4.6] 缓存最近一次 timeline data,供三轨自定义方案 input 修改时无 calculate() 直接重画
- window._cyLastTimelineData = d;
- const canvas = document.getElementById('premiumTimelineCanvas');
- if (!canvas) return;
- const ctx2d = canvas.getContext('2d');
- // ===== [v4.5.2] 方案切换 · 默认建议方案 ('full'),客户主动切到 'affordable' =====
- // [v4.6] 新增 'custom' 方案 · 读 window._cyCustomPremiums(三轨表 C 列实时编辑)
- const scenario = window._cyShowScenario || 'full';
- const isAffordable = scenario === 'affordable';
- const _custom = window._cyCustomPremiums;
- // 自定义方案兜底:三轨表未显示(无缩减)时,custom 等同 full;否则用 _cyCustomPremiums
- const isCustom = scenario === 'custom' && _custom && Object.keys(_custom).length > 0;
- // 选择保费数据源
- const _afford = window._cyAffordablePremiums || {};
- const premiumsForChart = isCustom ? {
- accident: _custom.acc !== undefined ? _custom.acc : (d.accidentPremium||0),
- medical: _custom.med !== undefined ? _custom.med : (d.medPremium||0),
- ci: _custom.ci !== undefined ? _custom.ci : (d.ciPremium||0),
- life: _custom.life!== undefined ? _custom.life: (d.lifePremium||0),
- retire: _custom.retire !== undefined ? _custom.retire : (d.retirePremium||0),
- edu: _custom.edu !== undefined ? _custom.edu : (d.eduPremium||0),
- wl: _custom.wl !== undefined ? _custom.wl : (d.wlPremium||0)
- } : isAffordable ? {
- accident: _afford.acc !== undefined ? _afford.acc : (d.accidentPremium||0),
- medical: _afford.med !== undefined ? _afford.med : (d.medPremium||0),
- ci: _afford.ci !== undefined ? _afford.ci : (d.ciPremium||0),
- life: _afford.life!== undefined ? _afford.life: (d.lifePremium||0),
- retire: _afford.retire !== undefined ? _afford.retire : (d.retirePremium||0),
- edu: _afford.edu !== undefined ? _afford.edu : (d.eduPremium||0),
- wl: _afford.wl !== undefined ? _afford.wl : (d.wlPremium||0)
- } : {
- accident: d.accidentPremium||0,
- medical: d.medPremium||0,
- ci: d.ciPremium||0,
- life: d.lifePremium||0,
- retire: d.retirePremium||0,
- edu: d.eduPremium||0,
- wl: d.wlPremium||0
- };
- // 缩减后保额(用于领取端重算)
- // 保费 = 保额 × 0.025 × 10000(万 → 元)→ 保额 = 保费 / (0.025 × 10000) = 保费 / 250
- const adjustedRetireNeed = (isAffordable || isCustom)
- ? premiumsForChart.retire / 250 // 缩减后养老金保额(万)
- : (d.retireNeed || 0);
- const adjustedEduNeed = (isAffordable || isCustom)
- ? premiumsForChart.edu / 250
- : (d.eduNeed || 0);
- // ===== Step 1: 生成 60 年时间线数据(支出 + 领取) =====
- // [v4.7+] 缴费年限智能化(单一数据源):算法 (calculate() 内) 已根据 yearsToRetire 智能算出
- // ciPayYears / lifePayYears / wlPayYears / retirePayYears,这里直接读 d.* 不再重复计算
- // 银发族 55 岁 + 退休 60 岁 → retire/wl = 5 年缴清,Canvas 流出图与算法完全一致
- const _retireWlYears = (typeof d.wlPayYears === 'number' ? d.wlPayYears : 20);
- const _retirePayYears = (typeof d.retirePayYears === 'number' ? d.retirePayYears : 20);
- const _lifeCiYears = (typeof d.lifePayYears === 'number' ? d.lifePayYears : 30);
- const _ciYears = (typeof d.ciPayYears === 'number' ? d.ciPayYears : 20);
- const PAY_CYCLES = {
- accident: { years: 99, recurring: true, total: premiumsForChart.accident, color: '#9B7C3A', label: '意外险' },
- medical: { years: 99, recurring: true, total: premiumsForChart.medical, color: '#C4973A', label: '高端医疗'},
- ci: { years: _ciYears, recurring: false, total: premiumsForChart.ci, color: '#A61C2B', label: '重疾' },
- life: { years: _lifeCiYears, recurring: false, total: premiumsForChart.life, color: '#7A3FA0', label: '定期寿险'},
- retire: { years: _retirePayYears, recurring: false, total: premiumsForChart.retire, color: '#3D6F8C', label: '养老金' },
- edu: { years: d.eduPayYears || 15, recurring: false, total: premiumsForChart.edu, color: '#5DB890', label: '教育金' },
- wl: { years: _retireWlYears, recurring: false, total: premiumsForChart.wl, color: '#7A5A8E', label: '终身寿险'}
- };
- // [v4.5] 领取期参数(向下柱)· [v4.5.2] 用 adjusted 保额(缩减后)
- const _age = d.age || 35;
- const _retireAge = d.retireAge || 60;
- const yearsToRetire = Math.max(0, _retireAge - _age);
- const retireYears = 30; // 退休后 30 年领取期
- const annualRetireWan = adjustedRetireNeed / retireYears; // [v4.5.2] 缩减后养老金保额
- // 教育返还:逐子女计算 startY-endY · [v4.5.2] eduUnit 按缩减后口径
- const eduIncomeTimeline = {}; // year → wan
- const _adjustedEduUnit = (isAffordable || isCustom) && (d.eduUnit || 0) > 0 && (d.eduNeed || 0) > 0
- ? (d.eduUnit || 0) * (adjustedEduNeed / d.eduNeed) // 按缩减后保额比例缩减单价
- : (d.eduUnit || 0);
- if (d.childAges && d.childAges.length > 0 && _adjustedEduUnit > 0) {
- const annualEduPerChild = _adjustedEduUnit / 4; // 4 年大学,每年 eduUnit/4
- d.childAges.forEach(cAge => {
- const startY = Math.max(0, 18 - cAge);
- const endY = Math.max(0, 22 - cAge);
- for (let y = startY; y < endY; y++) {
- eduIncomeTimeline[y] = (eduIncomeTimeline[y] || 0) + annualEduPerChild;
- }
- });
- }
- const orderedKeys = ['accident','medical','ci','life','retire','edu','wl'];
- const TIMELINE_YEARS = 60; // [v4.5] 30 → 60 年
- const timeline = [];
- for (let y = 0; y < TIMELINE_YEARS; y++) {
- const yearData = { year: y, total: 0, items: {}, incomeTotal: 0, incomeItems: {} };
- // 支出端(向上)
- orderedKeys.forEach(key => {
- const cfg = PAY_CYCLES[key];
- const annualPremium = cfg.total / 10000;
- let amount = 0;
- if (cfg.recurring) amount = annualPremium;
- else if (y < cfg.years) amount = annualPremium;
- yearData.items[key] = amount;
- yearData.total += amount;
- });
- // [v4.5] 领取端(向下)
- // 养老金:Y(yearsToRetire) 到 Y(yearsToRetire + 30)
- if (y >= yearsToRetire && y < yearsToRetire + retireYears && annualRetireWan > 0) {
- yearData.incomeItems.retireIncome = annualRetireWan;
- yearData.incomeTotal += annualRetireWan;
- }
- // 教育金返还
- if (eduIncomeTimeline[y]) {
- yearData.incomeItems.eduIncome = eduIncomeTimeline[y];
- yearData.incomeTotal += eduIncomeTimeline[y];
- }
- timeline.push(yearData);
- }
- // ===== Step 2: 计算关键节点(支出 + 领取双视角) =====
- const peakYears = timeline.slice(0, 15); // Y0-Y15 高峰期
- const midYears = timeline.slice(15, 20); // Y15-Y20 过渡期
- const endYears = timeline.slice(20, 30); // Y20-Y30 尾段
- const retireYearsArr = timeline.slice(yearsToRetire, Math.min(60, yearsToRetire + retireYears)); // 领取期
- const peakAvg = peakYears.reduce((s, y) => s + y.total, 0) / peakYears.length;
- const midAvg = midYears.reduce((s, y) => s + y.total, 0) / midYears.length;
- const endAvg = endYears.reduce((s, y) => s + y.total, 0) / endYears.length;
- const retireIncomeAvg = retireYearsArr.length > 0
- ? retireYearsArr.reduce((s, y) => s + y.incomeTotal, 0) / retireYearsArr.length
- : 0;
- const totalLifetimeOutflow = timeline.reduce((s, y) => s + y.total, 0); // 60 年累计流出
- const totalLifetimeIncome = timeline.reduce((s, y) => s + y.incomeTotal, 0); // 60 年累计流入
- const netCashflow = totalLifetimeIncome - totalLifetimeOutflow;
- // ===== Step 3: Canvas 渲染(双向柱:支出向上 + 收入向下) =====
- const W = canvas.width;
- const H = canvas.height;
- const padLeft = 64, padRight = 24, padTop = 28, padBottom = 64;
- const chartW = W - padLeft - padRight;
- const chartH = H - padTop - padBottom;
- const barGap = 1; // [v4.5] 60 年柱多了,gap 减半
- const barW = (chartW - barGap * (TIMELINE_YEARS - 1)) / TIMELINE_YEARS;
- // 找最大值确定 Y 轴(支出 + 领取双向)
- const maxOutflow = Math.max(...timeline.map(y => y.total));
- const maxIncome = Math.max(...timeline.map(y => y.incomeTotal));
- // [v4.4.5] 红线 = 实际可负担方案保费(双轨 B 列, affordableTotalYuan)而非理论上限
- // 理论上限 = salary/AUM × cap% (计算用,但不画在 Canvas 上,避免与双轨 B 列冲突)
- const affordableLineWan = (typeof d.affordableTotalYuan === 'number' && d.affordableTotalYuan > 0)
- ? (d.affordableTotalYuan / 10000)
- : ((d.affordableCap && d.denominatorYuan) ? (d.affordableCap * d.denominatorYuan / 10000) : 0);
- const _theoreticalCapWan = (d.affordableCap && d.denominatorYuan)
- ? (d.affordableCap * d.denominatorYuan / 10000)
- : 0;
- // [v4.5] Y 轴双向 · 上半 = 支出 (peak max),下半 = 领取 (income max)
- const yMaxOut = Math.ceil(Math.max(maxOutflow, affordableLineWan * 1.05) * 1.1 / 50) * 50 || 50;
- const yMaxIn = Math.ceil(maxIncome * 1.1 / 50) * 50 || 50;
- // 上下区域比例 · 默认 60%(支出)/ 40%(领取),按数据自适应
- const totalRange = yMaxOut + yMaxIn;
- const outAreaRatio = totalRange > 0 ? yMaxOut / totalRange : 0.6;
- const outAreaH = chartH * outAreaRatio;
- const inAreaH = chartH - outAreaH;
- const baselineY = padTop + outAreaH; // 0 轴位置(支出向上 / 领取向下)
- // 清空 Canvas
- ctx2d.fillStyle = '#FFFFFF';
- ctx2d.fillRect(0, 0, W, H);
- // 绘制 Y 轴网格 + 标签(双向 · 支出向上,领取向下)
- ctx2d.strokeStyle = '#E8DFC8';
- ctx2d.lineWidth = 1;
- ctx2d.font = '10.5px Inter, sans-serif';
- ctx2d.fillStyle = '#7A6028';
- ctx2d.textAlign = 'right';
- ctx2d.textBaseline = 'middle';
- // 上半区(支出, 0 → yMaxOut)
- const yTicksOut = 4;
- for (let i = 0; i <= yTicksOut; i++) {
- const v = (yMaxOut / yTicksOut) * i;
- const y = baselineY - (outAreaH / yTicksOut) * i;
- ctx2d.beginPath();
- ctx2d.moveTo(padLeft, y);
- ctx2d.lineTo(W - padRight, y);
- ctx2d.stroke();
- ctx2d.fillText('¥' + v.toFixed(0) + '万', padLeft - 8, y);
- }
- // 下半区(领取, 0 → -yMaxIn) · 标签为正数前加 -
- const yTicksIn = 3;
- for (let i = 1; i <= yTicksIn; i++) {
- const v = (yMaxIn / yTicksIn) * i;
- const y = baselineY + (inAreaH / yTicksIn) * i;
- ctx2d.beginPath();
- ctx2d.moveTo(padLeft, y);
- ctx2d.lineTo(W - padRight, y);
- ctx2d.stroke();
- ctx2d.fillStyle = '#2DB37C'; // 领取用绿色标签
- ctx2d.fillText('+¥' + v.toFixed(0) + '万', padLeft - 8, y);
- ctx2d.fillStyle = '#7A6028';
- }
- // 0 基线(加粗)
- ctx2d.strokeStyle = '#3D2914';
- ctx2d.lineWidth = 1.5;
- ctx2d.beginPath();
- ctx2d.moveTo(padLeft, baselineY);
- ctx2d.lineTo(W - padRight, baselineY);
- ctx2d.stroke();
- ctx2d.lineWidth = 1;
- // 绘制 X 轴标签(每 10 年一个 · v4.5 60 年时间线 + 投保人年龄)
- ctx2d.textAlign = 'center';
- ctx2d.textBaseline = 'top';
- const baseAge = d.age || 0;
- for (let y = 0; y < TIMELINE_YEARS; y += 10) {
- const x = padLeft + (barW + barGap) * y + barW / 2;
- // 上行:Y0/Y10/Y20... (主标签)
- ctx2d.fillStyle = '#5C4810';
- ctx2d.font = 'bold 10.5px Inter, sans-serif';
- ctx2d.fillText('Y' + y, x, padTop + chartH + 6);
- // 下行:35/45/55/65/75/85/95 岁 (年龄标签)
- if (baseAge > 0) {
- ctx2d.fillStyle = '#7A6028';
- ctx2d.font = '10px Inter, sans-serif';
- ctx2d.fillText((baseAge + y) + ' 岁', x, padTop + chartH + 22);
- }
- }
- // 退休点垂直分割线(虚线)
- if (yearsToRetire > 0 && yearsToRetire < TIMELINE_YEARS) {
- const xRetire = padLeft + (barW + barGap) * yearsToRetire;
- ctx2d.save();
- ctx2d.strokeStyle = '#9B7C3A';
- ctx2d.lineWidth = 1.5;
- ctx2d.setLineDash([4, 3]);
- ctx2d.beginPath();
- ctx2d.moveTo(xRetire, padTop);
- ctx2d.lineTo(xRetire, padTop + chartH);
- ctx2d.stroke();
- ctx2d.restore();
- ctx2d.fillStyle = '#9B7C3A';
- ctx2d.font = 'bold 10.5px Inter, sans-serif';
- ctx2d.textAlign = 'left';
- ctx2d.textBaseline = 'top';
- ctx2d.fillText('🏖 退休 ' + (baseAge + yearsToRetire) + '岁', xRetire + 4, padTop + 4);
- }
- // X 轴底标签(向下挪以避让年龄标签)
- ctx2d.font = '10.5px Inter, sans-serif';
- ctx2d.fillStyle = '#7A6028';
- ctx2d.textAlign = 'center';
- ctx2d.fillText('60 年生命周期 · Y0 = 当前 / 投保人年龄', W / 2, padTop + chartH + 38);
- // 绘制堆叠柱(双向 · 支出向上 + 领取向下)
- const barRects = []; // 用于 hit-test tooltip
- timeline.forEach((yearData, idx) => {
- const x = padLeft + (barW + barGap) * idx;
- // ↑ 支出柱(向上堆叠)
- let yCursorOut = baselineY;
- orderedKeys.forEach(key => {
- const cfg = PAY_CYCLES[key];
- const v = yearData.items[key];
- if (v <= 0) return;
- const segH = yMaxOut > 0 ? (v / yMaxOut) * outAreaH : 0;
- yCursorOut -= segH;
- ctx2d.fillStyle = cfg.color;
- ctx2d.fillRect(x, yCursorOut, barW, segH);
- });
- // ↓ 领取柱(向下堆叠)
- let yCursorIn = baselineY;
- if (yearData.incomeItems.retireIncome) {
- const v = yearData.incomeItems.retireIncome;
- const segH = yMaxIn > 0 ? (v / yMaxIn) * inAreaH : 0;
- ctx2d.fillStyle = '#2DB37C'; // 养老月领 · 绿色
- ctx2d.fillRect(x, yCursorIn, barW, segH);
- yCursorIn += segH;
- }
- if (yearData.incomeItems.eduIncome) {
- const v = yearData.incomeItems.eduIncome;
- const segH = yMaxIn > 0 ? (v / yMaxIn) * inAreaH : 0;
- ctx2d.fillStyle = '#5DB890'; // 教育金返还 · 浅绿色(稍亮区分)
- ctx2d.fillRect(x, yCursorIn, barW, segH);
- yCursorIn += segH;
- }
- // 记录柱坐标(用于 tooltip · 含支出 + 领取)
- const totalHOut = yMaxOut > 0 ? (yearData.total / yMaxOut) * outAreaH : 0;
- const totalHIn = yMaxIn > 0 ? (yearData.incomeTotal / yMaxIn) * inAreaH : 0;
- barRects.push({
- x: x, y: baselineY - totalHOut, w: barW,
- h: totalHOut + totalHIn,
- yearData: yearData
- });
- });
- // 顶部标题
- ctx2d.font = 'bold 11px Inter, sans-serif';
- ctx2d.fillStyle = '#1A0F05';
- ctx2d.textAlign = 'left';
- ctx2d.textBaseline = 'top';
- ctx2d.fillText('↑ 流出(年保费) · ¥万', padLeft, 8);
- ctx2d.fillStyle = '#2DB37C';
- ctx2d.textAlign = 'right';
- ctx2d.fillText('↓ 流入(养老月领 + 教育返还) · ¥万', W - padRight, 8);
- // [v4.4.5] 可负担方案警戒线(红色虚线 · 只画在支出区,baseline 上方)
- if (affordableLineWan > 0 && affordableLineWan < yMaxOut) {
- const lineY = baselineY - (affordableLineWan / yMaxOut) * outAreaH;
- ctx2d.save();
- ctx2d.strokeStyle = '#E87070';
- ctx2d.lineWidth = 2;
- ctx2d.setLineDash([6, 4]);
- ctx2d.beginPath();
- ctx2d.moveTo(padLeft, lineY);
- ctx2d.lineTo(W - padRight, lineY);
- ctx2d.stroke();
- ctx2d.restore();
- // 标签 — 与双轨 B 列对齐
- ctx2d.fillStyle = '#E87070';
- ctx2d.font = 'bold 10.5px Inter, sans-serif';
- ctx2d.textAlign = 'right';
- ctx2d.textBaseline = 'bottom';
- ctx2d.fillText('⚠ 可负担方案 ¥' + affordableLineWan.toFixed(1) + '万/年(= 三轨 B 列)', W - padRight - 4, lineY - 2);
- }
- // [v4.6] 自定义方案警戒线(蓝色虚线 · 只画在支出区 · 仅当三轨表展示时画 · 与可负担方案差 > 0.5 万时才画,避免重叠)
- const customLineYuan = (typeof window._cyCustomTotalYuan === 'number') ? window._cyCustomTotalYuan : 0;
- const customLineWan = customLineYuan / 10000;
- const triVisible = (function(){
- const el = document.getElementById('affDualTrack');
- return el && el.style.display !== 'none';
- })();
- if (triVisible && customLineWan > 0 && customLineWan < yMaxOut &&
- Math.abs(customLineWan - affordableLineWan) > 0.5) {
- const lineY2 = baselineY - (customLineWan / yMaxOut) * outAreaH;
- ctx2d.save();
- ctx2d.strokeStyle = '#2B6CB0';
- ctx2d.lineWidth = 2;
- ctx2d.setLineDash([8, 3, 2, 3]); // 虚线段更密 + 不同间距,与可负担方案区分
- ctx2d.beginPath();
- ctx2d.moveTo(padLeft, lineY2);
- ctx2d.lineTo(W - padRight, lineY2);
- ctx2d.stroke();
- ctx2d.restore();
- // 标签放左侧避让可负担方案标签
- ctx2d.fillStyle = '#2B6CB0';
- ctx2d.font = 'bold 10.5px Inter, sans-serif';
- ctx2d.textAlign = 'left';
- ctx2d.textBaseline = customLineWan > affordableLineWan ? 'bottom' : 'top';
- const labelOffsetY = customLineWan > affordableLineWan ? -2 : 2;
- ctx2d.fillText('🔵 自定义方案 ¥' + customLineWan.toFixed(1) + '万/年(= 三轨 C 列)', padLeft + 4, lineY2 + labelOffsetY);
- }
- // ===== Step 4: 鼠标交互 tooltip =====
- const tooltip = document.getElementById('cfTooltip');
- // 移除旧监听器
- if (canvas._mmHandler) canvas.removeEventListener('mousemove', canvas._mmHandler);
- if (canvas._mlHandler) canvas.removeEventListener('mouseleave', canvas._mlHandler);
- canvas._mmHandler = function(e) {
- const rect = canvas.getBoundingClientRect();
- const mx = (e.clientX - rect.left) * (canvas.width / rect.width);
- const my = (e.clientY - rect.top) * (canvas.height / rect.height);
- let hit = null;
- for (let i = 0; i < barRects.length; i++) {
- const b = barRects[i];
- // 放宽命中区域到整个柱位置(包括空白)
- if (mx >= b.x && mx <= b.x + b.w) {
- hit = b;
- break;
- }
- }
- if (hit) {
- const yd = hit.yearData;
- const _baseAge = baseAge || 0;
- const netY = yd.incomeTotal - yd.total;
- const netSign = netY >= 0 ? '+' : '';
- let html = '<strong>Y' + yd.year + (_baseAge ? ' · ' + (_baseAge + yd.year) + ' 岁' : '') + '</strong>';
- // 流出明细
- if (yd.total > 0) {
- html += '<div class="tooltip-row" style="margin-top:6px;color:#FFB8B0"><span><strong>↑ 流出 ¥' + yd.total.toFixed(2) + '万</strong></span></div>';
- orderedKeys.forEach(key => {
- if (yd.items[key] > 0) {
- html += '<div class="tooltip-row"><span><span class="tooltip-dot" style="background:' + PAY_CYCLES[key].color + '"></span>' + PAY_CYCLES[key].label + '</span><span>¥' + yd.items[key].toFixed(2) + '万</span></div>';
- }
- });
- }
- // 流入明细
- if (yd.incomeTotal > 0) {
- html += '<div class="tooltip-row" style="margin-top:6px;color:#90E0B0"><span><strong>↓ 流入 ¥' + yd.incomeTotal.toFixed(2) + '万</strong></span></div>';
- if (yd.incomeItems.retireIncome) {
- html += '<div class="tooltip-row"><span><span class="tooltip-dot" style="background:#2DB37C"></span>养老月领</span><span>+¥' + yd.incomeItems.retireIncome.toFixed(2) + '万</span></div>';
- }
- if (yd.incomeItems.eduIncome) {
- html += '<div class="tooltip-row"><span><span class="tooltip-dot" style="background:#5DB890"></span>教育金返还</span><span>+¥' + yd.incomeItems.eduIncome.toFixed(2) + '万</span></div>';
- }
- }
- // 净现金流
- html += '<div class="tooltip-row" style="margin-top:6px;border-top:1px solid rgba(196,151,58,.3);padding-top:4px"><span><strong>净流入</strong></span><span style="color:' + (netY >= 0 ? '#90E0B0' : '#FFB8B0') + '"><strong>' + netSign + '¥' + netY.toFixed(2) + '万</strong></span></div>';
- tooltip.innerHTML = html;
- tooltip.style.display = 'block';
- tooltip.style.left = (e.clientX - rect.left + 12) + 'px';
- tooltip.style.top = (e.clientY - rect.top - 10) + 'px';
- } else {
- tooltip.style.display = 'none';
- }
- };
- canvas._mlHandler = function() { tooltip.style.display = 'none'; };
- canvas.addEventListener('mousemove', canvas._mmHandler);
- canvas.addEventListener('mouseleave', canvas._mlHandler);
- // ===== Step 5: 关键节点说明 + LDI 建议(v4.5 60 年生命周期视角) =====
- // [v4.5.1] 同步刷新风险对冲覆盖 KPI 卡片
- const _onetimeCoverageWan = (d.totalOnetimeCoverage || 0);
- const rhkEl = document.getElementById('rhkTotalCoverage');
- if (rhkEl) {
- rhkEl.textContent = _onetimeCoverageWan >= 10000
- ? '¥' + (_onetimeCoverageWan / 10000).toFixed(2) + '亿'
- : '¥' + Math.round(_onetimeCoverageWan) + '万';
- }
- const rhkFooterEl = document.getElementById('rhkFooter');
- if (rhkFooterEl) {
- const aumWan = d.totalAumForWL || 0;
- const coverPct = aumWan > 0 ? (_onetimeCoverageWan / aumWan * 100).toFixed(0) : '—';
- rhkFooterEl.innerHTML =
- '💡 这是 Canvas 图表 <strong>外的隐性流入</strong> · 一旦出险,保险公司一次性赔付 <strong>¥' +
- (_onetimeCoverageWan >= 10000 ? (_onetimeCoverageWan/10000).toFixed(2) + '亿' : Math.round(_onetimeCoverageWan) + '万') +
- '</strong>(占总财富 ' + coverPct + '%) · 杠杆对冲 + 现金价值 + 跨代传承 + 税务隔离 + 紧急救援(详见 ⓘ 5 视角)';
- }
- // [v4.5.2] 杠杆比指标 · 仅可负担方案 / 自定义方案下显示
- // [v4.6] 自定义方案也显示杠杆比 · 用 _cyCustomTotalYuan
- const rhkLevEl = document.getElementById('rhkLeverage');
- if (rhkLevEl) {
- if (isAffordable || isCustom) {
- // 当前方案 20 年累计总保费(元) · [v4.7] 杠杆比也用纯保障型口径(剔除养老/教育/终身寿储蓄)
- const _baseTotalYuan = isCustom
- ? (window._cyCustomTotalYuan || 0)
- : (window._cyAffordableTotalYuan || 0);
- // [v4.7] 提取该方案下的纯保障型保费(acc + med + ci + life),与上方 leverageV4 同一口径
- const _premsForScenario = isCustom
- ? (window._cyCustomPremiums || window._cyAffordablePremiums || {})
- : (window._cyAffordablePremiums || {});
- const _protectionAnnualWan = ((_premsForScenario.acc || 0) + (_premsForScenario.med || 0) +
- (_premsForScenario.ci || 0) + (_premsForScenario.life || 0)) / 10000;
- const _protectionTotal20yWan = _protectionAnnualWan * 20;
- const total20yPremiumYuan = _baseTotalYuan * 20;
- const total20yPremiumWan = total20yPremiumYuan / 10000;
- // [v4.7] 杠杆口径修正:用纯保障型保费,而非 7 险种全合计
- const leverageRatio = _protectionTotal20yWan > 0
- ? (_onetimeCoverageWan / _protectionTotal20yWan).toFixed(1)
- : '—';
- const _scnLabel = isCustom ? '自定义方案' : '可负担方案';
- const ratioEl = document.getElementById('rhkLeverageRatio');
- const descEl = document.getElementById('rhkLeverageDesc');
- if (ratioEl) ratioEl.textContent = leverageRatio;
- if (descEl) {
- descEl.innerHTML = '客户用 <strong>¥' + Math.round(_protectionTotal20yWan) + ' 万</strong>(20 年纯保障型' + _scnLabel + '保费 · 剔除储蓄)换 <strong>¥' +
- (_onetimeCoverageWan >= 10000 ? (_onetimeCoverageWan/10000).toFixed(2) + '亿' : Math.round(_onetimeCoverageWan) + '万') +
- '</strong> 风险保障 · <strong>每 1 元保费换 ' + leverageRatio + ' 元保障</strong>' +
- '<br><span style="font-size:10.5px;color:#7A6028">📌 v4.7 口径修正:杠杆比仅算保障型保费(意外/医疗/重疾/定寿),不计养老/教育/终身寿(储蓄性质,不属"杠杆"范畴)</span>';
- }
- rhkLevEl.style.display = 'flex';
- } else {
- rhkLevEl.style.display = 'none';
- }
- }
- // [v4.5.2] 更新切换器副文案(年缴金额) · [v4.6] 加自定义方案副文案
- const _scnFullYuan = ((d.accidentPremium||0) + (d.medPremium||0) + (d.ciPremium||0) + (d.lifePremium||0) + (d.retirePremium||0) + (d.eduPremium||0) + (d.wlPremium||0));
- const _scnAfford = window._cyAffordableTotalYuan || _scnFullYuan;
- const _scnCustomYuan = (typeof window._cyCustomTotalYuan === 'number') ? window._cyCustomTotalYuan : _scnAfford;
- const scnFullEl = document.getElementById('scnFullDetail');
- const scnAffordEl = document.getElementById('scnAffordableDetail');
- const scnCustomEl = document.getElementById('scnCustomDetail');
- if (scnFullEl) scnFullEl.textContent = '完整需求 · 年缴 ¥' + (_scnFullYuan/10000).toFixed(1) + '万';
- if (scnAffordEl) scnAffordEl.textContent = '系统缩减 · 年缴 ¥' + (_scnAfford/10000).toFixed(1) + '万';
- if (scnCustomEl) {
- if (window._cyCustomPremiums && Object.keys(window._cyCustomPremiums).length > 0) {
- scnCustomEl.textContent = '代理人编辑 · 年缴 ¥' + (_scnCustomYuan/10000).toFixed(1) + '万';
- } else {
- scnCustomEl.textContent = '等同完整需求 · 无需缩减';
- }
- }
- // 切换器 hint
- const hintEl = document.getElementById('cfScenarioHint');
- if (hintEl) {
- if (isCustom) {
- hintEl.innerHTML = '🔵 当前展示「自定义方案」· 直接读取三轨表 C 列实时编辑值 · Canvas 同步反映<strong>代理人微调后</strong>的现金流';
- } else if (isAffordable) {
- hintEl.innerHTML = '✓ 当前展示「可负担方案」· 系统已按客户支付能力缩减养老/教育/终身寿,Canvas 反映<strong>真实未来现金流</strong>';
- } else {
- hintEl.innerHTML = '💡 当前展示「建议方案」· 完整需求口径,养老/教育按完整 retireNeed/eduNeed 计算 · 切换可负担/自定义方案查看真实可承受版本';
- }
- }
- const insightsEl = document.getElementById('cfInsights');
- if (insightsEl) {
- const overflowYears = timeline.filter(y => affordableLineWan > 0 && y.total > affordableLineWan).length;
- const overflowNote = overflowYears > 0 && affordableLineWan > 0
- ? `<br><span style="color:#A61C2B;font-weight:600">⚠ 共 ${overflowYears}/30 年超出三轨 B 列</span>`
- : '';
- const retireStartAge = (d.age || 0) + yearsToRetire;
- insightsEl.innerHTML =
- '<div class="cf-insight cf-insight-peak"><strong>↑ 流出 · Y0-Y15</strong> 年均保费 ¥' + peakAvg.toFixed(0) + '万 · 高峰期需短久期债券匹配' + overflowNote + '</div>' +
- '<div class="cf-insight cf-insight-mid"><strong>↑ 流出 · Y20-Y30</strong> 年均保费 ¥' + endAvg.toFixed(0) + '万 · 储蓄型缴清,只剩续保险种</div>' +
- '<div class="cf-insight cf-insight-end" style="background:rgba(45,179,124,.10);border-left-color:#2DB37C;color:#1F4D2F"><strong>↓ 流入 · Y' + yearsToRetire + '+</strong>(' + retireStartAge + ' 岁退休后)养老月领 ¥' + retireIncomeAvg.toFixed(1) + '万/年 · 持续 30 年</div>';
- }
- // LDI 资产匹配建议(动态文案 · v4.5 加 60 年净现金流)
- const ldiEl = document.getElementById('ldiSuggestion');
- if (ldiEl) {
- const totalY15 = peakYears.reduce((s, y) => s + y.total, 0);
- const aumWan = d.totalAumForWL || 0;
- const aumPctY15 = aumWan > 0 ? (totalY15 / aumWan * 100).toFixed(1) : '0';
- const overflowYears = timeline.filter(y => affordableLineWan > 0 && y.total > affordableLineWan).length;
- let affordableNote = '';
- if (affordableLineWan > 0) {
- if (overflowYears > 0) {
- affordableNote = '<br><strong style="color:#A61C2B">⚠ 可负担方案对比</strong>:建议方案在 ' + overflowYears + ' 年超出三轨 B 列 ¥' + affordableLineWan.toFixed(1) + '万/年。代理人应与客户讨论缩减储蓄型 / 延长缴费期 / 推迟部分险种到 Y15+ 配置。';
- } else {
- affordableNote = '<br><strong style="color:#2DB37C">✓ 全周期可负担</strong>:30 年内年缴均未超出三轨 B 列 ¥' + affordableLineWan.toFixed(1) + '万/年。';
- }
- }
- // [v4.5] 60 年净现金流总结
- const lifetimeSummary = '<br><strong style="color:#7A5A8E">📊 60 年生命周期净现金流</strong>:累计流出 ¥' + totalLifetimeOutflow.toFixed(0) + '万(保费投入)/ 累计流入 ¥' + totalLifetimeIncome.toFixed(0) + '万(养老 + 教育返还)' +
- ' / <strong>净 ' + (netCashflow >= 0 ? '+' : '') + '¥' + netCashflow.toFixed(0) + '万</strong> ' +
- (netCashflow >= 0
- ? '<span style="color:#2DB37C">(资产增值,保险既保障也是长期储蓄工具)</span>'
- : '<span style="color:#7A6028">(净支出,保险价值在风险对冲 + 现金价值积累 + 身故金跨代传承,不能单看流入流出账面差额)</span>');
- ldiEl.innerHTML =
- '<strong>💡 LDI 视角投资建议</strong> · ' +
- 'Y0-Y15 期间(高峰期)累计保费支出约 <strong>¥' + totalY15.toFixed(0) + '万</strong>(占总财富 ' + aumPctY15 + '%)。' +
- '建议配置等额的<strong>短久期债券</strong>(1-5 年期国债 + 货币基金)用于覆盖年保费支出。<br>' +
- 'Y15+ 之后流动性需求降低,可逐步增配长期增值资产(股票 / 私募 / PE)。' +
- 'Y' + yearsToRetire + '+ 退休后,养老月领进入流入期 → 资产配置转向"保守 + 稳定收益"匹配生活支出。' +
- affordableNote +
- lifetimeSummary +
- '<div style="margin-top:10px"><button class="info-pill" onclick="toggleInfoPopover(\'ldi-disclaimer\')"><span class="info-icon">ⓘ</span><span class="info-label">LDI 框架适用范围</span></button></div>';
- }
- // [v4.4.2] LDI 通用 disclaimer popover · 在 DOM 中只创建一次
- if (ldiEl && !document.getElementById('info-ldi-disclaimer')) {
- const overlay = document.createElement('div');
- overlay.className = 'info-popover-overlay';
- overlay.id = 'info-ldi-disclaimer';
- overlay.innerHTML =
- '<div class="info-popover" onclick="event.stopPropagation()">' +
- '<div class="info-popover-head">' +
- '<span class="info-pop-icon">💡</span>' +
- '<span>LDI 框架适用范围</span>' +
- '<button class="info-popover-close" onclick="toggleInfoPopover(\'ldi-disclaimer\')">×</button>' +
- '</div>' +
- '<div class="info-popover-body">' +
- '<p>本工具的 LDI(Liability Driven Investment · 负债驱动投资)框架是<strong>通用配置基线</strong>,主要适用于:</p>' +
- '<ul>' +
- '<li>主理人 35-55 岁,salary 100-1000 万 中端 HNW / 跨境美籍家庭</li>' +
- '<li>资产以流动金融 + 自住房产 + 公募基金 + 港美股为主</li>' +
- '<li>有 1-2 子女教育规划 + 退休规划需求</li>' +
- '</ul>' +
- '<div class="info-row info-row-warn">' +
- '<strong>不适用场景</strong>:UHNW(≥¥10 亿 AUM)/ 极特殊行业(矿产/建筑/演艺等收入波动大)/ 复杂跨境家族架构(多本护照/多代际信托)。' +
- '</div>' +
- '<p><strong>具体方案</strong>需 1v1 顾问根据客户风险承受度 + 流动性偏好 + 跨境合规需求定制。Benchmark 后续版本将加 UI 输入字段(身份/US-situs 比例/家族信托结构)实现精细化测算。</p>' +
- '</div>' +
- '</div>';
- document.body.appendChild(overlay);
- }
- }
- function renderAffordabilityCheck(d) {
- // [v2.9] 决定分母:HNW 用 AUM,普通家庭用工资
- // [v4.7] 引入"中端档"分母公式 — totalWealth ∈ [2000 万, 5000 万) 走 max(salary × cap, AUM × 1%)
- // 解决"高储蓄低工资"客户(如银发族 准退休 / 国企退休 G1)被 salary cap 强制卡死的问题
- const isHNW = d.isHNW;
- const familyIncomeWan = d.salary + d.spouseSalary; // 万
- const aumWan = d.portraitAum > 0 ? d.portraitAum : (d.totalWealth > 0 ? d.totalWealth : (d.liquidAssets * 5)); // 万,优先 portrait → totalWealth(v3.4) → liquid×5 (legacy fallback)
- // [v4.7] 三档分母逻辑
- const HNW_CAP_MAP = {0.10:0.005, 0.15:0.01, 0.20:0.02, 0.30:0.03, 1.00:1.00};
- const totalWealthForTier = d.totalWealth || 0; // 万
- let denominatorWan, cap, tier, tierLabel, tierSub;
- if (isHNW) {
- tier = 'hnw';
- tierLabel = '🏛 HNW 模式 · 总 AUM(支付能力分母)';
- tierSub = d.portraitAum > 0 ? '总 AUM(画像实读)' : 'AUM 估算 = 流动资产 × 5';
- denominatorWan = aumWan;
- cap = HNW_CAP_MAP[d.affordabilityCap] !== undefined ? HNW_CAP_MAP[d.affordabilityCap] : (d.affordabilityCap * 0.1);
- } else if (totalWealthForTier >= 2000 && totalWealthForTier < 5000) {
- // [v4.7] 中端档:高储蓄低工资客户(如银发族),分母用 max(salary × cap, AUM × 1%)
- tier = 'mid';
- const incomeBudgetYuan = familyIncomeWan * d.affordabilityCap * 10000; // salary 路径年缴上限
- const aumBudgetYuan = aumWan * 0.01 * 10000; // AUM × 1% 路径年缴上限
- if (aumBudgetYuan > incomeBudgetYuan) {
- // AUM 路径更宽松 → 用 AUM × 1%
- tierLabel = '🟦 中端档 · AUM × 1%(高储蓄低工资优化)';
- tierSub = `工资 ¥${familyIncomeWan}万 × ${(d.affordabilityCap*100).toFixed(0)}% = ¥${(incomeBudgetYuan/10000).toFixed(1)}万 < AUM ¥${aumWan.toFixed(0)}万 × 1% = ¥${(aumBudgetYuan/10000).toFixed(1)}万 · 取更宽口径`;
- denominatorWan = aumWan;
- cap = 0.01;
- } else {
- // salary 路径更宽松 → 沿用 salary
- tierLabel = '🟩 中端档 · 工资口径';
- tierSub = `工资 ¥${familyIncomeWan}万 × ${(d.affordabilityCap*100).toFixed(0)}% > AUM × 1% · 取更宽口径`;
- denominatorWan = familyIncomeWan;
- cap = d.affordabilityCap;
- }
- } else {
- // 普通家庭 totalWealth < 2000 万
- tier = 'normal';
- tierLabel = '家庭年收入(支付能力分母)';
- tierSub = `主理人 ¥${d.salary}万 + 配偶 ¥${d.spouseSalary}万`;
- denominatorWan = familyIncomeWan;
- cap = d.affordabilityCap;
- }
- const denominatorYuan = denominatorWan * 10000;
- const fullPremium = d.totalPremium; // 元
- const premiumRatio = denominatorYuan > 0 ? fullPremium / denominatorYuan : 0;
- const coverageMultiple = denominatorWan > 0 ? d.totalCoverage / denominatorWan : 0;
- // 顶部 4 卡片
- const labelEl = document.getElementById('affFamilyIncomeLabel');
- if (tier === 'hnw') {
- if (labelEl) labelEl.textContent = '家庭 AUM(支付能力分母)';
- document.getElementById('affFamilyIncome').textContent = '¥' + (aumWan >= 10000 ? (aumWan/10000).toFixed(2) + '亿' : aumWan.toFixed(0) + '万');
- document.getElementById('affFamilyIncomeSub').textContent = tierSub;
- } else if (tier === 'mid') {
- if (labelEl) labelEl.textContent = tierLabel;
- document.getElementById('affFamilyIncome').textContent = '¥' + (denominatorWan >= 10000 ? (denominatorWan/10000).toFixed(2) + '亿' : denominatorWan.toFixed(0) + '万');
- document.getElementById('affFamilyIncomeSub').textContent = tierSub;
- } else {
- if (labelEl) labelEl.textContent = '家庭年收入';
- document.getElementById('affFamilyIncome').textContent = '¥' + familyIncomeWan.toFixed(0) + '万';
- document.getElementById('affFamilyIncomeSub').textContent = tierSub;
- }
- document.getElementById('affFullPremium').textContent = '¥' + (fullPremium/10000).toFixed(1) + '万';
- document.getElementById('affFullPremiumSub').textContent = '7 险种缺口理论值';
- document.getElementById('affPremiumRatio').textContent = (premiumRatio*100).toFixed((tier==='hnw'||tier==='mid')?2:0) + '%';
- // 颜色 + 副文案(HNW / 中端档 用 AUM 标准 1-3%,普通家庭用 10-20%)
- // [v4.7] 中端档复用 HNW 的 1-3% 区间(因为分母也是 AUM 口径)
- let ratioColor, ratioStatus;
- if (tier === 'hnw' || (tier === 'mid' && cap === 0.01)) {
- if (premiumRatio <= 0.01) { ratioColor = '#2DB37C'; ratioStatus = '✓ 占 AUM ≤ 1% · ' + (tier==='hnw'?'HNW ':'中端档 ') + '健康区间'; }
- else if (premiumRatio <= 0.03) { ratioColor = '#E89B3D'; ratioStatus = '⚠ 占 AUM 1-3% · ' + (tier==='hnw'?'HNW ':'中端档 ') + '警示区(行业 1-3%)'; }
- else { ratioColor = '#A61C2B'; ratioStatus = '🔴 占 AUM > 3% · 超出行业惯例'; }
- } else {
- if (premiumRatio <= 0.20) { ratioColor = '#2DB37C'; ratioStatus = '✓ 处于行业建议区间'; }
- else if (premiumRatio <= 0.30) { ratioColor = '#E89B3D'; ratioStatus = '⚠ 略高于行业建议(10-20%)'; }
- else { ratioColor = '#A61C2B'; ratioStatus = '🔴 严重超出可负担范围'; }
- }
- document.getElementById('affPremiumRatio').style.color = ratioColor;
- document.getElementById('affPremiumRatioSub').textContent = ratioStatus;
- // [v2.9] 教育金分级 floor
- const EDU_FLOOR_MAP = {
- 'elite_us': 0.70, // 美高+美本+美研:最低保留 70%(签证 + 时间窗口最紧)
- 'full_overseas': 0.70, // 全程英美:最低保留 70%
- 'domestic_plus': 0.50, // 国内 + 海外硕士:50%
- 'domestic': 0.30 // 纯国内:可缩到 30%
- };
- const eduFloorRatio = EDU_FLOOR_MAP[d.eduPath] !== undefined ? EDU_FLOOR_MAP[d.eduPath] : 0.50;
- // 双轨缩减计算(v3.1 · 7 险种:rigid 含意外/医疗/重疾/定寿,savings 含养老/教育/终身寿)
- const rigid = (d.premiums.acc || 0) + d.premiums.med + d.premiums.ci + d.premiums.life;
- const savings = d.premiums.retire + d.premiums.edu + (d.premiums.wl || 0);
- const cappedTotal = denominatorYuan * cap; // 元
- let recRetire = d.premiums.retire, recEdu = d.premiums.edu, recWl = (d.premiums.wl || 0);
- let scalingFactor = 1, isOverflow = false, eduFloorTriggered = false;
- if (cap >= 1) {
- // 不设上限模式
- } else if (rigid >= cappedTotal) {
- // 极端:连刚需都超过上限
- recRetire = 0; recEdu = 0; recWl = 0; scalingFactor = 0; isOverflow = true;
- } else if (rigid + savings > cappedTotal) {
- // 储蓄型按比例缩减(v3.1 · 终身寿险也按比例缩)
- const budgetForSavings = cappedTotal - rigid;
- scalingFactor = savings > 0 ? budgetForSavings / savings : 0;
- recRetire = d.premiums.retire * scalingFactor;
- recEdu = d.premiums.edu * scalingFactor;
- recWl = (d.premiums.wl || 0) * scalingFactor;
- // [v2.9] 教育金 floor 保护:如果缩减后教育金 < floor,抬到 floor,差额从养老金扣
- const eduFloorPremium = d.premiums.edu * eduFloorRatio;
- if (d.childAges && d.childAges.length > 0 && recEdu < eduFloorPremium) {
- const topup = eduFloorPremium - recEdu;
- recEdu = eduFloorPremium;
- recRetire = Math.max(0, recRetire - topup);
- eduFloorTriggered = true;
- }
- }
- const affordableTotal = (d.premiums.acc || 0) + d.premiums.med + d.premiums.ci + d.premiums.life + recRetire + recEdu + recWl;
- // [v4.4.5] 暴露给 renderPremiumTimeline,确保 Canvas 红线与双轨 B 列完全一致
- window._cyAffordableTotalYuan = affordableTotal;
- window._cyIsOverflow = isOverflow;
- window._cyRigidYuan = rigid;
- window._cyTheoreticalCapYuan = cappedTotal;
- // [v4.5.2] 暴露完整可负担方案保费(7 险种)+ scaling 信息,供 renderPremiumTimeline 切换"建议 vs 可负担"
- window._cyAffordablePremiums = {
- acc: d.premiums.acc || 0,
- med: d.premiums.med,
- ci: d.premiums.ci,
- life: d.premiums.life,
- retire: recRetire,
- edu: recEdu,
- wl: recWl || 0
- };
- window._cyScalingFactor = scalingFactor;
- window._cyEduFloorTriggered = eduFloorTriggered;
- document.getElementById('affAffordablePremium').textContent = '¥' + (affordableTotal/10000).toFixed(1) + '万';
- const _denomNoun = (tier === 'hnw' || (tier === 'mid' && cap === 0.01)) ? 'AUM' : '收入';
- const _capDecimals = (tier === 'hnw' || (tier === 'mid' && cap === 0.01)) ? 1 : 0;
- if (cap >= 1) {
- document.getElementById('affAffordablePremiumSub').textContent = '不设上限 · 完整需求方案';
- } else if (scalingFactor < 1) {
- let sub = `已按 ${(cap*100).toFixed(_capDecimals)}% ${_denomNoun}上限缩减储蓄型`;
- if (eduFloorTriggered) sub += ` · 教育金按 ${(eduFloorRatio*100).toFixed(0)}% floor 保留`;
- document.getElementById('affAffordablePremiumSub').textContent = sub;
- } else {
- document.getElementById('affAffordablePremiumSub').textContent = '已在可负担范围,无需缩减';
- }
- // 警示带
- const warnEl = document.getElementById('affWarning');
- const warnText = document.getElementById('affWarnText');
- if (cap < 1 && premiumRatio > cap) {
- warnEl.style.display = 'flex';
- const denomLabel = (tier === 'hnw' || (tier === 'mid' && cap === 0.01))
- ? `AUM ¥${(aumWan>=10000?(aumWan/10000).toFixed(2)+'亿':aumWan.toFixed(0)+'万')}`
- : `收入 ¥${familyIncomeWan}万`;
- const _ratioDecimals = (tier === 'hnw' || (tier === 'mid' && cap === 0.01)) ? 2 : 0;
- if (isOverflow) {
- warnText.innerHTML = `<strong>🔴 严重超标</strong>:即便仅保留刚需(重疾/医疗/寿险)的 ¥${(rigid/10000).toFixed(1)}万年缴,也已超过${_denomNoun==='AUM'?'AUM 行业惯例 1-3%':'家庭年收入 ' + (cap*100).toFixed(0) + '% 上限'}。<strong>建议</strong>:降低重疾倍数(从 3× 调到 2×)、延长寿险缴费期至 30 年、或先与客户谈"未来 3 年储蓄型暂缓"。`;
- } else {
- const eduNote = eduFloorTriggered ? ` · 留学子女教育金按 ${(eduFloorRatio*100).toFixed(0)}% floor 保留(签证 + 时间窗口刚性)` : '';
- warnText.innerHTML = `<strong>⚠ 完整需求方案超标</strong>:理论年缴 ¥${(fullPremium/10000).toFixed(1)}万 / ${denomLabel} = <strong>${(premiumRatio*100).toFixed(_ratioDecimals)}%</strong>,超过 ${(cap*100).toFixed(_capDecimals)}% 上限。系统已自动缩减教育金/养老金至 <strong>¥${(affordableTotal/10000).toFixed(1)}万</strong>(占比 ${(affordableTotal/denominatorYuan*100).toFixed(_ratioDecimals)}%)${eduNote}。`;
- }
- } else {
- warnEl.style.display = 'none';
- }
- // [v4.7-Q2] 准退休客户智能护栏 · yearsToRetire ≤ 10 时提示
- // 触发条件:age + retireAge 都有 + yearsToRetire ≤ 10 + 养老金保费 > 收入 15% (3-yr 紧迫窗口)
- const _yearsToRetire = Math.max(0, (d.retireAge || 60) - (d.age || 35));
- const _retirePremiumRatio = familyIncomeWan > 0 ? ((d.premiums.retire || 0) / 10000 / familyIncomeWan) : 0;
- let triNearRetireWarnHtml = '';
- if (_yearsToRetire > 0 && _yearsToRetire <= 10 && d.premiums.retire > 0) {
- const annualRetirePremiumWan = (d.premiums.retire / 10000).toFixed(1);
- const retireBudgetTotalWan = (d.premiums.retire * _yearsToRetire / 10000).toFixed(1);
- triNearRetireWarnHtml =
- '<div class="aff-near-retire-warn" style="margin-top:10px;padding:9px 12px;border-radius:6px;background:#FFF7E6;border:1px solid #C9A84C;font-size:11.5px;line-height:1.55;color:#5C4810">' +
- '<strong style="color:#A61C2B">⏰ 准退休缴费窗口仅 ' + _yearsToRetire + ' 年</strong> · 养老金年缴 <strong>¥' + annualRetirePremiumWan + '万</strong>' +
- (_retirePremiumRatio > 0.15 ? '(占工资 <strong style="color:#A61C2B">' + (_retirePremiumRatio*100).toFixed(0) + '%</strong>,偏高)' : '(占工资 ' + (_retirePremiumRatio*100).toFixed(0) + '%)') +
- ' · 累计 ' + _yearsToRetire + ' 年 = ¥' + retireBudgetTotalWan + '万。<br>' +
- '<strong>💡 三种现金流方案</strong>:<br>' +
- '① <strong>趸交</strong>:用流动资产 ¥' + retireBudgetTotalWan + '万一次性投保(降低现金流压力)<br>' +
- '② <strong>配偶投保</strong>:转移核保到配偶,延长缴费窗口至配偶退休年(节省年缴 30-50%)<br>' +
- '③ <strong>缩小养老金保额</strong>:把 retireNeed 从理论值降到家庭可承受档位(下调 30-50% 后年缴 ¥' + (annualRetirePremiumWan*0.5).toFixed(1) + '-' + (annualRetirePremiumWan*0.7).toFixed(1) + '万)' +
- '</div>';
- }
- // [v4.7-Q3] 中端档现金流来源提示 · 帮代理人讲清"用存款 / 投资收益交保费"
- if (tier === 'mid') {
- const liquidWan = d.liquidAssets || 0;
- const monthlyExpWan = familyIncomeWan * 0.45 / 12; // 简化:salary × 45% lifestyle / 12
- const emergencyReserveWan = Math.max(monthlyExpWan * 6, 30); // 6 个月生活费,最少 30 万
- const usableLiquidWan = Math.max(0, liquidWan - emergencyReserveWan);
- const recommendedAnnualWan = usableLiquidWan / 20; // 20 年分摊
- triNearRetireWarnHtml +=
- '<div class="aff-mid-tier-hint" style="margin-top:10px;padding:9px 12px;border-radius:6px;background:#EEF4FF;border:1px solid #2B6CB0;font-size:11.5px;line-height:1.55;color:#1E4D72">' +
- '<strong style="color:#2B6CB0">💰 中端档 · 现金流来源建议</strong> · 您的工资 ¥' + familyIncomeWan + '万 + 流动资产 ¥' + liquidWan + '万 给了"双现金流"灵活性:<br>' +
- '① 建议保留应急金 <strong>¥' + emergencyReserveWan.toFixed(0) + '万</strong>(6 个月生活费)<br>' +
- '② 剩余 ¥' + usableLiquidWan.toFixed(0) + '万可作"长期保费来源",分 20 年摊 ≈ <strong>¥' + recommendedAnnualWan.toFixed(1) + '万/年</strong><br>' +
- '③ 实际缴费可"工资 + 存款"混合:工资覆盖刚需(意外/医疗/重疾/定寿),存款 / 投资收益覆盖储蓄型(养老/教育/终身寿)' +
- '</div>';
- }
- // 注入到双轨 note 下方(暴露给 renderTriTable)
- window._cyTriExtraWarnHtml = triNearRetireWarnHtml;
- // 行业基准条:HNW / 中端档(AUM 口径) vs 普通家庭(收入口径)使用不同刻度
- // [v4.7] 中端档 cap 0.01 时复用 HNW AUM 刻度
- const _useAumScale = (tier === 'hnw') || (tier === 'mid' && cap === 0.01);
- const covScale = _useAumScale ? 10 : 40;
- const covMarkerPct = Math.min(100, (coverageMultiple / covScale) * 100);
- document.getElementById('affCoverageMarker').style.left = covMarkerPct + '%';
- document.getElementById('affCoverageMultiple').textContent = coverageMultiple.toFixed(1) + '×';
- // 保费占比基准条:AUM 口径 0-4.5%, 收入口径 0-45%
- const premScale = _useAumScale ? 0.045 : 0.45;
- const premMarkerPct = Math.min(100, (premiumRatio / premScale) * 100);
- document.getElementById('affPremiumMarker').style.left = premMarkerPct + '%';
- document.getElementById('affPremiumPct').textContent = (premiumRatio*100).toFixed(_useAumScale?2:0) + '%';
- // [v2.9] 动态切换基准条 label + scale 文案 · [v4.7] 加中端档支持
- const covLabelEl = document.getElementById('affCoverageBenchLabel');
- const premLabelEl = document.getElementById('affPremiumBenchLabel');
- const covScaleEl = document.getElementById('affCoverageScale');
- const premScaleEl = document.getElementById('affPremiumScale');
- if (_useAumScale) {
- const _denomNounLabel = tier === 'mid' ? '总财富(中端档)' : '家庭 AUM';
- if (covLabelEl) covLabelEl.textContent = '总保额 / ' + _denomNounLabel;
- if (premLabelEl) premLabelEl.textContent = '年缴 / ' + _denomNounLabel;
- if (covScaleEl) covScaleEl.innerHTML = '<span>0×</span><span>2×</span><span>5×</span><span>8×</span><span>10×+</span>';
- if (premScaleEl) premScaleEl.innerHTML = '<span>0%</span><span>1.5%</span><span>3%</span><span>4.5%+</span>';
- } else {
- if (covLabelEl) covLabelEl.textContent = '总保额 / 家庭年收入';
- if (premLabelEl) premLabelEl.textContent = '年缴 / 家庭年收入';
- if (covScaleEl) covScaleEl.innerHTML = '<span>0×</span><span>10×</span><span>20×</span><span>30×</span><span>40×+</span>';
- if (premScaleEl) premScaleEl.innerHTML = '<span>0%</span><span>15%</span><span>30%</span><span>45%+</span>';
- }
- // [v4.6] 三轨配置表 · 完整需求(A) vs 可负担方案(B) vs 自定义方案(C · 可编辑)
- const dualTrackEl = document.getElementById('affDualTrack');
- if (cap < 1 && (premiumRatio > cap || scalingFactor < 1)) {
- dualTrackEl.style.display = 'block';
- const triBody = document.getElementById('affTriTableBody');
- const eduTierLabel = {
- 'elite_us': '🇺🇸 美高+美本+美研', 'full_overseas': '🇬🇧🇺🇸 全程英美',
- 'domestic_plus': '🇨🇳+🌐 国内+海外硕士', 'domestic': '🇨🇳 纯国内'
- }[d.eduPath] || '';
- const rows = [
- // 🟧 基础风险层(刚需)
- { key: 'acc', name: '⚡ 意外险(基础·刚需)', full: (d.premiums.acc || 0), aff: (d.premiums.acc || 0) },
- { key: 'med', name: '🏥 高端医疗(基础·刚需)', full: d.premiums.med, aff: d.premiums.med },
- { key: 'ci', name: '⚕ 重疾险(基础·刚需)', full: d.premiums.ci, aff: d.premiums.ci },
- // 🟨 中端风险层(部分刚需 + 部分储蓄)
- { key: 'life', name: '🛡 定期寿险(中端·收入替代)', full: d.premiums.life, aff: d.premiums.life },
- { key: 'edu', name: `🎓 教育金(中端·储蓄${eduFloorTriggered?' · floor '+(eduFloorRatio*100).toFixed(0)+'%':''})${eduTierLabel?' · '+eduTierLabel:''}`, full: d.premiums.edu, aff: recEdu },
- { key: 'retire', name: '💰 养老年金(中端·储蓄)', full: d.premiums.retire, aff: recRetire },
- // 🟡 高端风险层(传承)
- { key: 'wl', name: '💎 终身寿险(高端·传承)', full: (d.premiums.wl || 0), aff: recWl }
- ];
- // [v4.6] 自定义方案默认 = 可负担方案;但如代理人之前已编辑过(_cyCustomDirty=true),保留原编辑值
- // 这样 switchCfScenario('custom') 触发 silent calculate() 时,代理人 C 列输入不被重置
- // 如用户改了 form 字段(salary 等)+ 没编辑过 C 列 → 重置到新 aff 默认值
- const customDefaults = {};
- rows.forEach(r => { customDefaults[r.key] = r.aff; });
- const _existingCustom = window._cyCustomPremiums;
- const _preserveCustom = _existingCustom
- && Object.keys(_existingCustom).length === rows.length
- && window._cyCustomDirty === true;
- window._cyCustomPremiums = _preserveCustom
- ? Object.assign({}, _existingCustom)
- : Object.assign({}, customDefaults);
- triBody.innerHTML = rows.map((r, idx) => {
- const cutAff = r.full > 0 && r.aff < r.full * 0.99;
- const affClass = cutAff ? ' tri-cell-cut' : '';
- const _customYuan = window._cyCustomPremiums[r.key] !== undefined ? window._cyCustomPremiums[r.key] : r.aff;
- const customWan = (_customYuan / 10000).toFixed(2);
- const cutCustom = r.full > 0 && _customYuan < r.full * 0.99;
- const customCellClass = cutCustom ? ' tri-cell-cut' : '';
- // 自定义方案 = 可编辑 input · 默认值 = 可负担方案 / 之前编辑值
- return '<tr data-row-idx="' + idx + '" data-key="' + r.key + '" data-full="' + r.full + '">' +
- '<td>' + r.name + '</td>' +
- '<td class="tri-num">¥' + (r.full/10000).toFixed(2) + '万</td>' +
- '<td class="tri-num tri-num-aff' + affClass + '">¥' + (r.aff/10000).toFixed(2) + '万</td>' +
- '<td class="tri-num-custom' + customCellClass + '">' +
- '<input type="number" class="tri-custom-input" data-key="' + r.key + '" ' +
- 'min="0" step="0.5" value="' + customWan + '" oninput="onTriCustomInput(this)">' +
- '<span class="tri-custom-suffix">万</span>' +
- '</td>' +
- '</tr>';
- }).join('');
- // 合计行
- document.getElementById('triFullTotal').textContent = '¥' + (fullPremium/10000).toFixed(1) + '万';
- document.getElementById('triAffTotal').textContent = '¥' + (affordableTotal/10000).toFixed(1) + '万';
- // 自定义方案合计 · 默认 = 可负担方案 / 保留之前编辑值
- let _customTotalInit = 0;
- Object.keys(window._cyCustomPremiums).forEach(k => {
- _customTotalInit += (window._cyCustomPremiums[k] || 0);
- });
- window._cyCustomTotalYuan = _customTotalInit;
- document.getElementById('triCustomTotal').textContent = '¥' + (_customTotalInit/10000).toFixed(1) + '万';
- // [v4.7 Q1 + Jack 2026-06-21] 三档差异 mini badge · 让客户秒看出"自定义 vs 完整需求"差额
- updateTriDiffBadges(fullPremium, affordableTotal, _customTotalInit);
- // 计算并显示初始 warn
- updateTriCustomWarn(_customTotalInit, denominatorYuan, isHNW, cap, fullPremium);
- // 暴露刷新工具,供 onTriCustomInput 复用
- window._cyTriCtx = {
- rows, fullPremium, affordableTotal, denominatorYuan, isHNW, cap
- };
- } else {
- dualTrackEl.style.display = 'none';
- // 不显示双轨时,自定义方案 = 完整需求(供 Canvas 兜底,但实际不画线)
- window._cyCustomTotalYuan = fullPremium;
- window._cyCustomPremiums = null;
- }
- // [v4.7] 注入准退休护栏 + 中端档现金流提示 到 triExtraWarn(无论双轨是否展示都注入,准退休客户即便不超 cap 也要看到)
- const triExtraEl = document.getElementById('triExtraWarn');
- if (triExtraEl) {
- triExtraEl.innerHTML = window._cyTriExtraWarnHtml || '';
- }
- }
- // === [v4.6] 三轨自定义方案 · 输入监听器 ===
- function onTriCustomInput(inputEl) {
- const ctx = window._cyTriCtx;
- if (!ctx) return;
- const key = inputEl.getAttribute('data-key');
- const wanVal = parseFloat(inputEl.value) || 0;
- const yuanVal = wanVal * 10000;
- // 更新存储
- if (window._cyCustomPremiums) {
- window._cyCustomPremiums[key] = yuanVal;
- }
- // 标记已被编辑 · 让 renderAffordabilityCheck 在后续 calculate() 中保留 _cyCustomPremiums
- window._cyCustomDirty = true;
- // 复用 cut 逻辑(自定义 < 完整需求 99% 时标 cut)
- const tr = inputEl.closest('tr');
- const fullVal = parseFloat(tr.getAttribute('data-full')) || 0;
- const customCell = tr.querySelector('td.tri-num-custom');
- if (customCell) {
- if (fullVal > 0 && yuanVal < fullVal * 0.99) {
- customCell.classList.add('tri-cell-cut');
- } else {
- customCell.classList.remove('tri-cell-cut');
- }
- }
- // 重算自定义方案合计
- let customTotal = 0;
- Object.keys(window._cyCustomPremiums).forEach(k => {
- customTotal += (window._cyCustomPremiums[k] || 0);
- });
- window._cyCustomTotalYuan = customTotal;
- document.getElementById('triCustomTotal').textContent = '¥' + (customTotal/10000).toFixed(1) + '万';
- // [v4.7 Q1] 三档差异 mini badge 实时同步
- updateTriDiffBadges(ctx.fullPremium, ctx.affordableTotal, customTotal);
- // 更新 warn
- updateTriCustomWarn(customTotal, ctx.denominatorYuan, ctx.isHNW, ctx.cap, ctx.fullPremium);
- // [v4.6] 自动切到「自定义方案」展示模式 · 让 Canvas 直接反映微调后的现金流
- // 如已经在 custom 模式,只需轻量重画 Canvas;否则触发 silent 切换并重算
- if (window._cyShowScenario !== 'custom') {
- if (typeof switchCfScenario === 'function') {
- switchCfScenario('custom'); // 自动切换 + 重算 + 更新副文案
- return;
- }
- }
- // 已在 custom 模式 → 无 calculate(),直接调用 renderPremiumTimeline 用最新 _cyCustomPremiums 重画
- if (typeof renderPremiumTimeline === 'function' && window._cyLastTimelineData) {
- renderPremiumTimeline(window._cyLastTimelineData);
- }
- }
- // === [v4.7 Q1 + Jack 2026-06-21] 三档差异 mini badge 渲染 ===
- // 让客户秒看出"自定义方案 vs 完整需求 / 可负担方案"差额(绝对值 + 百分比)
- function updateTriDiffBadges(fullYuan, affYuan, customYuan) {
- function _pill(diffYuan, baseYuan) {
- if (baseYuan <= 0) return '<span class="tri-diff-pill tri-diff-pill-eq">—</span>';
- const ratio = diffYuan / baseYuan;
- const absWan = Math.abs(diffYuan) / 10000;
- const pct = (Math.abs(ratio) * 100);
- if (Math.abs(ratio) < 0.005) {
- return '<span class="tri-diff-pill tri-diff-pill-eq">≈ 完整需求</span>';
- } else if (diffYuan < 0) {
- // 比基准少 → 绿色"省"
- return '<span class="tri-diff-pill tri-diff-pill-down">−' + pct.toFixed(0) + '%</span>' +
- '<span class="tri-diff-amt">省 ¥' + absWan.toFixed(1) + '万</span>';
- } else {
- // 比基准多 → 红色"超"
- return '<span class="tri-diff-pill tri-diff-pill-up">+' + pct.toFixed(0) + '%</span>' +
- '<span class="tri-diff-amt">超 ¥' + absWan.toFixed(1) + '万</span>';
- }
- }
- const affEl = document.getElementById('triAffDiff');
- const customEl = document.getElementById('triCustomDiff');
- if (affEl) affEl.innerHTML = _pill(affYuan - fullYuan, fullYuan);
- if (customEl) customEl.innerHTML = _pill(customYuan - fullYuan, fullYuan);
- }
- // === [v4.6] 三轨自定义方案 · 超标 warn 渲染 ===
- function updateTriCustomWarn(customYuan, denomYuan, isHNW, cap, fullPremium) {
- const warnEl = document.getElementById('triCustomWarn');
- if (!warnEl) return;
- if (denomYuan <= 0 || cap >= 1) {
- warnEl.className = 'aff-tri-warn';
- warnEl.style.display = 'none';
- return;
- }
- const customRatio = customYuan / denomYuan;
- const denomLabelShort = isHNW ? 'AUM' : '家庭年收入';
- const overPct = ((customRatio / cap - 1) * 100);
- const ratioPct = (customRatio * 100).toFixed(isHNW ? 2 : 1);
- const capPct = (cap * 100).toFixed(isHNW ? 1 : 0);
- if (customRatio > cap) {
- warnEl.className = 'aff-tri-warn is-warn';
- warnEl.innerHTML = '⚠ <strong>自定义方案已超 ' + overPct.toFixed(0) + '%</strong>:年缴 ¥' +
- (customYuan/10000).toFixed(1) + '万 / ' + denomLabelShort + ' = ' + ratioPct + '%,超过 ' +
- capPct + '% 上限。建议下调储蓄型(养老/教育/终身寿)或延长缴费期。';
- } else if (customYuan < fullPremium * 0.999 && customYuan > 0) {
- warnEl.className = 'aff-tri-warn is-ok';
- warnEl.innerHTML = '✓ <strong>自定义方案在可负担区间</strong>:年缴 ¥' +
- (customYuan/10000).toFixed(1) + '万 / ' + denomLabelShort + ' = ' + ratioPct + '%(上限 ' +
- capPct + '%)· Canvas 蓝色虚线已同步。';
- } else {
- warnEl.className = 'aff-tri-warn';
- warnEl.style.display = 'none';
- }
- }
- function renderProductRecommendations(d) {
- if (!window.CY_PRODUCTS) {
- document.getElementById('onshoreProducts').innerHTML =
- '<div style="grid-column:1/-1;text-align:center;color:var(--text-dim);padding:30px">⚠ 未载入 products-bundle.js</div>';
- return;
- }
- const onshore = matchProducts('insurance_onshore', d);
- const offshore = matchProducts('insurance_offshore', d);
- document.getElementById('onshoreProducts').innerHTML =
- onshore.length ? onshore.map(renderProductCard).join('')
- : '<div style="grid-column:1/-1;text-align:center;color:var(--text-dim);padding:20px">未找到匹配境内产品</div>';
- document.getElementById('offshoreProducts').innerHTML =
- offshore.length ? offshore.map(renderProductCard).join('')
- : '<div style="grid-column:1/-1;text-align:center;color:var(--text-dim);padding:20px">未找到匹配境外产品</div>';
- // HNW 客户默认切到境外 Tab
- if (d.isHNW) {
- document.querySelectorAll('.product-tab').forEach(t => t.classList.remove('active'));
- document.querySelectorAll('.product-pane').forEach(p => p.classList.remove('active'));
- document.querySelectorAll('.product-tab')[1].classList.add('active');
- document.getElementById('productPaneOffshore').classList.add('active');
- }
- }
- function switchProductTab(track, el) {
- document.querySelectorAll('.product-tab').forEach(t => t.classList.remove('active'));
- document.querySelectorAll('.product-pane').forEach(p => p.classList.remove('active'));
- if (el) el.classList.add('active');
- document.getElementById(track === 'onshore' ? 'productPaneOnshore' : 'productPaneOffshore').classList.add('active');
- }
- /* === 产品详情 Modal(v2026-06-13)· 点击产品卡弹出 === */
- function showProductModal(productId) {
- if (!window.CY_PRODUCTS) return;
- // 在所有 category 中查找
- let p = null;
- ['insurance_onshore','insurance_offshore','identity','crs_tax','asset','trust','education'].forEach(cat => {
- if (p) return;
- const arr = window.CY_PRODUCTS[cat] || [];
- const found = arr.find(x => x.id === productId);
- if (found) p = found;
- });
- if (!p) return;
- // 价格范围格式化
- let priceRange = '—';
- if (p.premium_range_cny) {
- const min = p.premium_range_cny.min;
- const max = p.premium_range_cny.max;
- priceRange = '¥' + (min >= 10000 ? Math.round(min/10000) + '万' : min) +
- ' - ¥' + (max >= 10000 ? Math.round(max/10000) + '万' : max);
- } else if (p.premium_range_usd) {
- const min = p.premium_range_usd.min;
- const max = p.premium_range_usd.max;
- priceRange = '$' + (min >= 1000000 ? (min/1000000).toFixed(1) + 'M' : min/1000 + 'K') +
- ' - $' + (max >= 1000000 ? (max/1000000).toFixed(1) + 'M' : max/1000 + 'K');
- }
- const isHot = p.hot_selling;
- const features = p.key_features || [];
- const audiences = p.target_audience || [];
- const useCases = p.use_cases || [];
- const indices = p.indices || [];
- const fs = p.financial_strength || {};
- // Header
- let html = '<div class="pm-header">';
- html += `<div class="pm-eyebrow">${(p.subcategory || p.category || '').replace(/_/g,' ').toUpperCase()}${isHot ? ' · HOT 主推' : ''}</div>`;
- html += `<div class="pm-title">${p.name_cn || ''}${isHot ? '<span class="hot-badge">HOT</span>' : ''}</div>`;
- if (p.name_en) html += `<div class="pm-title-en">${p.name_en}</div>`;
- html += '<div class="pm-meta-row">';
- if (p.issuer) html += `<span class="pm-meta-item">🏢 ${p.issuer}</span>`;
- if (p.region) html += `<span class="pm-meta-item">🌏 ${p.region}</span>`;
- if (p.type_label) html += `<span class="pm-meta-item">📦 ${p.type_label}</span>`;
- if (p.coverage_period) html += `<span class="pm-meta-item">📅 ${p.coverage_period}</span>`;
- html += '</div>';
- if (p.tagline) html += `<div class="pm-tagline">"${p.tagline}"</div>`;
- html += '</div>';
- // Body
- html += '<div class="pm-body">';
- // 产品参数
- html += '<div class="pm-section"><div class="pm-section-title">📦 产品参数</div>';
- html += '<div class="pm-grid-2">';
- html += `<div class="pm-label">保费范围</div><div class="pm-value">${priceRange}</div>`;
- if (p.payment_terms) html += `<div class="pm-label">缴费期</div><div class="pm-value">${p.payment_terms.join(' / ')}</div>`;
- if (p.coverage_period) html += `<div class="pm-label">保障期间</div><div class="pm-value">${p.coverage_period}</div>`;
- if (p.currency) html += `<div class="pm-label">币种</div><div class="pm-value">${p.currency}</div>`;
- if (p.irr_long_term) html += `<div class="pm-label">长期 IRR</div><div class="pm-value">${(p.irr_long_term.min*100).toFixed(1)}% - ${(p.irr_long_term.max*100).toFixed(1)}%</div>`;
- if (p.cash_value_multiplier_at_30y) html += `<div class="pm-label">30 年现金价值倍数</div><div class="pm-value">${p.cash_value_multiplier_at_30y.min}x - ${p.cash_value_multiplier_at_30y.max}x</div>`;
- if (p.leverage_at_age40) html += `<div class="pm-label">40 岁投保杠杆</div><div class="pm-value">${p.leverage_at_age40.min}x - ${p.leverage_at_age40.max}x</div>`;
- if (p.min_premium_usd) html += `<div class="pm-label">最低起投</div><div class="pm-value">$${(p.min_premium_usd/1000000).toFixed(1)}M</div>`;
- html += '</div></div>';
- // 财务实力(IUL 独有)
- if (Object.keys(fs).length) {
- html += '<div class="pm-section"><div class="pm-section-title">🏛 财务实力</div>';
- html += '<div class="pm-grid-2">';
- if (fs.sp) html += `<div class="pm-label">S&P 评级</div><div class="pm-value">${fs.sp}</div>`;
- if (fs.moody) html += `<div class="pm-label">Moody's 评级</div><div class="pm-value">${fs.moody}</div>`;
- if (fs.ambest) html += `<div class="pm-label">A.M. Best 评级</div><div class="pm-value">${fs.ambest}</div>`;
- if (fs.aum_cad) html += `<div class="pm-label">管理资产(CAD)</div><div class="pm-value">${fs.aum_cad}</div>`;
- if (fs.staff) html += `<div class="pm-label">员工数</div><div class="pm-value">${fs.staff}</div>`;
- if (fs.advisors) html += `<div class="pm-label">顾问数</div><div class="pm-value">${fs.advisors}</div>`;
- if (fs.clients_global) html += `<div class="pm-label">全球客户</div><div class="pm-value">${fs.clients_global}</div>`;
- html += '</div></div>';
- }
- // 上市交易所(IUL 独有)
- if (p.listing && p.listing.length) {
- html += '<div class="pm-section"><div class="pm-section-title">📈 上市交易所</div>';
- html += '<div class="pm-tags">' + p.listing.map(x => `<span class="pm-tag">${x}</span>`).join('') + '</div>';
- html += '</div>';
- }
- // 适合人群
- if (audiences.length) {
- html += '<div class="pm-section"><div class="pm-section-title">🎯 适合人群</div>';
- html += '<div class="pm-tags">' + audiences.map(x => `<span class="pm-tag">${x}</span>`).join('') + '</div>';
- html += '</div>';
- }
- // 核心特性
- if (features.length) {
- html += '<div class="pm-section"><div class="pm-section-title">⭐ 核心特性</div>';
- html += '<ul class="pm-list">' + features.map(x => `<li>${x}</li>`).join('') + '</ul>';
- html += '</div>';
- }
- // 适用场景
- if (useCases.length) {
- html += '<div class="pm-section"><div class="pm-section-title">💼 适用场景</div>';
- html += '<div class="pm-tags">' + useCases.map(x => `<span class="pm-tag">${x}</span>`).join('') + '</div>';
- html += '</div>';
- }
- // 指数账户(IUL 独有)
- if (indices.length) {
- html += '<div class="pm-section"><div class="pm-section-title">📊 挂钩指数账户</div>';
- html += '<table class="pm-indices-table"><thead><tr><th>账户名</th><th>权重 / 标的</th></tr></thead><tbody>';
- indices.forEach(idx => {
- html += `<tr><td>${idx.name || ''}</td><td>${idx.weight || ''}</td></tr>`;
- });
- html += '</tbody></table></div>';
- }
- // 备注
- if (p.notes) {
- html += '<div class="pm-section"><div class="pm-section-title">💡 备注</div>';
- html += `<div class="pm-notes">${p.notes}</div>`;
- html += '</div>';
- }
- html += '</div>';
- // Footer
- html += '<div class="pm-footer">';
- html += '<button class="pm-btn" onclick="closeProductModal()">关闭</button>';
- html += `<button class="pm-btn primary" onclick="alert('对接 1v1 顾问咨询\\n\\n微信:jackpara\\n邮箱:jack@chengyan.com\\n\\n${(p.name_cn || '此产品').replace(/'/g,'')} 详情咨询')">📞 对接 1v1 咨询</button>`;
- html += '</div>';
- document.getElementById('pmContent').innerHTML = html;
- document.getElementById('productModal').classList.add('active');
- document.body.style.overflow = 'hidden';
- }
- function closeProductModal() {
- document.getElementById('productModal').classList.remove('active');
- document.body.style.overflow = '';
- }
- // ESC 关闭 modal
- document.addEventListener('keydown', e => {
- if (e.key === 'Escape') closeProductModal();
- });
- /* === Phase 4 · 9 画像专属建议库(每画像 2-3 条独有建议)
- v2026-06-13 · 去品牌化 · 只说保险类型不提具体产品名,避免代理人公司冲突 */
- const PERSONA_SPECIFIC_TIPS = {
- middle_3: [
- { name: '👨👩👧 三口之家·黄金组合', desc: '重疾 ¥150 万(年缴 ¥1.5 万)+ 寿险 ¥800 万(覆盖房贷)+ 高端医疗险 + 教育金险(子女 5 岁起 18 年缴)' },
- { name: '🎓 教育金最佳起点', desc: '子女 5 岁是教育金险黄金窗口 · 12 年复利让 ¥30 万 = ¥80 万大学金 · 推荐配置:**分红型年金险 / 增额终身寿**' }
- ],
- two_child: [
- { name: '👨👩👧👦 二孩家庭·重头戏', desc: '寿险 ¥3000 万(房贷 ¥500 + 教育金 ¥1200 + 收入替代 ¥1300)+ 配偶补充 ¥1500 万分散投保' },
- { name: '🇺🇸 跨境教育金锁定', desc: '英美留学路径 · 香港分红型储蓄险 35 岁前完成储备 · 美元抗通胀对冲 · 推荐配置:**美元分红型储蓄险**' }
- ],
- single_lady: [
- { name: '👩💼 单身专属·重养老不重寿', desc: '重疾 ¥150 万(32 岁是黄金窗口)+ 高端医疗 ¥800 万 + 美元年金险(55 岁早退)· 寿险只需小额覆盖父母赡养' },
- { name: '🏥 健康危机第一线', desc: '32 岁投保 50 岁需续保 · 50 岁后保费 5 倍 · 现在锁定 30 年缴期 · 推荐配置:**重疾险(终身保障型)+ 高端医疗险(全球医疗)**' }
- ],
- dink: [
- { name: '💑 DINK 双轨配置', desc: '双方各自重疾 ¥100 万 + 互为受益人寿险 ¥1500 万 + 共同美元年金账户 · 一人意外另一人独居必须有保障' },
- { name: '⚖ 互为依赖结构', desc: '丁克家庭一人意外另一人独居 30+ 年 · 寿险一次性给付 ≥ 10 年生活费 ¥1500 万 + 高端医疗双账户' }
- ],
- single_mom: [
- { name: '👩👦 单亲专属·受益人单一指定', desc: '寿险 ¥1500 万受益人单一指定 8 岁儿子(必须公证)· 避免前夫/前夫家庭干扰 · 推荐配置:**增额终身寿(可嵌套保险金信托)**' },
- { name: '⚡ 紧迫时间窗口', desc: '38 岁单亲单收入 · 健康一旦出问题孩子无依靠 · 优先级:寿险 ¥1500 > 重疾 ¥100 > 高端医疗 · 6 个月内必须配齐' }
- ],
- entrepreneur: [
- { name: '🏢 经营贷担保解除', desc: '寿险 ≥ 经营贷 ¥1000 万 + 房贷 ¥800 万 = ¥1800 万 · 一旦意外触发自动解除担保 · 避免家族资产被追索清盘' },
- { name: '📐 股权传承双轨架构', desc: '境内增额终身寿 ¥3000 万(主理人投保)+ 境外 PPLI 装入公司股权 30%(¥1500 万估值)· 双轨准备避免股权过户失控' },
- { name: '⚠ 经营贷个人担保警示', desc: '中国《公司法》§3:有限责任公司股东以出资额为限 · 但银行经营贷常要求个人无限连带担保 · 寿险是唯一"对冲死亡触发还款"工具' }
- ],
- silver: [
- { name: '👴 准退休最后投保窗口', desc: '55 岁是终身寿险最后黄金期 · 60 岁保费翻倍 · 70 岁多家公司停售 · 推荐配置:**增额终身寿(50-60 岁专属档)**' },
- { name: '💰 退休现金流双层', desc: '美元年金险(¥200 万 5 年缴)+ 国内分红型年金 · 60 岁开始领取 · 通胀对冲 · 配偶投保转移核保' }
- ],
- cross_border: [
- { name: '🌐 美籍二代核心隔离架构', desc: 'PPLI 装入境内股权 50%(¥3 亿+)+ Pre-Immigration Trust + 5-10 年弃籍税路径 · 持牌跨境通道办理' },
- { name: '⚖ FATCA 申报合规', desc: 'CRS / FATCA 双重申报 · 美籍子女金融账户跨境透明 · 必须 PPLI 包装才能合规节税 · 否则 40% 美国遗产税' },
- { name: '🛂 跨境身份预筹', desc: '主理人香港优才 / 新加坡 GIP · 美籍子女独立路径 · 配偶身份选择影响整个家族架构 · 推荐配套法务咨询' }
- ],
- uhnw_succession: [
- { name: '🏛 完整传承四件套', desc: '境内大额寿险 ¥5 亿(配偶分散投保)+ 境外 PPLI ¥30 亿(装入股权 30%)+ 离岸主信托 + 在岸辅助信托 · 双层架构' },
- { name: '⚖ 多子女分配防纠纷', desc: '长子 25 岁接班 vs 幼子 18 岁留学 → 寿险指定受益比例 长子 60% / 幼子 40% · 配套家族宪章 · 避免争产' },
- { name: '🤲 慈善基金三合一', desc: '设立家族慈善信托 ¥10 亿规模 · 节税(企业所得税抵扣)+ 传承隔离(慈善豁免遗产税)+ 品牌三合一' }
- ]
- };
- // [v4.8 · 2026-06-26] 客户家庭报告 · 一页总结(报告尾部"客户带走"卡)
- // 聚合 总缺口 + 评分 + 最大缺口险种 + 年缴/年薪 + 3 步行动 → 客户视角故事化呈现
- function renderClientSummary(d) {
- const card = document.getElementById('clientSummaryCard');
- if (!card) return;
- // 1. 总缺口
- const totalGap = (d.gaps.acc + d.gaps.med + d.gaps.ci + d.gaps.life +
- d.gaps.edu + d.gaps.retire + d.gaps.wl) || 0;
- // 2. 评分(复用主算法 · 60 分基线 + 加分项)
- const baseExist = d.exists.acc + d.exists.med + d.exists.ci;
- const baseNeed = d.needs.acc + d.needs.med + d.needs.ci;
- const midExist = d.exists.life + d.exists.edu + d.exists.retire;
- const midNeed = d.needs.life + d.needs.edu + d.needs.retire;
- const highExist = d.exists.wl;
- const highNeed = d.needs.wl;
- const baseCov = baseNeed > 0 ? Math.min(1, baseExist / baseNeed) : 0;
- const midCov = midNeed > 0 ? Math.min(1, midExist / midNeed) : 0;
- const highCov = highNeed > 0 ? Math.min(1, highExist / highNeed) : 0;
- const hasAnyExisting = (baseCov + midCov + highCov) > 0;
- const baseline = hasAnyExisting ? 6.0 : 2.0;
- const policyCount = ['acc','med','ci','life','edu','retire','wl']
- .filter(k => (d.exists[k] || 0) > 0).length;
- const balancedBonus = Math.max(0, Math.min(0.4, (policyCount - 3) * 0.1));
- const score = Math.min(10,
- Math.round((baseline + baseCov*1.5 + midCov*1.0 + highCov*0.8 + balancedBonus) * 10) / 10);
- // 3. 最大缺口险种
- const gapEntries = [
- { key:'acc', name:'意外险', gap: d.gaps.acc || 0 },
- { key:'med', name:'高端医疗', gap: d.gaps.med || 0 },
- { key:'ci', name:'重疾险', gap: d.gaps.ci || 0 },
- { key:'life', name:'定期寿险', gap: d.gaps.life || 0 },
- { key:'edu', name:'教育金', gap: d.gaps.edu || 0 },
- { key:'retire', name:'养老金', gap: d.gaps.retire || 0 },
- { key:'wl', name:'终身寿险', gap: d.gaps.wl || 0 }
- ].filter(e => e.gap > 0).sort((a,b) => b.gap - a.gap);
- const maxGapEntry = gapEntries[0] || { name:'已配齐', gap:0 };
- // 4. 年缴 / 年薪 比例
- const totalPremium = d.totalPremium || 0;
- const annualIncomeYuan = (d.salary + (d.spouseSalary || 0)) * 10000;
- const ratio = annualIncomeYuan > 0 ? totalPremium / annualIncomeYuan : 0;
- const ratioPct = (ratio * 100).toFixed(1);
- const ratioLabel = ratio < 0.10 ? '空间充足' : ratio < 0.20 ? '合理区间' : ratio < 0.30 ? '需关注' : '超标';
- const ratioColor = ratio < 0.20 ? '#2D6A4F' : ratio < 0.30 ? '#B58A21' : '#A6121C';
- // 5. 评分 label
- const scoreLabel = score >= 8.5 ? '✅ 优秀'
- : score >= 7.0 ? '✓ 良好'
- : score >= 6.0 ? '⚡ 及格'
- : score >= 4.0 ? '⚠ 待补齐'
- : '🚨 待启动';
- // 6. 三层缺口分组
- const baseGap = (d.gaps.acc + d.gaps.med + d.gaps.ci) || 0;
- const midGap = (d.gaps.life + d.gaps.edu + d.gaps.retire) || 0;
- const highGap = d.gaps.wl || 0;
- // ─────────── 渲染 ───────────
- card.classList.add('show');
- // 一句话诊断
- const headlineEl = document.getElementById('csHeadline');
- if (totalGap > 0) {
- headlineEl.innerHTML =
- '您家庭目前的<strong>总缺口</strong>约 <span class="cs-h-num">' + fmtWan(totalGap) + '</span>,' +
- '最大风险敞口在【<strong>' + maxGapEntry.name + '</strong>】(缺口 <span class="cs-h-num">' + fmtWan(maxGapEntry.gap) + '</span>)。' +
- '当前年缴预算占年薪 <span class="cs-h-num">' + ratioPct + '%</span>,' +
- '<strong style="color:' + ratioColor + '">' + ratioLabel + '</strong>。';
- } else {
- headlineEl.innerHTML = '您的家庭保障已基本配齐 ✓ 后续仅需周期性复盘 + 险种均衡度微调。';
- }
- // 关键指标 4 项
- document.getElementById('csMetricGap').textContent = totalGap > 0 ? fmtWan(totalGap) : '已配齐';
- document.getElementById('csMetricScore').innerHTML = score + ' <span style="font-size:14px;opacity:.7">/ 10</span>';
- document.getElementById('csMetricScoreLabel').textContent = scoreLabel;
- document.getElementById('csMetricMaxGap').textContent = maxGapEntry.name;
- document.getElementById('csMetricMaxGapAmt').textContent = maxGapEntry.gap > 0 ? ('¥' + fmtWan(maxGapEntry.gap)) : '—';
- document.getElementById('csMetricRatio').textContent = ratioPct + ' %';
- const ratioLabelEl = document.getElementById('csMetricRatioLabel');
- ratioLabelEl.textContent = ratioLabel;
- ratioLabelEl.style.color = ratioColor;
- // 3 步行动
- const actionsEl = document.getElementById('csActions');
- const actions = [];
- if (baseGap > 0) {
- actions.push({
- tier:'base', window:'30 天内', name:'基础保障补齐',
- detail:'意外 / 医疗 / 重疾 三项 · 缺口 <strong>¥' + fmtWan(baseGap) + '</strong> · 无体检窗口期,立即可投保'
- });
- }
- if (midGap > 0) {
- actions.push({
- tier:'mid', window:'90 天内', name:'中端配置(收入替代 + 储蓄)',
- detail:'定期寿险 / 教育金 / 养老金 · 缺口 <strong>¥' + fmtWan(midGap) + '</strong> · 需 1 次完整顾问会面定方案'
- });
- }
- if (highGap > 0) {
- actions.push({
- tier:'high', window:'365 天内', name:'高端路径(传承 ± 跨境)',
- detail:'终身寿险 ± 境内/境外双轨 · 缺口 <strong>¥' + fmtWan(highGap) + '</strong> · 涉及架构 · 需 2-3 次会面'
- });
- }
- // 若全部配齐
- if (actions.length === 0) {
- actions.push({
- tier:'base', window:'季度复盘', name:'保障已配齐 · 周期性回看',
- detail:'年度收入 / 资产变动 / 婚育规划变化时,<strong>重跑一遍 IC</strong>;任何险种缺口 > 30% 即触发补充配置'
- });
- }
- actionsEl.innerHTML = actions.map((a, i) => `
- <div class="cs-action cs-action--${a.tier}">
- <div class="cs-action-num">${i+1}</div>
- <div class="cs-action-body">
- <div class="cs-action-head">
- <span>${a.name}</span>
- <span class="cs-action-window">${a.window}</span>
- </div>
- <div class="cs-action-desc">${a.detail}</div>
- </div>
- </div>
- `).join('');
- }
- function renderUhnwSuggestions(d) {
- const list = document.getElementById('uhnwList');
- if (!list) return; // [v4.8 · 2026-06-26] uhnw-card 已移除 · DOM 缺失时安全早返
- const items = [];
- // === 第 1 层 · 画像专属建议(优先,如已选画像) ===
- const personaId = sessionStorage.getItem('cy_persona_id') || '';
- const personaTips = PERSONA_SPECIFIC_TIPS[personaId];
- if (personaTips && personaTips.length) {
- personaTips.forEach(t => items.push(t));
- }
- // === 第 2 层 · 数字驱动通用规则(基于实际财务/家庭数据) ===
- // 经营贷担保(otherDebt 高)
- if (d.otherDebt && d.otherDebt >= 500 && !personaId.includes('entrepreneur')) {
- items.push({
- name: '🏢 经营贷担保解除',
- desc: '其他负债 ¥' + d.otherDebt + '万(疑似经营贷)· 主理人寿险 ≥ 该金额可触发自动解除担保 · 避免家族资产被追索'
- });
- }
- // 多子女分配公平
- if (d.childCount >= 3 && !personaId) {
- items.push({
- name: '⚖ 多子女分配公平',
- desc: d.childCount + ' 子 · 寿险指定受益人比例避免法定继承大乱 · 每子女平均 ¥' + Math.round((d.lifeNeed||1000) / d.childCount) + '万'
- });
- }
- // 美籍二代专项(无画像但有美籍标识)
- if (d.hasUS && !personaId.includes('cross_border') && !personaId.includes('uhnw')) {
- items.push({
- name: '🌐 美籍二代 FATCA 隔离',
- desc: 'PPLI 跨境隔离 · Pre-Immigration Trust · 美国遗产税 40% 重灾区,必须专项处理'
- });
- }
- // HNW 双轨(无画像但 lifeNeed ≥ 5 亿)
- if (d.lifeNeed >= 50000 && !personaId.includes('uhnw') && !personaId.includes('cross')) {
- items.push({
- name: '🏛 境内 + 境外双轨配置',
- desc: '境内 ¥3-5 亿(年龄健康限制)+ 境外 PPLI 装入股权 30%(几乎无上限)· 双轨叠加'
- });
- }
- // 单收入家庭(配偶 0 + 主理人 ≥ 80)
- if (d.spouseSalary === 0 && d.salary >= 80 && d.childCount > 0 && !personaId.includes('single')) {
- items.push({
- name: '👫 单收入家庭风险锁定',
- desc: '主理人 100% 收入支柱 · 寿险按 100% 收入替代率配置 · 重疾全配 · 配偶健康险补充'
- });
- }
- // 双高收入家庭
- if (d.spouseSalary && d.spouseSalary >= d.salary * 0.8 && d.salary >= 80 && !personaId.includes('dink')) {
- items.push({
- name: '⚖ 双高收入家庭',
- desc: '配偶赚得不少 → 双方均配大额寿险(互为受益人)· 双轨重疾 · 美元年金双账户对冲'
- });
- }
- // 准退休(50+)
- if (d.age >= 50 && d.retireGap >= 500 && !personaId.includes('silver')) {
- items.push({
- name: '💰 退休前最后窗口',
- desc: '5-10 年内退休 · 抓紧美元增额年金 · 现金价值长期持有 · 退休后流动性已锁定'
- });
- }
- // 离异家庭(无画像但 marriage='divorced')
- if (d.marriage === 'divorced' && d.childCount > 0 && !personaId.includes('single_mom')) {
- items.push({
- name: '👩👦 离异家庭专项',
- desc: '寿险受益人**单一指定子女**(必须公证)· 避免前任家庭干扰 · 教育金险锁定子女专属'
- });
- }
- // 默认建议(完全空白时)
- if (items.length === 0) {
- items.push({
- name: '✓ 当前保障基础健全',
- desc: '建议每年复盘 1 次保单 · 关注现金价值增长 · 与家庭资产再平衡同步'
- });
- }
- // 渲染(最多 6 条,避免过长)
- list.innerHTML = items.slice(0, 6).map(it => `<div class="uhnw-item">
- <div class="uhnw-item-name">${it.name}</div>
- <div class="uhnw-item-desc">${it.desc}</div>
- </div>`).join('');
- }
- function updateChildAgeFields() {
- const count = parseInt(document.getElementById('childCount').value);
- for (let i = 1; i <= 3; i++) {
- document.getElementById('childAge'+i+'Wrap').style.display = i <= count ? 'flex' : 'none';
- }
- }
- function resetForm() {
- if (!confirm('确认重置所有输入?')) return;
- document.querySelectorAll('input').forEach(i => {
- if (i.type === 'number') i.value = i.defaultValue || '';
- else i.value = '';
- });
- document.querySelectorAll('select').forEach(s => s.selectedIndex = 0);
- document.getElementById('result').style.display = 'none';
- // [Bug fix] 清 persona 标记
- sessionStorage.removeItem('cy_persona_id');
- sessionStorage.removeItem('cy_persona_force_hnw');
- document.querySelectorAll('.persona-chip').forEach(c => c.classList.remove('selected'));
- updateChildAgeFields();
- window.scrollTo({ top:0, behavior:'smooth' });
- }
- window.addEventListener('DOMContentLoaded', () => {
- updateChildAgeFields();
- // v3.3.1 · 强制初始化金字塔工具开关 + 默认渲染一次,确保点击立即生效(不依赖用户先点击"计算")
- if (typeof initCalcPyramidToggles === 'function') initCalcPyramidToggles();
- if (typeof renderCalcPyramidSvg === 'function') {
- renderCalcPyramidSvg({ wl:0.55, retire:0.40, edu:0.35, life:0.65, acc:0.85, med:0.75, ci:0.55 });
- }
- // v3.3.4 · 画像切换 dropdown 初始化(暴露 vault 全部 CY_PORTRAITS · 与 PolicySummary 同源)
- if (typeof populatePortraitSwitcher === 'function') populatePortraitSwitcher();
- // [2026-07-15 quiz×IC 桥] URL 参数 ?portrait=<key> 预载画像(来自 interactive-case-quiz「用 IC 算」按钮)
- try {
- const qpKey = new URLSearchParams(window.location.search).get('portrait');
- if (qpKey && window.CY_PORTRAITS && window.CY_PORTRAITS[qpKey]) {
- const data = JSON.stringify(window.CY_PORTRAITS[qpKey]);
- localStorage.setItem('cy_current_portrait', data);
- localStorage.setItem('cy-demo-portrait-data', data);
- localStorage.setItem('cy-demo-family', qpKey);
- }
- } catch (e) { /* 无参数或解析失败 → 走正常 loadPortrait 流程 */ }
- // Phase 2: 自动检测 cy_current_portrait 并预填
- const pt = loadPortrait();
- if (pt && pt.family) {
- prefillFromPortrait(pt);
- }
- });
- </script>
- <script id="v01-hero-js">
- /* [2026-07-12 移植自 家庭保障体检报告 v0.1] 体检报告 Hero 渲染引擎 */
- const V01_PERSPECTIVES = {
- layers: {
- title: '保险三层 · 基础 / 中端 / 高端',
- subtitle: '沿用 v4.7 风险金字塔架构 · 60 基线 + 三层差异化(高若楠 6-24 反馈)',
- compute: function() {
- // 7 险种 ready/need 从 v4.7 DOM 取
- function _gv(id) { const el = document.getElementById(id); return el ? parseFloat(el.textContent.replace(/[^0-9.]/g, '')) || 0 : 0; }
- const acc = { need: _gv('accAmount'), have: _gv('accExisting') };
- const med = { need: _gv('medAmount'), have: _gv('medExisting') };
- const ci = { need: _gv('ciAmount'), have: _gv('ciExisting') };
- const life= { need: _gv('lifeAmount'), have: _gv('lifeExisting') };
- const edu = { need: _gv('eduAmount'), have: _gv('eduExisting') };
- const ret = { need: _gv('retireAmount'), have: _gv('retireExisting') };
- const wl = { need: _gv('wlAmount'), have: _gv('wlExisting') };
- // 计算"实际/需求"覆盖率(0~1)
- function _cov(items) {
- const need = items.reduce(function(s, x){ return s + x.need; }, 0);
- const have = items.reduce(function(s, x){ return s + Math.min(x.have, x.need); }, 0);
- return need > 0 ? have / need : 0;
- }
- // 判断该层是否有任何险种已配
- function _hasAny(items) {
- return items.some(function(x){ return x.have > 0; });
- }
- // [v0.1 · 2026-06-27 · 高若楠 6-24 反馈] 三层差异化基线公式
- // 基础层 = 刚需(意外/医疗/重疾)· 必配 · 没买 = 严重缺口 20 分
- // 中端层 = 应配(定寿/教育/养老)· 中度 · 没买 = 中性 40 分
- // 高端层 = 选配(终身寿/传承)· 非通用刚需 · 没买 = 默认良好 60 分(不视为缺口)
- const baseItems = [acc, med, ci];
- const midItems = [life, edu, ret];
- const highItems = [wl];
- const basic = _hasAny(baseItems)
- ? Math.round(60 + _cov(baseItems) * 40)
- : 20;
- const middle = _hasAny(midItems)
- ? Math.round(55 + _cov(midItems) * 45)
- : 40;
- const high = _hasAny(highItems)
- ? Math.round(50 + _cov(highItems) * 50)
- : 60;
- return [
- { icon: '🟧', label: '基础保障', value: basic, status: _statusFor(basic, '刚需'), color: _colorFor(basic) },
- { icon: '🟦', label: '中端规划', value: middle, status: _statusFor(middle, '储蓄'), color: _colorFor(middle) },
- { icon: '🟪', label: '高端传承', value: high, status: _statusFor(high, '传承'), color: _colorForLegacy(high) }
- ];
- }
- },
- holistic: {
- title: '全息体检 · 保障 / 财富 / 健康',
- subtitle: 'Benchmark 双管家战略 · 财富 + 健康并列(健康环演示数据)',
- compute: function() {
- // 保障 = 已配齐 / 完整需求
- function _gv(id) { const el = document.getElementById(id); return el ? parseFloat(el.textContent.replace(/[^0-9.]/g, '')) || 0 : 0; }
- const total = _gv('totalCoverage');
- const gap = _gv('totalGap');
- const ready = Math.max(0, total - gap);
- const protectionScore = total > 0 ? Math.round((ready / total) * 100) : 0;
- // 财富配置度 = 综合(流动性 30% + 跨境合规 30% + AUM 档位 40%)
- const liquid = _gv('liquidAssets');
- const wealth = _gv('totalAumForWL') || (liquid * 5); // fallback
- const liquidScore = wealth > 0 ? Math.min(100, (liquid / (wealth * 0.15)) * 100) : 0; // 流动性占 15% 最佳
- const aumScore = wealth >= 50000 ? 100 : wealth >= 5000 ? 80 : wealth >= 2000 ? 65 : wealth >= 500 ? 45 : 25;
- const usPersonEl = document.getElementById('hasUSPerson');
- const isUS = usPersonEl && usPersonEl.value === 'yes';
- const complianceScore = isUS ? 60 : 85; // 美籍家族跨境合规复杂度高
- const wealthScore = Math.round(liquidScore * 0.3 + complianceScore * 0.3 + aumScore * 0.4);
- // 健康规划度(演示数据 · 等 Benchmark Health 接入后切真实)
- // 简化模型:基于年龄(35-50 最佳 / 50+ 风险增加)+ 假定 MICA/MISS 检测覆盖
- const ageEl = document.getElementById('age');
- const age = ageEl ? parseInt(ageEl.value) || 35 : 35;
- let healthScore = 50;
- if (age < 35) healthScore = 80;
- else if (age < 45) healthScore = 70;
- else if (age < 55) healthScore = 55;
- else if (age < 65) healthScore = 45;
- else healthScore = 35;
- // 演示用:加 ±10 随机基于 persona id(让不同画像差异化)
- const pid = sessionStorage.getItem('cy_persona_id') || '';
- if (pid === 'silver') healthScore = Math.min(100, healthScore + 5); // 银发已有储备
- if (pid === 'cross_border') healthScore = Math.min(100, healthScore + 10); // HNW 健康投入
- if (pid === 'uhnw_succession') healthScore = Math.min(100, healthScore + 15);
- return [
- { icon: '🛡', label: '保障完整度', value: protectionScore, status: _statusFor(protectionScore, '保险'), color: _colorFor(protectionScore) },
- { icon: '💰', label: '财富配置度', value: Math.min(100, wealthScore), status: _statusFor(wealthScore, '配置'), color: _colorForWealth(wealthScore) },
- { icon: '❤', label: '健康规划度', value: healthScore, status: _statusFor(healthScore, '健康') + ' (演示)', color: _colorForHealth(healthScore) }
- ];
- }
- },
- decision: {
- title: '决策三视角 · 完整度 / 支付能力 / 时间窗口',
- subtitle: '回答 "我缺多少 / 我能不能负担 / 我还有多少时间"',
- compute: function() {
- function _gv(id) { const el = document.getElementById(id); return el ? parseFloat(el.textContent.replace(/[^0-9.]/g, '')) || 0 : 0; }
- const total = _gv('totalCoverage');
- const gap = _gv('totalGap');
- const ready = Math.max(0, total - gap);
- const completeScore = total > 0 ? Math.round((ready / total) * 100) : 0;
- // 支付能力 = 1 - (年缴 / cap上限),即"可负担方案 vs 完整需求"占比
- // 用 _cyAffordableTotalYuan 与完整需求保费对比
- const affordable = window._cyAffordableTotalYuan || 0;
- const fullPremiumWan = _gv('totalAnnualPremium');
- const fullPremium = fullPremiumWan * 10000;
- const affordScore = fullPremium > 0
- ? Math.min(100, Math.round((affordable / fullPremium) * 100))
- : 100;
- // 时间窗口 = yearsToRetire / 30
- const ageEl = document.getElementById('age');
- const retireAgeEl = document.getElementById('retireAge');
- const age = ageEl ? parseInt(ageEl.value) || 35 : 35;
- const retireAge = retireAgeEl ? parseInt(retireAgeEl.value) || 60 : 60;
- const yearsToRetire = Math.max(0, retireAge - age);
- const timeScore = Math.min(100, Math.round((yearsToRetire / 30) * 100));
- return [
- { icon: '💰', label: '保障完整度', value: completeScore, status: _statusFor(completeScore, '已配齐'), color: _colorFor(completeScore) },
- { icon: '💸', label: '支付能力', value: affordScore, status: affordScore >= 100 ? '完整可负担' : '需缩减 ' + (100-affordScore) + '%', color: _colorForCapacity(affordScore) },
- { icon: '⏰', label: '时间窗口', value: timeScore, status: yearsToRetire <= 5 ? '紧迫 · ' + yearsToRetire + ' 年' : yearsToRetire + ' 年至退休', color: _colorForTime(timeScore) }
- ];
- }
- },
- assets: {
- title: '资产三层 · 保险 / 投资 / 现金流',
- subtitle: '跨工具联动 · 投资环演示数据(待接入 AssetCenter)',
- compute: function() {
- function _gv(id) { const el = document.getElementById(id); return el ? parseFloat(el.textContent.replace(/[^0-9.]/g, '')) || 0 : 0; }
- const total = _gv('totalCoverage');
- const gap = _gv('totalGap');
- const ready = Math.max(0, total - gap);
- const insuranceScore = total > 0 ? Math.round((ready / total) * 100) : 0;
- // 投资配置(演示)· 基于 totalWealth 档位 + 行业平均假设
- const liquid = _gv('liquidAssets');
- const invest = _gv('investAssets');
- const totalWealth = liquid + _gv('primaryResidence') + invest;
- // 投资比例 = invest / totalWealth(15-40% 健康)
- const investRatio = totalWealth > 0 ? (invest / totalWealth) : 0;
- let investScore = 0;
- if (investRatio < 0.05) investScore = 25;
- else if (investRatio < 0.15) investScore = 50;
- else if (investRatio < 0.40) investScore = 80;
- else if (investRatio < 0.60) investScore = 70; // 投资过重也扣分
- else investScore = 50;
- // 演示加成:有跨境资产 +10
- if (_gv('overseasAssets') > 0) investScore = Math.min(100, investScore + 10);
- // 现金流健康 = (流动 - 应急金) / 月生活费
- // 应急金 = 6-12 月生活费 ≈ 月生活费 × 9
- const salary = _gv('salary');
- const monthlyExp = salary * 0.45 / 12; // 简化模型
- const emergencyReserve = monthlyExp * 9;
- const usableLiquid = Math.max(0, liquid - emergencyReserve);
- // 健康度 = usable 占 liquid 的比例 + 应急金充足度
- let cashflowScore = 0;
- if (liquid > emergencyReserve * 2) cashflowScore = 90;
- else if (liquid > emergencyReserve * 1.5) cashflowScore = 75;
- else if (liquid > emergencyReserve) cashflowScore = 60;
- else if (liquid > emergencyReserve * 0.5) cashflowScore = 35;
- else cashflowScore = 15;
- return [
- { icon: '🛡', label: '保险保障', value: insuranceScore, status: _statusFor(insuranceScore, '保障'), color: _colorFor(insuranceScore) },
- { icon: '📈', label: '投资配置', value: investScore, status: _statusFor(investScore, '配置') + ' (演示)', color: _colorForInvest(investScore) },
- { icon: '💧', label: '现金流健康', value: cashflowScore, status: cashflowScore >= 75 ? '应急金充足' : cashflowScore >= 60 ? '基本应急' : '应急金不足', color: _colorForCashflow(cashflowScore) }
- ];
- }
- }
- };
- // 状态文案 helpers
- function _statusFor(score, label) {
- if (score >= 80) return label + ' · 完备';
- if (score >= 60) return label + ' · 良好';
- if (score >= 40) return label + ' · 部分就绪';
- return label + ' · 待规划';
- }
- function _colorFor(score) {
- if (score >= 80) return '#5EE0A0';
- if (score >= 60) return '#C9A84C';
- if (score >= 40) return '#E89B3D';
- return '#E87070';
- }
- function _colorForLegacy(score) { // 高端传承:紫色系
- if (score >= 80) return '#A875E0';
- if (score >= 60) return '#7A5A8E';
- if (score >= 40) return '#E89B3D';
- return '#E87070';
- }
- function _colorForWealth(score) { // 财富:暖金
- if (score >= 80) return '#F5C988';
- if (score >= 60) return '#C9A84C';
- if (score >= 40) return '#E89B3D';
- return '#E87070';
- }
- function _colorForHealth(score) { // 健康:绿系
- if (score >= 80) return '#5EE0A0';
- if (score >= 60) return '#A0C9A8';
- if (score >= 40) return '#E89B3D';
- return '#E87070';
- }
- function _colorForCapacity(score) { // 支付能力:红绿(满分绿)
- if (score >= 100) return '#5EE0A0';
- if (score >= 80) return '#C9A84C';
- if (score >= 60) return '#E89B3D';
- return '#E87070';
- }
- function _colorForTime(score) { // 时间窗口:满 100% 蓝/紧迫红
- if (score >= 60) return '#8FB9D6';
- if (score >= 30) return '#C9A84C';
- return '#E87070';
- }
- function _colorForInvest(score) { // 投资:深蓝
- if (score >= 80) return '#5EE0A0';
- if (score >= 60) return '#8FB9D6';
- if (score >= 40) return '#E89B3D';
- return '#E87070';
- }
- function _colorForCashflow(score) { // 现金流:水蓝
- if (score >= 80) return '#5EE0A0';
- if (score >= 60) return '#8FB9D6';
- if (score >= 40) return '#E89B3D';
- return '#E87070';
- }
- /* === 三环渲染 · 重写整个 #v01RingsRow DOM === */
- function v01RenderRings(perspective) {
- perspective = perspective || 'layers';
- window.V01_CURRENT_PERSPECTIVE = perspective;
- const cfg = V01_PERSPECTIVES[perspective];
- if (!cfg) return;
- const row = document.getElementById('v01RingsRow');
- const titleEl = document.getElementById('v01RingsTitle');
- const subtitleEl = document.getElementById('v01RingsSubtitle');
- if (titleEl) titleEl.textContent = cfg.title;
- if (subtitleEl) subtitleEl.textContent = cfg.subtitle;
- if (!row) return;
- let rings;
- try { rings = cfg.compute(); } catch(e) { console.warn('[v0.1.3 perspective compute fail]', e); rings = [{value:0},{value:0},{value:0}]; }
- // SVG circumference (r=72)
- const r = 72, circumference = 2 * Math.PI * r;
- let html = '';
- rings.forEach(function(ring, idx){
- const val = Math.max(0, Math.min(100, ring.value || 0));
- const offset = circumference - (val / 100) * circumference;
- html += '<div class="v01-ring-tile" data-ring-idx="' + idx + '" onclick="v01OpenRingPopover(\'' + perspective + '\',' + idx + ')">' +
- '<div class="v01-ring-tile-canvas">' +
- '<svg viewBox="0 0 160 160">' +
- '<circle class="v01-ring-tile-track" cx="80" cy="80" r="' + r + '"></circle>' +
- '<circle class="v01-ring-tile-progress" cx="80" cy="80" r="' + r + '" ' +
- 'stroke="' + (ring.color || '#C9A84C') + '" ' +
- 'stroke-dasharray="' + circumference + '" ' +
- 'stroke-dashoffset="' + offset + '"></circle>' +
- '</svg>' +
- '<div class="v01-ring-tile-text">' +
- '<div class="v01-ring-tile-icon">' + (ring.icon || '◆') + '</div>' +
- '<div class="v01-ring-tile-num">' + val + '</div>' +
- '<div class="v01-ring-tile-unit">/100</div>' +
- '</div>' +
- '</div>' +
- '<div class="v01-ring-tile-label">' + (ring.label || '') + '</div>' +
- '<div class="v01-ring-tile-status">' + (ring.status || '') + '</div>' +
- '</div>';
- });
- row.innerHTML = html;
- }
- /* === [v0.1.6 + Jack 2026-06-22] 三环点击 popup · 算法解释 === */
- const V01_RING_EXPLAINS = {
- // 视角 → 3 环索引 → { formula, text, drillTo }
- layers: [
- { formula: '<strong>基础保障</strong>(刚需层 · 全家庭必配)<br>' +
- '<br>· <strong>有买任一项</strong> → 60 + (覆盖率 × 40)· 区间 60~100<br>' +
- '· <strong>完全未配</strong> → 20 分(严重缺口红线)<br>' +
- '<br><span style="opacity:.7">含 意外 / 医疗 / 重疾 · 公式:意外=salary×3-5 / 医疗=¥800万 / 重疾=salary×2-5</span>',
- text: '基础保障层是<strong>所有家庭必配的"刚需层"</strong> — 对冲"损失性风险"(进/防 · 没钱)。<br>' +
- '<strong>评分规则</strong>:已买任一项 → 自动 60 分起评,然后按实际覆盖率加分到 100 · 完全未配 → 20 分警示(严重红线)。',
- drillTo: 'pyramidCheckCard' },
- { formula: '<strong>中端规划</strong>(应配层 · 中产以上推荐)<br>' +
- '<br>· <strong>有买任一项</strong> → 55 + (覆盖率 × 45)· 区间 55~100<br>' +
- '· <strong>完全未配</strong> → 40 分(中性 · 非必须)<br>' +
- '<br><span style="opacity:.7">含 定寿 / 教育金 / 养老金 · 公式:定寿=DIM法 / 教育金=子女路径×通胀PV / 养老金=月缺口×退休年限</span>',
- text: '中端规划层覆盖"<strong>支出性风险</strong>"(出/增 · 花钱)— 子女教育 / 退休生活 / 收入替代等长周期支出。<br>' +
- '<strong>评分规则</strong>:已配任一项 → 55 起评 · 覆盖率加分 · 未配为中性 40 分(非刚需 · 不视为严重缺口)。',
- drillTo: 'affDualTrack' },
- { formula: '<strong>高端传承</strong>(选配层 · UHNW / 跨境家族)<br>' +
- '<br>· <strong>有买终身寿</strong> → 50 + (覆盖率 × 50)· 区间 50~100<br>' +
- '· <strong>未配</strong> → 60 分(默认良好 · 非通用刚需)<br>' +
- '<br><span style="opacity:.7">普通家庭 wlNeed = 总财富 × 30%(传承基线)/ HNW wlNeed = 境内增额 + 境外 IUL·VUL·PPLI 双轨</span>',
- text: '高端传承层对冲"<strong>所有性风险</strong>"(保/传/留钱)— 家族财富跨代隔离 + 税务结构。<br>' +
- '<strong>评分规则</strong>:已配终身寿 → 50 起评 · 未配 → 默认 60(因为不是所有家庭都需要传承层,普通家庭无此环为大红线一说)。',
- drillTo: 'pyramidCheckCard' }
- ],
- holistic: [
- { formula: '<strong>保障完整度</strong> = (7 险种已配齐保额) / 7 险种完整需求合计<br><br>' +
- '即 v4.7 "保障缺口" Hero 的反向口径:已配齐 = totalCoverage − totalGap',
- text: '<strong>保障维度</strong>是 Benchmark 的<strong>核心专业领域</strong> — 保险 7 险种(意外/医疗/重疾/定寿/教育/养老/终身寿)综合体检。',
- drillTo: 'result' },
- { formula: '<strong>财富配置度</strong> = 流动性 30% + 跨境合规 30% + AUM 档位 40%<br><br>' +
- '流动性:流动资产 / (总财富 × 15% 最佳)<br>' +
- '合规:美籍标记 60 分 / 非美籍 85 分<br>' +
- 'AUM 档位:< 500 万=25 / 500-2000 万=45 / 2000-5000 万=65 / 5000 万-5 亿=80 / 5 亿+=100',
- text: '<strong>财富维度</strong>测量<strong>资产配置健康度</strong>(估算)— 流动性 + 跨境合规复杂度 + AUM 档位 加权综合。<br>' +
- '⚠ 演示数据 · 真实评估需走 AssetCenter / LetsSee 完整推演。',
- drillTo: 'result' },
- { formula: '<strong>健康规划度</strong> = 年龄基线 + persona 健康加成<br><br>' +
- '< 35 岁=80 / 35-45=70 / 45-55=55 / 55-65=45 / 65+=35<br>' +
- '银发已有储备 +5 / HNW 健康投入 +10 / UHNW +15',
- text: '<strong>健康维度</strong>是双管家战略的<strong>另一翼</strong>(Benchmark Health)。<br>' +
- '⚠ 当前演示数据 · 真实评估对接 MICA/MISS 检测覆盖率 + 健康风险预案。<br>' +
- '<strong>未来对接</strong>:Benchmark Health 平台 API + 客户实际检测数据。',
- drillTo: 'result' }
- ],
- decision: [
- { formula: '<strong>保障完整度</strong> = 已配齐保额 / 完整需求保额<br><br>' +
- '回答 "<strong>我缺多少</strong>" — 这是 7 险种的"已盖率"',
- text: '决策视角第 1 维:<strong>距离目标的差距</strong>。<br>' +
- '> 80 视为完备 · 60-80 良好 · 40-60 部分就绪 · < 40 待规划。',
- drillTo: 'result' },
- { formula: '<strong>支付能力</strong> = 可负担方案年缴 / 完整需求年缴<br><br>' +
- '可负担方案 = 系统按客户支付能力(salary × cap% 或 AUM × 1%)自动缩减后的方案<br>' +
- '若 = 100% → 完整需求即可负担 · 若 < 100% → 储蓄型已被缩减',
- text: '决策视角第 2 维:<strong>我能不能负担</strong>。<br>' +
- '若 < 100% 说明完整需求超出客户支付上限,代理人应优先讨论<strong>缩减养老/教育</strong>或<strong>延长缴费期</strong>。',
- drillTo: 'affDualTrack' },
- { formula: '<strong>时间窗口</strong> = yearsToRetire / 30<br><br>' +
- 'yearsToRetire = 退休年龄 - 当前年龄<br>' +
- '< 5 年 = 紧迫 / 5-10 年 = 较紧 / 10-30 年 = 充裕',
- text: '决策视角第 3 维:<strong>我还有多少时间</strong>。<br>' +
- '准退休客户(yearsToRetire ≤ 10)的"时间窗口"环会告急 — 代理人应抓<strong>短缴期(5/10 年)+ 趸交</strong>组合,锁定不可保性。',
- drillTo: 'cashflowSection' }
- ],
- assets: [
- { formula: '<strong>保险保障</strong> = 同"保障完整度" = 已配齐 / 完整需求',
- text: '资产视角第 1 层:<strong>保险(对冲层)</strong> — 出险时的"紧急救援基金"。',
- drillTo: 'result' },
- { formula: '<strong>投资配置</strong> = 基于 invest / totalWealth 比例 + 跨境加成<br><br>' +
- '< 5% = 25(配置不足)<br>' +
- '5-15% = 50<br>' +
- '15-40% = 80(健康区间)<br>' +
- '40-60% = 70(投资过重)<br>' +
- '> 60% = 50(过激)<br>' +
- '有跨境资产 +10',
- text: '资产视角第 2 层:<strong>投资(增长层)</strong> — 资产分散度健康检查。<br>' +
- '⚠ 演示数据 · 真实评估走 AssetCenter / LetsSee 完整推演。',
- drillTo: 'result' },
- { formula: '<strong>现金流健康</strong> = 流动资产 vs 应急金倍数<br><br>' +
- '应急金 = 月生活费 × 9(6-12 月)<br>' +
- '月生活费 = salary × 45% / 12<br>' +
- '<br>liquid > 应急金 × 2 → 90 分<br>' +
- 'liquid > 应急金 × 1.5 → 75<br>' +
- 'liquid > 应急金 → 60<br>' +
- 'liquid > 应急金 × 0.5 → 35<br>' +
- '其他 → 15',
- text: '资产视角第 3 层:<strong>现金流(流动层)</strong> — 应急金是否足够 + 流动性灵活度。<br>' +
- 'HNW / 准退休客户尤其重要 — 决定能否"<strong>用存款交保费</strong>"。',
- drillTo: 'affordabilitySection' }
- ]
- };
- function v01OpenRingPopover(perspective, ringIdx) {
- const expl = (V01_RING_EXPLAINS[perspective] || [])[ringIdx];
- if (!expl) return;
- const cfg = V01_PERSPECTIVES[perspective];
- if (!cfg) return;
- let rings;
- try { rings = cfg.compute(); } catch(e) { rings = []; }
- const ring = rings[ringIdx];
- if (!ring) return;
- // 填充 popup 内容
- document.getElementById('v01PopIcon').textContent = ring.icon || '◆';
- document.getElementById('v01PopLabel').textContent = cfg.title + ' · 维度 ' + (ringIdx + 1);
- document.getElementById('v01PopTitle').textContent = ring.label || '维度';
- document.getElementById('v01PopScoreNum').textContent = ring.value || 0;
- document.getElementById('v01PopScoreStatus').textContent = ring.status || '';
- document.getElementById('v01PopFormula').innerHTML = expl.formula;
- document.getElementById('v01PopText').innerHTML = expl.text;
- // 把当前 ring 对应的 drillTarget 记到 popup,关闭时可用
- window._v01PopupDrillTarget = expl.drillTo;
- document.getElementById('v01RingPopover').classList.add('is-open');
- }
- function v01ClosePopover(ev) {
- if (ev && ev.target && !ev.target.classList.contains('v01-ring-popover-overlay') && !ev.target.classList.contains('v01-pop-close')) {
- // 点击非 overlay/close 按钮的内容区域 · 不关闭
- if (ev.currentTarget !== ev.target && !ev.target.matches('.v01-pop-close')) return;
- }
- document.getElementById('v01RingPopover').classList.remove('is-open');
- }
- function v01PopJumpToFull() {
- const target = window._v01PopupDrillTarget || 'result';
- v01ClosePopover();
- setTimeout(function(){ v01DrillTo(target); }, 100);
- }
- /* === Perspective 切换器 === */
- function v01SwitchPerspective(perspective) {
- // 更新按钮 active 状态
- document.querySelectorAll('.v01-perspective-btn').forEach(function(b){
- b.classList.toggle('is-active', b.getAttribute('data-perspective') === perspective);
- });
- // 重新渲染三环
- v01RenderRings(perspective);
- // 持久化
- localStorage.setItem('cy_v01_perspective', perspective);
- }
- /* === 启动恢复 perspective === */
- (function v01RestorePerspective(){
- const saved = localStorage.getItem('cy_v01_perspective');
- if (saved && V01_PERSPECTIVES[saved]) {
- window.V01_CURRENT_PERSPECTIVE = saved;
- setTimeout(function(){
- document.querySelectorAll('.v01-perspective-btn').forEach(function(b){
- b.classList.toggle('is-active', b.getAttribute('data-perspective') === saved);
- });
- }, 50);
- } else {
- window.V01_CURRENT_PERSPECTIVE = 'layers';
- }
- })();
- function v01UpdateHero() {
- // 5.1 保障完整度 (0-100)
- const totalCoverageEl = document.getElementById('totalCoverage');
- const totalGapEl = document.getElementById('totalGap');
- if (!totalCoverageEl || !totalGapEl) return;
- // 从 v4.7 隐藏节点取数(它们是 v4.7 的"老兼容"节点,calculate 写入)
- const _total = parseFloat(totalCoverageEl.textContent.replace(/[^0-9.]/g, '')) || 0;
- const _gap = parseFloat(totalGapEl.textContent.replace(/[^0-9.]/g, '')) || 0;
- const _ready = Math.max(0, _total - _gap);
- const score = _total > 0 ? Math.round((_ready / _total) * 100) : 0;
- // 5.2 [v0.1.3] 三环渲染 · 由当前 perspective 驱动(替换原单环)
- v01RenderRings(window.V01_CURRENT_PERSPECTIVE || 'layers');
- // 5.3 3 KPI
- // 保障缺口(取 v4.7 Hero totalGapHero)
- const heroGapEl = document.getElementById('totalGapHero');
- const v01Gap = document.getElementById('v01KpiGap');
- if (heroGapEl && v01Gap) v01Gap.textContent = heroGapEl.textContent;
- // 保障杠杆
- const levEl = document.getElementById('leverage');
- const v01Lev = document.getElementById('v01KpiLeverage');
- if (levEl && v01Lev) v01Lev.textContent = levEl.textContent;
- // 实际年成本
- const costEl = document.getElementById('totalAnnualPremium');
- const v01Cost = document.getElementById('v01KpiCost');
- if (costEl && v01Cost) v01Cost.textContent = costEl.textContent;
- // 副文案 · 占收入比
- const costSubEl = document.getElementById('totalAnnualPremiumSub');
- const v01CostSub = document.getElementById('v01KpiCostSub');
- if (costSubEl && v01CostSub) {
- const m = costSubEl.textContent.match(/(\d+\.?\d*)%/);
- v01CostSub.textContent = m ? '占总财富 ' + m[1] + '%' : '年缴 / 收入';
- }
- // 保障缺口副文案
- const v01GapSub = document.getElementById('v01KpiGapSub');
- if (v01GapSub && _total > 0) {
- const gapPct = ((_gap / _total) * 100).toFixed(0);
- v01GapSub.textContent = '7 险种 · 缺 ' + gapPct + '%';
- }
- // 5.4 mini 三轨数字
- const triFull = document.getElementById('triFullTotal');
- const triAff = document.getElementById('triAffTotal');
- const triCustom = document.getElementById('triCustomTotal');
- if (triFull) document.getElementById('v01MiniTriFull').textContent = triFull.textContent;
- if (triAff) document.getElementById('v01MiniTriAff').textContent = triAff.textContent;
- if (triCustom) document.getElementById('v01MiniTriCustom').textContent = triCustom.textContent;
- // 5.5 [v0.1.6] mini 应急储备健康度 · 替换原 mini 杠杆(避免与 3 KPI 重复)
- // 算法:流动资产 / 月生活费 = 应急金倍数(月)· 行业建议 6-12 月
- function _gv2(id) {
- const el = document.getElementById(id);
- if (!el) return 0;
- const txt = (el.value !== undefined ? el.value : el.textContent || '0').replace(/[^\d.]/g, '');
- const num = parseFloat(txt);
- return isNaN(num) ? 0 : num;
- }
- const liquidWan = _gv2('liquidAssets');
- const salaryWan = _gv2('salary');
- const monthlyExpWan = salaryWan * 0.45 / 12; // 简化:salary × 45% 生活费比 / 12
- const emergencyMonths = monthlyExpWan > 0 ? (liquidWan / monthlyExpWan) : 0;
- const emergNumEl = document.getElementById('v01EmergencyNum');
- const emergFillEl = document.getElementById('v01EmergencyFill');
- const emergFootEl = document.getElementById('v01EmergencyFoot');
- if (emergNumEl) emergNumEl.textContent = emergencyMonths.toFixed(1);
- if (emergFillEl) {
- // bar 锚点 0-24 月范围(24 月=100%)
- const fillPct = Math.min(100, (emergencyMonths / 24) * 100);
- emergFillEl.style.width = fillPct + '%';
- }
- if (emergFootEl) {
- let status = '';
- if (emergencyMonths >= 12) status = '✓ 充裕';
- else if (emergencyMonths >= 6) status = '⚠ 基本应急';
- else if (emergencyMonths >= 3) status = '🔸 偏低';
- else status = '🔴 不足';
- emergFootEl.textContent = '流动资产 ¥' + liquidWan + '万 / 月生活费 ¥' + monthlyExpWan.toFixed(1) + '万 · ' + status;
- }
- // 5.6 mini 风险金字塔(简化:7 险种垂直条)
- v01RenderMiniPyramid();
- // 5.7 mini 现金流(简化:Y0-Y29 30 年单向柱)
- v01RenderMiniCashflow();
- // 5.8 一句话建议
- v01UpdateCoach(score);
- }
- function v01RenderMiniPyramid() {
- const svg = document.getElementById('v01MiniPyramid');
- if (!svg) return;
- // 从 v4.7 隐藏 DOM 读 7 险种的 need / existing
- const segs = [
- { id: 'acc', label: '意外', color: '#9B7C3A' },
- { id: 'med', label: '医疗', color: '#C4973A' },
- { id: 'ci', label: '重疾', color: '#A61C2B' },
- { id: 'life',label: '定寿', color: '#7A3FA0' },
- { id: 'retire', label: '养老', color: '#3D6F8C' },
- { id: 'edu', label: '教育', color: '#5DB890' },
- { id: 'wl', label: '终身寿', color: '#7A5A8E' }
- ];
- const barW = 22, gap = 6, baseY = 100, maxH = 80;
- let html = '<g>';
- let totalReady = 0, totalAll = 0;
- segs.forEach(function(s, idx){
- // 尝试从 v4.7 DOM 取 "已有 / 缺口 / 总额" 数字
- const calcEl = document.getElementById(s.id + 'Calc');
- const existEl = document.getElementById(s.id + 'Existing');
- const amountEl = document.getElementById(s.id + 'Amount');
- let need = 0, existing = 0;
- if (amountEl) need = parseFloat(amountEl.textContent.replace(/[^0-9.]/g, '')) || 0;
- if (existEl) existing = parseFloat(existEl.textContent.replace(/[^0-9.]/g, '')) || 0;
- const ratio = need > 0 ? Math.min(1, existing / need) : 0;
- totalReady += existing;
- totalAll += need;
- const x = 10 + idx * (barW + gap);
- const fillH = ratio * maxH;
- // 背景条(总需求高度 maxH)
- html += '<rect x="' + x + '" y="' + (baseY - maxH) + '" width="' + barW + '" height="' + maxH + '" fill="rgba(255,255,255,.06)" rx="2"/>';
- // 填充条(已配齐)
- html += '<rect x="' + x + '" y="' + (baseY - fillH) + '" width="' + barW + '" height="' + fillH + '" fill="' + s.color + '" rx="2"/>';
- // label
- html += '<text x="' + (x + barW/2) + '" y="' + (baseY + 12) + '" text-anchor="middle" font-size="8" fill="rgba(201,168,76,.7)">' + s.label + '</text>';
- });
- html += '</g>';
- svg.innerHTML = html;
- // foot 更新
- const foot = document.getElementById('v01PyramidFoot');
- if (foot) {
- const fillRatio = totalAll > 0 ? Math.round((totalReady / totalAll) * 100) : 0;
- foot.textContent = '7 险种水位 · ' + fillRatio + '% 已配齐';
- }
- }
- /* === 7. mini 现金流 Canvas 渲染 · 简化版 30 年单向柱 === */
- function v01RenderMiniCashflow() {
- const canvas = document.getElementById('v01MiniCashflow');
- if (!canvas) return;
- const ctx = canvas.getContext('2d');
- const W = canvas.width, H = canvas.height;
- ctx.clearRect(0, 0, W, H);
- // [v0.1.1] 双主题色 · 浅色用深金 / 深色用亮金
- const isLight = document.body.classList.contains('theme-light');
- const barColor = isLight ? '#9B7C3A' : '#C9A84C';
- const axisColor = isLight ? 'rgba(155,124,58,.25)' : 'rgba(201,168,76,.2)';
- const labelColor = isLight ? 'rgba(122,96,40,.6)' : 'rgba(201,168,76,.5)';
- const emptyColor = isLight ? 'rgba(122,96,40,.5)' : 'rgba(245,230,184,.4)';
- // [v0.1.5 修复] 从 v4.7 隐藏 DOM 取保费 · 文本格式 "¥35,000" 需去掉非数字字符
- // 原 bug:parseFloat("¥35,000") = NaN(被 ¥ 拦截)→ 整个 Canvas 空白
- function _parsePremium(id) {
- const el = document.getElementById(id);
- if (!el) return 0;
- const txt = (el.textContent || '0').replace(/[^\d.]/g, ''); // 去除 ¥ , 万 等非数字字符
- const num = parseFloat(txt);
- return isNaN(num) ? 0 : num;
- }
- const accP = _parsePremium('accPremium') / 10000;
- const medP = _parsePremium('medPremium') / 10000;
- const ciP = _parsePremium('ciPremium') / 10000;
- const lifeP = _parsePremium('lifePremium') / 10000;
- const retP = _parsePremium('retirePremium') / 10000;
- const eduP = _parsePremium('eduPremium') / 10000;
- const wlP = _parsePremium('wlPremium') / 10000;
- const total = accP + medP + ciP + lifeP + retP + eduP + wlP;
- if (total <= 0) {
- ctx.fillStyle = emptyColor;
- ctx.font = '11px Inter, sans-serif';
- ctx.textAlign = 'center';
- ctx.fillText('请选择画像或填写数据', W/2, H/2);
- return;
- }
- // 30 个柱(Y0-Y29)
- const YEARS = 30;
- const barW = (W - 16) / YEARS - 1;
- const maxY = Math.max(accP + medP + ciP + lifeP + retP + eduP + wlP, 1);
- const peakH = H - 20;
- for (let y = 0; y < YEARS; y++) {
- let amount = accP + medP; // 终身续保
- if (y < 20) amount += ciP + lifeP + eduP + wlP;
- if (y < 5) amount += retP; // 养老金前 5 年(简化假设)
- const h = (amount / maxY) * peakH;
- const x = 8 + y * (barW + 1);
- ctx.fillStyle = barColor;
- ctx.fillRect(x, H - 12 - h, barW, h);
- }
- // X 轴
- ctx.strokeStyle = axisColor;
- ctx.beginPath();
- ctx.moveTo(0, H - 12);
- ctx.lineTo(W, H - 12);
- ctx.stroke();
- // labels
- ctx.fillStyle = labelColor;
- ctx.font = '9px Inter, sans-serif';
- ctx.textAlign = 'left';
- ctx.fillText('Y0', 10, H - 2);
- ctx.fillText('Y15', W/2 - 6, H - 2);
- ctx.fillText('Y30', W - 18, H - 2);
- // foot 更新
- const foot = document.getElementById('v01CashflowFoot');
- if (foot) foot.textContent = '年缴峰值 ¥' + maxY.toFixed(0) + '万 · 30 年累计 ¥' + (total*20).toFixed(0) + '万';
- }
- function v01UpdateCoach(score) {
- const text = document.getElementById('v01CoachText');
- if (!text) return;
- // 取 9 画像 id
- const pid = (sessionStorage.getItem('cy_persona_id') || '').toLowerCase();
- const yearsToRetireEl = document.getElementById('lifeNeed'); // 用 lifeNeed 作存在性 sentinel
- if (!yearsToRetireEl || !yearsToRetireEl.textContent || yearsToRetireEl.textContent.indexOf('-') === 0) {
- text.innerHTML = '请在右上角选择一个客户画像,或点击「⚙ 现场调参」录入客户信息,系统将自动生成保障诊断。';
- return;
- }
- const age = parseInt((document.getElementById('age')||{}).value || 35);
- const retireAge = parseInt((document.getElementById('retireAge')||{}).value || 60);
- const yearsToRetire = Math.max(0, retireAge - age);
- // 识别主缺口
- const gaps = [
- { id: 'ci', label: '重疾', val: parseFloat((document.getElementById('ciGap')||{}).textContent.replace(/[^0-9.]/g, '') || 0) },
- { id: 'life', label: '定期寿险', val: parseFloat((document.getElementById('lifeGap')||{}).textContent.replace(/[^0-9.]/g, '') || 0) },
- { id: 'retire', label: '养老金', val: parseFloat((document.getElementById('retireGap')||{}).textContent.replace(/[^0-9.]/g, '') || 0) },
- { id: 'edu', label: '教育金', val: parseFloat((document.getElementById('eduGap')||{}).textContent.replace(/[^0-9.]/g, '') || 0) },
- { id: 'wl', label: '终身寿险', val: parseFloat((document.getElementById('wlGap')||{}).textContent.replace(/[^0-9.]/g, '') || 0) }
- ].sort(function(a,b){ return b.val - a.val; });
- const mainGap = gaps[0];
- // 模板选择
- let template = '';
- const scoreStrong = '<strong>' + score + ' 分</strong>';
- const mainGapStrong = '<strong>' + mainGap.label + '</strong>';
- if (yearsToRetire <= 10 && yearsToRetire > 0) {
- // 准退休模板
- const retireGap = gaps.find(function(g){ return g.id === 'retire'; });
- template = '您的保障完整度 ' + scoreStrong + ',主要漏洞在 ' + mainGapStrong + '。' +
- '准退休窗口仅剩 <strong>' + yearsToRetire + ' 年</strong>,' +
- '建议<strong>趸交 / 短缴启动</strong>(5 年缴年金),抢在 60 岁停售前锁定。';
- } else if (pid === 'cross_border' || (document.getElementById('hasUSPerson') && document.getElementById('hasUSPerson').value === 'yes')) {
- // 跨境美籍
- template = '您的保障完整度 ' + scoreStrong + ',跨境美籍家族需重点关注 <strong>境外 PPLI + 遗产税敞口</strong>。' +
- mainGapStrong + '缺口 ¥' + mainGap.val.toFixed(0) + ' 万,建议优先用境外 IUL/PPLI 杠杆配置。';
- } else if (pid === 'uhnw_succession') {
- // UHNW 传承
- template = '您的保障完整度 ' + scoreStrong + ',作为传承型家族,核心在 <strong>境内信托 + 境外 PPLI 双轨</strong>。' +
- mainGapStrong + '缺口 ¥' + (mainGap.val/10000).toFixed(2) + ' 亿,建议 3-5 张保单分批配置 + 跨代传承架构。';
- } else if (pid === 'two_child' || pid === 'middle_3') {
- // 中产带子女
- const eduGap = gaps.find(function(g){ return g.id === 'edu'; });
- if (eduGap && eduGap.val > 100) {
- template = '您的保障完整度 ' + scoreStrong + ',作为中产家庭,<strong>教育金 ¥' + eduGap.val.toFixed(0) + ' 万</strong>是首要补齐项。' +
- '每月 ¥' + ((eduGap.val * 0.025) / 12).toFixed(1) + ' 万即可锁定 ' + (18 - age + 4) + ' 年后的支出。';
- } else {
- template = '您的保障完整度 ' + scoreStrong + ',主要漏洞在 ' + mainGapStrong + '。' +
- '建议先补齐 ' + mainGap.label + ' ¥' + mainGap.val.toFixed(0) + ' 万,再考虑储蓄型升级。';
- }
- } else if (pid === 'single_lady' || pid === 'single_mom' || pid === 'dink') {
- // 单身/丁克
- template = '您的保障完整度 ' + scoreStrong + ',作为单身/丁克结构,<strong>重疾 + 医疗 + 养老</strong>是核心三件套。' +
- mainGapStrong + '缺口 ¥' + mainGap.val.toFixed(0) + ' 万,优先补齐。';
- } else if (pid === 'entrepreneur') {
- // 创业者
- template = '您的保障完整度 ' + scoreStrong + ',作为创业者,<strong>个人担保 + 家庭隔离</strong>是核心。' +
- '建议优先补 ' + mainGapStrong + '(¥' + mainGap.val.toFixed(0) + ' 万),用于覆盖经营贷个人连带责任风险。';
- } else {
- // 默认
- template = '您的保障完整度 ' + scoreStrong + ',主要漏洞在 ' + mainGapStrong + '(¥' + mainGap.val.toFixed(0) + ' 万)。' +
- '建议优先补齐这一险种,然后再考虑储蓄型 / 传承型升级。';
- }
- text.innerHTML = template;
- }
- </script>
- <script id="fav-module-js">
- /* [2026-07-12 移植自 FAV v0.1] 家族保单 + 生命周期 + 水位金字塔 · 数据源改接 IC 实时节点 */
- (function(){
- 'use strict';
- const PYRAMID_SEGS = [
- { pk:'wl', label:'终身寿险', rtier:'high', polygon:'240,70 317,205 163,205', grad:'favL1', labelX:240, labelY:150, pctY:190, yT:70, yB:205 },
- { pk:'retire', label:'养老年金', rtier:'mid', polygon:'163,205 317,205 349,260 131,260', grad:'favL2', labelX:240, labelY:230, pctY:250, yT:205, yB:260 },
- { pk:'edu', label:'教育年金', rtier:'mid', polygon:'131,260 349,260 380,315 100,315', grad:'favL3', labelX:240, labelY:285, pctY:305, yT:260, yB:315 },
- { pk:'life', label:'定期寿险', rtier:'mid', polygon:'100,315 380,315 411,370 69,370', grad:'favL4', labelX:240, labelY:340, pctY:360, yT:315, yB:370 },
- { pk:'acc', label:'意外险', rtier:'base', polygon:'69,370 183,370 173,420 40,420', grad:'favL5', labelX:114, labelY:392, pctY:410, yT:370, yB:420 },
- { pk:'med', label:'医疗险', rtier:'base', polygon:'183,370 297,370 307,420 173,420', grad:'favL5', labelX:240, labelY:392, pctY:410, yT:370, yB:420 },
- { pk:'ci', label:'重疾险', rtier:'base', polygon:'297,370 411,370 440,420 307,420', grad:'favL5', labelX:365, labelY:392, pctY:410, yT:370, yB:420 }
- ];
- // 风险三分元数据(capsule 颜色呼应金字塔层色 · 从底到顶讲"先保命→再保钱→后传承")
- const RTIER_META = {
- base: { name:'基础层 · 损失性风险', short:'基础', desc:'保命 · 意外/医疗/重疾', c:'#D54E42', bg:'rgba(213,78,66,.08)', bd:'rgba(213,78,66,.35)' },
- mid: { name:'中端层 · 支出性风险', short:'中端', desc:'保钱 · 定寿/教育/养老', c:'#C48A1E', bg:'rgba(196,138,30,.10)', bd:'rgba(196,138,30,.38)' },
- high: { name:'高端层 · 传承隔离', short:'高端', desc:'传承 · 终身寿', c:'#7A3FA0', bg:'rgba(122,63,160,.09)', bd:'rgba(122,63,160,.35)' }
- };
- const PYRAMID_GRADS = [
- { id:'favL1', light:'#9B61C2', main:'#7A3FA0', dark:'#4A1F70' },
- { id:'favL2', light:'#6FC192', main:'#4FA672', dark:'#2D7044' },
- { id:'favL3', light:'#F2D366', main:'#E5BB3D', dark:'#B58A21' },
- { id:'favL4', light:'#F0A55B', main:'#E48A35', dark:'#B26420' },
- { id:'favL5', light:'#E5746A', main:'#D54E42', dark:'#962C24' }
- ];
- const STAGE_META = {
- accumulate:{ en:'Stage 1 · Protect & Accumulate', name:'保护与积累阶段', note:'覆盖家庭责任、收入中断、退休储备与生活品质' },
- legacy:{ en:'Stage 2 · Retirement, Care & Legacy', name:'退休支持、长期护理及财富传承', note:'承接退休现金流、长寿与失能风险、财富传承与信托架构' }
- };
- function fmtWan(n){ return (n||0).toLocaleString('zh-CN'); }
- function pkColor(pk){ var s=PYRAMID_SEGS.find(function(x){return x.pk===pk;}); if(!s)return null; var g=PYRAMID_GRADS.find(function(x){return x.id===s.grad;}); return g?g.main:null; }
- var WATER_ON = true;
- function _g(id){ var el=document.getElementById(id); return el?(parseFloat(el.textContent.replace(/[^0-9.]/g,''))||0):0; }
- function _v(id,d){ var el=document.getElementById(id); if(!el)return d||''; return el.value!==undefined?el.value:(el.textContent||'').trim(); }
- function _n(id){ return parseFloat(_v(id))||0; }
- function buildFAVFamilyFromIC(){
- var surname = _v('surname')||'客户';
- var age=_n('age'), gender=_v('gender'), marriage=_v('marriage');
- var childCount=_n('childCount');
- var childAges=[_n('childAge1'),_n('childAge2'),_n('childAge3')].filter(function(a){return a>0;});
- var hasMed = _v('existingMed')==='1';
- var SPEC=[
- {pk:'acc', need:'意外险', stage:'accumulate', A:'accAmount', E:'accExisting'},
- {pk:'med', need:'医疗险', stage:'accumulate', A:'medAmount', E:'medExisting'},
- {pk:'ci', need:'重疾险', stage:'accumulate', A:'ciAmount', E:'ciExisting'},
- {pk:'life', need:'定期寿险', stage:'accumulate', A:'lifeAmount', E:'lifeExisting'},
- {pk:'edu', need:'教育年金', stage:'accumulate', A:'eduAmount', E:'eduExisting'},
- {pk:'retire',need:'养老年金', stage:'legacy', A:'retireAmount',E:'retireExisting'},
- {pk:'wl', need:'终身寿险', stage:'legacy', A:'wlAmount', E:'wlExisting'}
- ];
- var needs = SPEC.map(function(s){
- var req=_g(s.A);
- var cov = s.pk==='med' ? (hasMed?800:0) : _g(s.E);
- return {need:s.need, pk:s.pk, stage:s.stage, req:req, cov:cov, ext:false};
- });
- var genderLabel = gender==='F'?'女':gender==='M'?'男':'';
- var members=[{id:'avg',name:'家族总览',short:'家族总览',desc:'显示家庭全部保单记录'}];
- members.push({id:'principal',name:surname+'(主理人'+(age?' '+age+'岁':'')+(genderLabel?' '+genderLabel:'')+')',short:'主理人',desc:'主理人为被保险人/投保人的保单'});
- if(marriage==='married'){ members.push({id:'spouse',name:'配偶',short:'配偶',desc:'配偶相关保单'}); }
- childAges.forEach(function(a,i){ members.push({id:'child'+(i+1),name:'子女'+(i+1)+'('+a+'岁)',short:'子女'+(i+1),desc:'未成年子女为受益人的保单'}); });
- if(childAges.length===0 && childCount>0){ for(var i=0;i<childCount;i++){ members.push({id:'child'+(i+1),name:'子女'+(i+1),short:'子女'+(i+1),desc:'子女相关保单'}); } }
- var lcMap={acc:'积累',med:'积累',ci:'积累',life:'积累',edu:'积累',retire:'传承',wl:'传承'};
- var policies=[];
- needs.forEach(function(n){
- if(n.cov>0){
- policies.push({member:'principal', mname:'主理人', type:n.need, insurer:'(现有保单)', cov:n.cov, insd:surname+'(主理人)', bene:'家庭成员', trust:false, lc:lcMap[n.pk]||'—'});
- }
- });
- return { name:surname+'氏家庭', plan_kind:'legacy', needs:needs, members:members, policies:policies };
- }
- var _FAV = null;
- var _CUR_MEMBER = 'avg';
- function activeNeeds(fam){ return fam.plan_kind==='legacy' ? fam.needs : fam.needs.filter(function(n){return !n.ext;}); }
- function gapRow(n, dotColor){
- var gap=n.req-n.cov;
- var pct=Math.min(100, n.req>0?Math.round(n.cov/n.req*100):0);
- var ok=gap<=0;
- var dot=dotColor?('<span class="dot-tier" style="background:'+dotColor+'"></span>'):'';
- var extTag=n.ext?('<span class="tag tag-ext">'+(n.ext_label||'传承套')+'</span>'):'';
- return '<div class="gap-row"><div class="gap-top">'+
- '<span class="gap-name">'+dot+n.need+' '+extTag+'</span>'+
- '<span class="gap-fig">已保 <b>'+fmtWan(n.cov)+'</b> / 需求 <b>'+fmtWan(n.req)+'</b> 万 · 缺口 <b class="gap-amt'+(ok?' ok':'')+'">'+(ok?'已覆盖':fmtWan(gap)+'万')+'</b></span>'+
- '</div><div class="gap-bar"><div class="gap-fill" style="width:0%" data-w="'+pct+'"></div></div></div>';
- }
- function animateGaps(){ requestAnimationFrame(function(){ setTimeout(function(){ document.querySelectorAll('.fav-lifecycle-block .gap-fill, .fav-pyramid-block .gap-fill').forEach(function(el){ el.style.width=el.dataset.w+'%'; }); },60); }); }
- function buildPyramidSVG(needsByPk){
- let defs = '';
- PYRAMID_GRADS.forEach(g=>{
- defs += `<linearGradient id="${g.id}" x1="0" y1="0" x2="0" y2="1">
- <stop offset="0%" stop-color="${g.light}"/><stop offset="6%" stop-color="${g.main}"/><stop offset="100%" stop-color="${g.dark}"/>
- </linearGradient>`;
- // 底色渐变(水位 ON 时未注水部分的浅色"空槽")
- defs += `<linearGradient id="${g.id}_bg" x1="0" y1="0" x2="0" y2="1">
- <stop offset="0%" stop-color="${g.main}" stop-opacity="0.12"/><stop offset="100%" stop-color="${g.dark}" stop-opacity="0.22"/>
- </linearGradient>`;
- });
- PYRAMID_SEGS.forEach(s=>{ defs += `<clipPath id="favClip_${s.pk}"><polygon points="${s.polygon}"/></clipPath>`; });
- defs += `<filter id="favPyrShadow" x="-10%" y="-10%" width="120%" height="120%">
- <feGaussianBlur in="SourceAlpha" stdDeviation="4"/><feOffset dx="0" dy="5"/>
- <feComponentTransfer><feFuncA type="linear" slope="0.28"/></feComponentTransfer>
- <feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge></filter>`;
- // 单层水位矩形:ON=实际覆盖率涨水动画 · OFF=满色基线
- const waterRect = (s, cov)=>{
- const fillH = (s.yB - s.yT) * cov;
- const waterY = s.yB - fillH;
- if(!WATER_ON){
- const fullH = s.yB - s.yT;
- return `<rect x="0" y="${s.yT}" width="480" height="${fullH}" fill="url(#${s.grad})" clip-path="url(#favClip_${s.pk})"/>`;
- }
- if(fillH<=0) return '';
- return `<rect x="0" y="${s.yB}" width="480" height="0" fill="url(#${s.grad})" clip-path="url(#favClip_${s.pk})">
- <animate attributeName="y" from="${s.yB}" to="${waterY}" dur="1.4s" begin="0.15s" fill="freeze" calcMode="spline" keyTimes="0;1" keySplines="0.22 1 0.36 1"/>
- <animate attributeName="height" from="0" to="${fillH}" dur="1.4s" begin="0.15s" fill="freeze" calcMode="spline" keyTimes="0;1" keySplines="0.22 1 0.36 1"/>
- </rect>`;
- };
- let layers = '<g filter="url(#favPyrShadow)">';
- PYRAMID_SEGS.forEach(s=>{
- const n = needsByPk[s.pk];
- const cov = n ? Math.min(1, n.cov/n.req) : 0;
- const pct = Math.round(cov*100);
- const pctTxt = (n && n.cov>=n.req) ? '已覆盖' : pct+'%';
- // 底槽(水位 ON 时才铺,作为"未注满"的浅色对照)
- if(WATER_ON) layers += `<polygon points="${s.polygon}" fill="url(#${s.grad}_bg)" stroke="rgba(0,0,0,0.06)" stroke-width="0.6"/>`;
- layers += waterRect(s, cov);
- layers += `<text x="${s.labelX}" y="${s.labelY}" text-anchor="middle" fill="#FFFDF7" font-size="12.5" font-weight="700" letter-spacing="1" font-family="'Noto Serif SC',serif" style="paint-order:stroke;stroke:rgba(60,40,15,.35);stroke-width:2px">${s.label}</text>`;
- layers += `<text x="${s.labelX}" y="${s.pctY}" text-anchor="middle" fill="rgba(255,255,255,.95)" font-size="10" font-weight="800" font-family="var(--font-mono,monospace)" style="paint-order:stroke;stroke:rgba(60,40,15,.35);stroke-width:1.6px">${pctTxt}</text>`;
- });
- layers += '</g>';
- return `<svg viewBox="0 0 480 440" class="fav-pyramid-svg"><defs>${defs}</defs>
- <text x="240" y="42" text-anchor="middle" fill="#9B7C3A" font-size="14" font-weight="600" font-family="'Noto Serif SC',serif" letter-spacing="2">风险保障金字塔 · 7 险种</text>
- ${layers}</svg>`;
- }
- function favRenderMemberPills(){
- var fam=_FAV; var box=document.getElementById('favMemberPills'); if(!box)return;
- box.innerHTML='<span class="label">查看成员:</span>'+fam.members.map(function(m){
- return '<button class="m-pill'+(m.id===_CUR_MEMBER?' active':'')+'" onclick="window.favSwitchMember(\''+m.id+'\')">'+m.short+'</button>';
- }).join('');
- }
- function favRenderPolicies(){
- var fam=_FAV; var rows = _CUR_MEMBER==='avg'?fam.policies:fam.policies.filter(function(p){return p.member===_CUR_MEMBER;});
- var body=document.getElementById('favPolicyBody'); if(!body)return;
- if(!rows.length){ body.innerHTML='<tr><td colspan="7" style="text-align:center;color:var(--text-muted);padding:24px">该成员暂无保单记录</td></tr>'; return; }
- body.innerHTML=rows.map(function(p){
- return '<tr><td>'+p.mname+'</td><td>'+p.type+(p.trust?' <span class="tag tag-trust">信托</span>':'')+'</td><td>'+p.insurer+'</td><td class="num-cell">'+fmtWan(p.cov)+'万</td><td>'+p.insd+'</td><td>'+p.bene+'</td><td><span class="tag tag-lc">'+p.lc+'</span></td></tr>';
- }).join('');
- }
- window.favSwitchMember=function(id){
- _CUR_MEMBER=id; favRenderMemberPills(); favRenderPolicies();
- var m=_FAV.members.find(function(x){return x.id===id;});
- var d=document.getElementById('favMemberDesc'); if(d&&m) d.innerHTML='📋 当前查看:<b>'+m.name+'</b> · '+m.desc;
- };
- function favRenderLifecycle(){
- var fam=_FAV; var needs=activeNeeds(fam);
- var html=['accumulate','legacy'].map(function(sk){
- var s=STAGE_META[sk];
- var stageNeeds=needs.filter(function(n){return n.stage===sk;});
- var body='<div class="gap-list">'+stageNeeds.map(function(n){return gapRow(n, pkColor(n.pk));}).join('')+'</div>';
- return '<div class="lc-stage"><div class="lc-en">'+s.en+'</div><h3>'+s.name+'</h3><div class="lc-needs-note">'+s.note+'</div>'+body+'</div>';
- }).join('');
- var box=document.getElementById('favLcBody'); if(box){ box.innerHTML='<div class="lc-track">'+html+'</div>'; animateGaps(); }
- }
- function favRenderPyramid(){
- var fam=_FAV; var pyrNeeds=fam.needs.filter(function(n){return n.pk;});
- var byPk={}; pyrNeeds.forEach(function(n){byPk[n.pk]=n;});
- var rows=['high','mid','base'].map(function(rt){
- var t=RTIER_META[rt];
- var segsInTier=PYRAMID_SEGS.filter(function(s){return s.rtier===rt;});
- var inner=segsInTier.map(function(s){var n=byPk[s.pk];return n?gapRow(n,pkColor(s.pk)):'';}).join('');
- if(!inner)return '';
- return '<div class="rtier-group" style="--rt-c:'+t.c+';--rt-bg:'+t.bg+';--rt-bd:'+t.bd+'"><div class="rtier-cap"><span class="rtier-name">'+t.short+'</span><span class="rtier-desc">'+t.desc+'</span></div><div class="gap-list">'+inner+'</div></div>';
- }).join('');
- var waterLabel=WATER_ON?'💧 水位·实际覆盖':'💧 水位·满色对照';
- var box=document.getElementById('favPyrBody'); if(!box)return;
- box.innerHTML='<div class="pyr-wrap"><div class="pyr-svg-col"><div class="pyr-controls"><button class="pc-toggle" data-on="'+(WATER_ON?1:0)+'" onclick="window.favToggleWater()" title="水位开关"><span class="tg-dot"></span>'+waterLabel+'</button></div>'+buildPyramidSVG(byPk)+'</div><div class="pyr-gap-col"><div class="pyr-note">按风险三分:基础(保命) · 中端(保钱) · 高端(传承) · 💧水位=实际覆盖率</div>'+rows+'</div></div>';
- animateGaps();
- }
- window.favToggleWater=function(){ WATER_ON=!WATER_ON; favRenderPyramid(); };
- // [2026-07-12] 供 IC 现有金字塔三层行点击展开:返回某风险层(high/mid/base)各险种明细缺口条 HTML
- window.favTierDetailHTML=function(rtier){
- var fam = buildFAVFamilyFromIC();
- var byPk={}; fam.needs.forEach(function(n){ if(n.pk) byPk[n.pk]=n; });
- var segsInTier = PYRAMID_SEGS.filter(function(s){ return s.rtier===rtier; });
- var inner = segsInTier.map(function(s){ var n=byPk[s.pk]; return n?gapRow(n, pkColor(s.pk)):''; }).join('');
- return inner ? '<div class="gap-list">'+inner+'</div>' : '<div class="fav-note">该层暂无险种数据</div>';
- };
- window.favUpdateAll=function(){
- _FAV = buildFAVFamilyFromIC();
- _CUR_MEMBER='avg';
- favRenderMemberPills(); favRenderPolicies(); favRenderLifecycle();
- var d=document.getElementById('favMemberDesc'); if(d) d.innerHTML='📋 当前查看:<b>家族总览</b> · 显示家庭全部保单记录';
- };
- })();
- </script>
- <!-- [2026-07-12 移植] 三环解释弹窗 popover (脱离 #result, 不被 Tab 引擎抓取) -->
- <div class="v01-ring-popover-overlay" id="v01RingPopover" onclick="v01ClosePopover(event)">
- <div class="v01-ring-popover" onclick="event.stopPropagation()">
- <button class="v01-pop-close" onclick="v01ClosePopover()">×</button>
- <div class="v01-pop-icon" id="v01PopIcon">◆</div>
- <div class="v01-pop-label" id="v01PopLabel">视角 · 维度</div>
- <div class="v01-pop-title" id="v01PopTitle">维度名</div>
- <div class="v01-pop-score-row">
- <div class="v01-pop-score-num" id="v01PopScoreNum">—</div>
- <div class="v01-pop-score-unit">/100</div>
- <div class="v01-pop-score-status" id="v01PopScoreStatus"></div>
- </div>
- <div class="v01-pop-section">
- <div class="v01-pop-section-label">📐 计算公式</div>
- <div class="v01-pop-formula" id="v01PopFormula">—</div>
- </div>
- <div class="v01-pop-section">
- <div class="v01-pop-section-label">💡 含义</div>
- <div class="v01-pop-text" id="v01PopText">—</div>
- </div>
- <div class="v01-pop-actions">
- <!-- [v0.1 + 2026-06-27] popup 内"📚 教学版 v4.7"按钮已删除 -->
- <button class="v01-pop-action-btn" onclick="v01ClosePopover()">关闭</button>
- </div>
- </div>
- </div>
- </body>
- </html>
|