InsuranceCalculator.html 526 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width,initial-scale=1.0">
  6. <title>保额计算器 v5.1 · 7 险种 · 意外险定位伤残保障 · 与定寿差异化 · Benchmark Wealth</title>
  7. <link rel="preconnect" href="https://fonts.googleapis.com">
  8. <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  9. <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">
  10. <!-- Fraunces 品牌字体 base64 内嵌兜底(Google Fonts 访问不到时仍显示 · 2026-07-16) -->
  11. <link href="data/cy-font-fraunces.css" rel="stylesheet">
  12. <style>
  13. /* Insurance Calculator v4.5 · 60 年生命周期净现金流 · Canvas 双向柱(支出向上+领取向下) · 养老月领 + 教育金返还 · 退休点垂直分割线 · 净现金流 tooltip · 对齐 Benchmark Wealth Platform */
  14. :root{
  15. --accent:#9B7C3A; --accent-light:#B89A52; --accent-deep:#7A6028;
  16. --accent-dim:rgba(155,124,58,.08); --gold-pale:#ECEEE9;
  17. --bg:#FAFAF7; --bg2:#FFFFFF; --bg3:#E7E9E3;
  18. --text:#1A0F05; --text-dim:#6B5239; --text-bright:#0A0908;
  19. --card:#FFFFFF;
  20. --card-bg:#FFFFFF;
  21. --border:#E8DFC8; --border-strong:#C8BC9F;
  22. --c-red:#A61C2B; --c-red-light:#E87070;
  23. --c-yellow:#B88B40; --c-yellow-light:#D4A040;
  24. --c-blue:#3D6F8C; --c-blue-light:#6DA3C0;
  25. --c-green:#2D6A4F; --c-green-light:#5DB890;
  26. --c-purple:#6B4A7C;
  27. --radius:8px;
  28. /* [v4.8] 方案 A 全宽 band 配套 token */
  29. --gold-soft:rgba(90,105,120,0.05); /* [2026-07-12 转冷] L2 段落底 · 原暖金 rgba(155,124,58,.05) → 冷灰蓝,对齐 FAV 冷调 */
  30. --gold-mid:rgba(155,124,58,0.18); /* L2 段落上下金线 */
  31. /* ════════════════════════════════════════════════════════════════════
  32. [v4.8 · 2026-06-26] 三档 band 底色调色板(Jack 调试后定版)
  33. 用法:在任何 .ic-section / wrap 类元素的 background 上引用
  34. ──────────────────────────────────────────────────────────────────
  35. | 提示词 | Token | 色值 | 体感 |
  36. |------------------|--------------------|--------------|------------|
  37. | 白带 / 白底 | --band-white | #FFFFFF | 纯白 |
  38. | 奶白带 / 极浅金带 | --band-cream | #F7F1E6 | 几乎纯白+暖底 |
  39. | 浅金带 / 香槟带 | --band-pale-gold | #F3EDE2 | 可识别浅金 |
  40. ──────────────────────────────────────────────────────────────────
  41. 之外仍可用 var(--bg) #FAF8F4 默认 L0 暖底 / var(--gold-soft) §4 L2 金调
  42. ════════════════════════════════════════════════════════════════════ */
  43. --band-white: #FFFFFF;
  44. --band-cream: #F4F5F1;
  45. --band-pale-gold:#EDEFE9;
  46. /* === 字体系统(Benchmark Wealth Platform 对齐 v2026-06-12) === */
  47. --font-sans: 'Inter', 'Noto Sans SC', 'PingFang SC', system-ui, sans-serif;
  48. --font-serif: 'Cormorant Garamond', 'Noto Serif SC', Georgia, serif;
  49. --font-brand: 'Fraunces', 'Cormorant Garamond', 'Noto Serif SC', Georgia, serif;
  50. --font-display: 'Playfair Display', 'Noto Serif SC', Georgia, serif;
  51. --font-eb: 'EB Garamond', 'Cormorant Garamond', 'Noto Serif SC', Georgia, serif;
  52. --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  53. --font-num: 'Cormorant Garamond', 'Noto Serif SC', Georgia, serif;
  54. }
  55. *,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
  56. html{font-size:16px;-webkit-text-size-adjust:100%}
  57. body{font-family:var(--font-sans);
  58. background:var(--bg);color:var(--text);min-height:100vh;line-height:1.7;letter-spacing:.2px}
  59. /* === 数字渲染 · Benchmark Wealth 对齐(900 + -0.04em + lining-nums tabular-nums) === */
  60. .num-luxury,
  61. .pc-amount,
  62. .life-track-amount,
  63. .rc-tile-value,
  64. .gap-amount,
  65. .gap-amount .gap-num,
  66. .hero-stat .num,
  67. .metric-num{
  68. font-family:var(--font-num);
  69. font-feature-settings:'lnum' 1,'tnum' 1;
  70. font-variant-numeric:lining-nums tabular-nums;
  71. font-weight:900;
  72. letter-spacing:-0.04em;
  73. line-height:1;
  74. }
  75. /* 中等字号数字(同样 OpenType 但字重 700) */
  76. .gc-pct,.le-age,.ce-age,.product-meta .v,.dual-track-summary .ratio,
  77. .bar-meta .v,.pc-bar-meta .v,.r-tile .num,
  78. .timeline-day,.tl-stat .num,.ctx-meta,
  79. .cet-meta strong,.lt-count{
  80. font-family:var(--font-num);
  81. font-feature-settings:'lnum' 1,'tnum' 1;
  82. font-variant-numeric:lining-nums tabular-nums;
  83. font-weight:700;
  84. letter-spacing:-0.02em;
  85. }
  86. /* === 标题层级 · Playfair Display + Inter === */
  87. .hero h1{
  88. font-family:var(--font-display);
  89. font-weight:800;
  90. letter-spacing:-1.2px;
  91. line-height:1.12;
  92. }
  93. .persona-title,
  94. .gap-chart-title,
  95. .uhnw-title,
  96. .brand-text .t1{
  97. font-family:var(--font-display);
  98. font-weight:700;
  99. letter-spacing:-0.3px;
  100. }
  101. .section-head .sh-title,
  102. .pc-title{
  103. font-family:var(--font-sans);
  104. font-weight:600;
  105. letter-spacing:-0.2px;
  106. }
  107. .brand-text .t2,
  108. .pc-tag,
  109. .persona-eyebrow,
  110. .hero-eyebrow,
  111. .rc-eyebrow{
  112. font-family:var(--font-sans);
  113. font-weight:700;
  114. letter-spacing:1.5px;
  115. }
  116. /* === 顶栏 === */
  117. .topbar{position:sticky;top:0;z-index:100;background:#FFFFFF;
  118. border-bottom:1px solid var(--border);padding:14px 32px;
  119. display:flex;align-items:center;justify-content:space-between;
  120. box-shadow:0 2px 8px rgba(196,151,58,.06)}
  121. .brand{display:flex;align-items:center;gap:12px}
  122. .brand-logo{width:34px;height:34px;flex-shrink:0;display:flex;align-items:center;justify-content:center}
  123. .brand-logo svg{width:100%;height:100%;display:block}
  124. .brand-text{display:flex;flex-direction:column}
  125. .brand-text .t1{font-size:14px;font-weight:600;color:var(--text);font-family:var(--font-brand)}
  126. .brand-text .t2{font-size:10px;color:var(--text-dim);letter-spacing:2px;text-transform:uppercase}
  127. .agent-badge{background:linear-gradient(135deg,#A61C2B,#8B1C15);color:#fff;
  128. padding:3px 10px;border-radius:100px;font-size:10px;font-weight:700;letter-spacing:1px;
  129. margin-left:10px}
  130. .topbar-right{display:flex;align-items:center;gap:12px;font-size:12px;color:var(--text-dim)}
  131. .back-link{color:var(--accent);text-decoration:none;font-weight:500;padding:6px 12px;
  132. border-radius:6px;border:1px solid var(--border);transition:all .2s;cursor:pointer}
  133. .back-link:hover{background:var(--accent-dim);border-color:var(--accent)}
  134. .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}
  135. .ah-nav-btn:hover{opacity:.88}
  136. /* === ctx-bar 当前客户 === */
  137. .ctx-bar{background:linear-gradient(90deg,rgba(196,151,58,.08),rgba(196,151,58,.02));
  138. border-bottom:1px solid var(--border);padding:12px 32px;
  139. display:none;align-items:center;gap:12px;font-size:13px;color:var(--text-dim);flex-wrap:wrap}
  140. .ctx-bar.active{display:flex}
  141. .ctx-icon{font-size:16px}
  142. .ctx-name{font-weight:600;color:var(--text)}
  143. .ctx-portrait{font-size:11px;color:#fff;background:linear-gradient(135deg,#A61C2B,#8B1C15);
  144. padding:2px 8px;border-radius:8px;letter-spacing:.5px;display:none}
  145. .ctx-meta{color:var(--accent);font-weight:600;font-family:'Cormorant Garamond',serif;
  146. font-feature-settings:"lnum","tnum"}
  147. .ctx-actions{margin-left:auto;display:flex;gap:8px}
  148. .ctx-btn{font-size:12px;padding:5px 10px;border-radius:6px;border:1px solid var(--border);
  149. background:#fff;color:var(--text-dim);cursor:pointer;transition:all .15s;
  150. font-family:'Noto Serif SC',serif}
  151. .ctx-btn:hover{border-color:var(--accent);color:var(--accent)}
  152. .ctx-btn.primary{background:var(--accent);color:#fff;border-color:var(--accent)}
  153. .ctx-btn.primary:hover{background:var(--accent-deep)}
  154. /* === 容器 === */
  155. /* [2026-07-12 左固定向右铺满 · 参照 Dashboard v2.4 但去上限]
  156. 改总闸:全界面卡片统一贴主区左侧,向右铺满整个主区(右侧仅留 32px padding 边距),不居中、无宽度上限。
  157. .container 是 .cy-main(grid 1fr 列)直接子级,margin:0 → 左贴侧栏右沿、宽度自动=主区可用宽,
  158. 永远不钻侧栏;屏幕越宽卡片越宽,右侧不再有大留白。
  159. 如需回到"最宽封顶"模式,把 max-width:none 改成具体像素即可(如 1600px)。 */
  160. .container{max-width:none;margin:0;padding:32px 32px 60px}
  161. /* === Hero v3.0 旗舰风格(横线 eyebrow + italic gold span + 4rem h1 · 同源 Benchmark Wealth HTML v3.0)=== */
  162. .hero{text-align:center;padding:64px 0 40px;border-bottom:1px solid var(--border);margin-bottom:32px;position:relative}
  163. .hero-eyebrow{display:inline-flex;align-items:center;gap:14px;
  164. font-size:10.5px;letter-spacing:3.5px;text-transform:uppercase;
  165. color:var(--accent);font-weight:600;margin-bottom:24px;font-family:var(--font-sans);
  166. background:none;padding:0;border-radius:0}
  167. .hero-eyebrow::before,
  168. .hero-eyebrow::after{content:'';width:32px;height:1px;background:var(--accent-light);opacity:.5}
  169. .hero h1{font-family:var(--font-display);font-size:4rem;
  170. font-weight:800;line-height:1.12;letter-spacing:-1.5px;margin-bottom:18px;
  171. color:var(--text-bright);
  172. background:none;-webkit-text-fill-color:initial;background-clip:initial;-webkit-background-clip:initial}
  173. .hero h1 .gold{
  174. font-family:var(--font-eb);font-style:italic;color:var(--accent);font-weight:700}
  175. .hero h1 .hero-h1-strong{
  176. background:none;-webkit-background-clip:initial;background-clip:initial;
  177. -webkit-text-fill-color:var(--text-bright);color:var(--text-bright);
  178. font-feature-settings:'lnum' 1,'tnum' 1;font-variant-numeric:lining-nums tabular-nums}
  179. .hero h2{font-family:var(--font-eb);font-style:italic;font-size:18px;
  180. color:var(--text-dim);margin-bottom:24px;letter-spacing:.2px;font-weight:500}
  181. .hero-pills{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin-top:6px}
  182. .hero-pill{padding:5px 14px;border-radius:100px;border:1px solid var(--border);
  183. font-size:11.5px;color:var(--text-dim);background:#fff;font-family:var(--font-sans);font-weight:500;transition:all .2s}
  184. .hero-pill:hover{border-color:var(--accent);color:var(--accent);background:var(--accent-dim)}
  185. /* === 段标题 === */
  186. .section-head{display:flex;align-items:baseline;gap:14px;margin:32px 0 18px;
  187. border-bottom:1px solid var(--border);padding-bottom:8px}
  188. /* === 段 0 · 预设画像快速导入 === */
  189. /* === v3.5.2 · CTA 整体黑色渐变(机构级 UHNW · 香槟金边 · 同源 Benchmark Wealth sidebar/Demo Portal)
  190. v3.5.5 · 反转色序: 左上深→右下暖(暗角在左,光在右下)· 三段 stops · 已上升为 Skill 默认 === */
  191. .persona-section{background:linear-gradient(135deg,#080503 0%,#1A1208 50%,#2D2010 100%);
  192. border:1px solid rgba(155,124,58,0.18);border-left:5px solid var(--accent);
  193. border-radius:var(--radius);padding:20px 26px;margin-bottom:20px;
  194. box-shadow:0 6px 24px rgba(0,0,0,0.35),inset 0 0 0 1px rgba(155,124,58,0.05);
  195. transition:padding .2s ease}
  196. .persona-section.collapsed{padding-bottom:18px}
  197. .persona-section.collapsed .persona-subtitle,
  198. .persona-section.collapsed .persona-tier-row,
  199. .persona-section.collapsed .persona-section-tip{display:none}
  200. .persona-toggle{margin-left:auto;background:rgba(255,255,255,0.04);
  201. border:1px solid rgba(155,124,58,0.30);
  202. color:#C8B988;padding:5px 14px;border-radius:6px;font-size:11.5px;cursor:pointer;
  203. transition:all .15s;font-family:var(--font-sans);font-weight:600;letter-spacing:.5px;
  204. display:inline-flex;align-items:center;gap:6px}
  205. .persona-toggle:hover{border-color:var(--accent-light);color:#F5E6B8;background:rgba(155,124,58,0.10)}
  206. .persona-toggle .caret{transition:transform .2s;display:inline-block}
  207. .persona-section:not(.collapsed) .persona-toggle .caret{transform:rotate(180deg)}
  208. .persona-section.collapsed .persona-meta{display:none}
  209. .persona-section.collapsed .persona-toggle{margin-left:auto}
  210. .persona-head{display:flex;align-items:baseline;gap:12px;margin-bottom:6px;flex-wrap:wrap}
  211. .persona-eyebrow{display:inline-block;padding:3px 12px;border-radius:100px;
  212. background:linear-gradient(135deg,var(--accent),var(--accent-deep));
  213. color:#fff;font-size:10.5px;letter-spacing:1.5px;
  214. text-transform:uppercase;font-weight:600;
  215. box-shadow:0 1px 4px rgba(155,124,58,0.40)}
  216. .persona-title{font-family:var(--font-display),'Noto Serif SC',serif;font-size:1.3rem;
  217. font-weight:700;color:#F5E6B8;letter-spacing:-0.3px;
  218. font-feature-settings:'lnum' 1,'tnum' 1;font-variant-numeric:lining-nums tabular-nums}
  219. .persona-meta{font-size:11.5px;color:rgba(229,220,196,0.62);margin-left:auto}
  220. .persona-subtitle{font-size:12px;color:rgba(229,220,196,0.70);margin-bottom:14px;line-height:1.6}
  221. .persona-tier-row{margin-bottom:10px}
  222. .persona-tier-label{font-size:10.5px;color:#C8B988;font-weight:600;letter-spacing:.5px;
  223. margin-right:8px}
  224. .persona-chips{display:flex;flex-wrap:wrap;gap:8px}
  225. /* === v3.5.2 · chip 改为暖米卡片(在黑底 CTA 上形成清晰对比 · UHNW 机构感)=== */
  226. .persona-chip{background:linear-gradient(135deg,#FAF7EE 0%,#F3EDE2 100%);
  227. border:1.5px solid rgba(155,124,58,0.28);border-radius:8px;
  228. padding:8px 14px;font-size:12.5px;color:var(--text);cursor:pointer;transition:all .18s;
  229. display:inline-flex;flex-direction:column;gap:2px;font-family:'Noto Serif SC',serif;
  230. min-width:140px;text-align:left;box-shadow:0 2px 6px rgba(0,0,0,0.20)}
  231. .persona-chip:hover{border-color:var(--accent);
  232. background:linear-gradient(135deg,#FFFEF8 0%,#F3EDE2 100%);
  233. transform:translateY(-1px);
  234. box-shadow:0 6px 16px rgba(155,124,58,0.35)}
  235. .persona-chip.selected{background:linear-gradient(135deg,#F5E6B8 0%,#E5C77A 100%);
  236. border-color:var(--accent-deep);color:var(--text-bright);font-weight:600;
  237. box-shadow:0 4px 14px rgba(155,124,58,0.55),inset 0 0 0 1px rgba(255,255,255,0.30)}
  238. .persona-chip.selected::after{content:'✓';position:absolute;top:4px;right:6px;
  239. font-size:14px;color:var(--accent-deep);font-weight:700}
  240. .persona-chip{position:relative}
  241. .pc-name{font-size:13px;font-weight:600;color:var(--text);display:flex;align-items:center;gap:6px;
  242. font-family:var(--font-display),'Noto Serif SC',serif;
  243. font-feature-settings:'lnum' 1,'tnum' 1;font-variant-numeric:lining-nums tabular-nums}
  244. .pc-icon-em{font-size:14px}
  245. .pc-tag-color{display:inline-block;width:8px;height:8px;border-radius:50%;flex-shrink:0;
  246. box-shadow:0 0 0 1.5px rgba(255,255,255,0.85)}
  247. .pc-tag-color.std{background:#5DB890}
  248. .pc-tag-color.mid{background:#D4A040}
  249. .pc-tag-color.hnw{background:#A61C2B}
  250. .pc-desc{font-size:10.5px;color:var(--text-dim);line-height:1.5;
  251. font-family:var(--font-display),'Noto Serif SC',serif;
  252. font-feature-settings:'lnum' 1,'tnum' 1;font-variant-numeric:lining-nums tabular-nums}
  253. .section-head{display:flex;align-items:baseline;gap:14px;margin:32px 0 18px;
  254. border-bottom:1px solid var(--border);padding-bottom:8px}
  255. .section-head .sh-num{font-family:var(--font-display);font-size:1.8rem;color:var(--accent);font-weight:700;
  256. font-feature-settings:'lnum' 1,'tnum' 1;font-variant-numeric:lining-nums tabular-nums;letter-spacing:-0.02em}
  257. .section-head .sh-title{font-size:18px;font-weight:600;color:var(--text)}
  258. .section-head .sh-meta{font-size:12px;color:var(--text-dim);margin-left:auto}
  259. /* ════════════════════════════════════════════════════════════════════
  260. [v4.8 · 方案 A · 全宽 band] 2026-06-24
  261. 5 段表单 / 现金流 / HNW 共 7 块"通屏色条"——破容器 max-width:1200px
  262. 约束,box-shadow + clip-path 让 band 从浏览器左边到右边
  263. 保持黑岛(persona-section / result-cover)居中嵌入卡形态(Q1·A 选项)
  264. ════════════════════════════════════════════════════════════════════ */
  265. /* container 加 z-index 防止 band box-shadow 打架 */
  266. .container{position:relative;z-index:1}
  267. /* body overflow-x 保护(防 100vmax 触发横向滚动条)*/
  268. body{overflow-x:hidden}
  269. /* 通用 ic-section 基础(消除卡片决策:无圆角、无边框、无阴影、无 margin)*/
  270. .ic-section{position:relative;padding:32px 0;margin:0;
  271. border:none;border-radius:0;box-shadow:none}
  272. /* 包裹容器内的 section-head / form-grid 重置 margin · 让 band padding 接管间距 */
  273. .ic-section > .section-head{margin:0 0 18px}
  274. .ic-section > .form-grid{margin-bottom:0}
  275. .ic-section > .form-grid + *{margin-top:14px}
  276. /* L0 暖底 band(段 2 / 段 5 · 不设 bg,body --bg #FAF8F4 透出)*/
  277. .ic-section--L0{background:transparent}
  278. /* L1 白色 band(段 1 / 段 3) */
  279. .ic-section--L1{
  280. background:var(--card);
  281. box-shadow:0 0 0 100vmax var(--card);
  282. clip-path:inset(0 -100vmax)
  283. }
  284. /* [v4.8 · 2026-06-26] 奶白带 #F7F1E6 · 应用到 §3 */
  285. .ic-section--cream{
  286. background:var(--band-cream);
  287. box-shadow:0 0 0 100vmax var(--band-cream);
  288. clip-path:inset(0 -100vmax)
  289. }
  290. /* [v4.8 · 2026-06-26] 浅金带 #F3EDE2 · 应用到 §5 */
  291. .ic-section--pale-gold{
  292. background:var(--band-pale-gold);
  293. box-shadow:0 0 0 100vmax var(--band-pale-gold);
  294. clip-path:inset(0 -100vmax)
  295. }
  296. /* L2 金调 band(段 4 · 上下金线 + 浅金底)*/
  297. .ic-section--L2{
  298. background:var(--gold-soft);
  299. box-shadow:0 0 0 100vmax var(--gold-soft);
  300. clip-path:inset(0 -100vmax);
  301. /* [v4.8 · 2026-06-26] 去掉上下金线(2026-06-26 Jack 决议)*/
  302. padding:32px 0
  303. }
  304. /* L2 段标题强化(主菜锚定)*/
  305. .ic-section--L2 > .section-head .sh-title{color:var(--accent)}
  306. .ic-section--L2 > .section-head .sh-meta{color:var(--accent);font-weight:600}
  307. /* ════════════════════════════════════════════════════════════════════
  308. [v4.8 · 方案 A · 2026-06-26] §4 三层风险层 · 三卡分组(居中白卡)
  309. §4 ic-section--L2 金带内 · 3 张居中白卡(不破容器,无嵌套 clip-path bug)
  310. 每卡左侧色条对应 hero pill 三色(橙/黄/金)· 标题 + 字段全部默认可见
  311. ════════════════════════════════════════════════════════════════════ */
  312. .form-grid--risk-tiers{
  313. background:transparent;
  314. border:none;
  315. border-radius:0;
  316. padding:0;
  317. margin-bottom:0;
  318. display:block
  319. }
  320. .risk-layer-group{
  321. background:var(--card);
  322. border:1px solid var(--border);
  323. border-radius:var(--radius);
  324. padding:16px 20px;
  325. margin-bottom:14px;
  326. box-shadow:0 1px 3px rgba(15,14,12,0.04)
  327. }
  328. .risk-layer-group:last-child{margin-bottom:0}
  329. .risk-layer-head{
  330. display:flex; align-items:center; gap:8px;
  331. font-size:13px; font-weight:700;
  332. color:var(--text);
  333. margin-bottom:12px;
  334. padding-bottom:8px;
  335. border-bottom:1px dashed var(--border);
  336. font-family:var(--font-display);
  337. letter-spacing:-0.2px
  338. }
  339. .risk-layer-head .rl-meta{
  340. margin-left:auto;
  341. font-size:10.5px;
  342. font-weight:500;
  343. color:var(--text-dim);
  344. letter-spacing:0.5px;
  345. font-family:var(--font-sans);
  346. text-transform:uppercase
  347. }
  348. .risk-layer-fields{
  349. display:grid;
  350. grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  351. gap:14px
  352. }
  353. /* 三层左色条对应 hero pill */
  354. .risk-layer--basic{border-left:4px solid #E07A3B}
  355. .risk-layer--mid{border-left:4px solid #D4A93A}
  356. .risk-layer--high{border-left:4px solid #C9A84C}
  357. /* 三层 head 颜色 hint */
  358. .risk-layer--basic .risk-layer-head{color:#9B4D1F}
  359. .risk-layer--mid .risk-layer-head{color:#5A4912}
  360. .risk-layer--high .risk-layer-head{color:#5C4810}
  361. /* HNW Tabs 全宽 L2 金调 band(承接 .ic-section--L2 的视觉规则) */
  362. #hnwTabsWrap.ic-hnw-wrap{
  363. position:relative;
  364. /* [v4.8 · 2026-06-26 修正] 嵌套在 policy-card 内时,box-shadow 全宽技巧会覆盖 card 边框
  365. · 导致"终身寿"卡片出现横向断层。改为普通内嵌容器(去 box-shadow / clip-path)
  366. · bg 保留 var(--bg) 暖底 · 视觉上是 white 卡内的暖底 inset 区,无断层 */
  367. background:var(--bg);
  368. border-radius:8px;
  369. padding:20px 24px;
  370. margin:14px 0 0
  371. }
  372. /* 印刷模式:band 保持背景色,clip-path 失效就退回常规卡片 */
  373. @media print{
  374. .ic-section,.cashflow-section,#hnwTabsWrap.ic-hnw-wrap{
  375. -webkit-print-color-adjust:exact;
  376. print-color-adjust:exact;
  377. page-break-inside:avoid;
  378. break-inside:avoid;
  379. box-shadow:none;
  380. clip-path:none
  381. }
  382. }
  383. /* === 输入表单 === */
  384. .form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px;
  385. background:var(--card-bg);border:1px solid var(--border);border-radius:var(--radius);
  386. padding:20px 24px;margin-bottom:18px}
  387. .form-field{display:flex;flex-direction:column;gap:6px}
  388. .form-field label{font-size:11.5px;color:var(--text-dim);font-weight:600;letter-spacing:.5px}
  389. .form-field label .hint{color:var(--accent);font-size:10px;font-weight:500;margin-left:4px}
  390. .form-field input,.form-field select{padding:10px 14px;border:1.5px solid var(--border);border-radius:6px;
  391. font-size:14px;font-family:'Noto Serif SC','PingFang SC',serif;outline:none;transition:border-color .15s;
  392. background:#fff;color:var(--text)}
  393. .form-field input:focus,.form-field select:focus{border-color:var(--accent)}
  394. .form-field input[type="number"]::-webkit-inner-spin-button{opacity:.4}
  395. /* === 按钮 === */
  396. .calc-row{display:flex;justify-content:center;gap:12px;margin:28px 0 8px}
  397. .btn{padding:14px 32px;border-radius:6px;font-size:14px;font-weight:600;
  398. border:none;cursor:pointer;transition:all .2s;font-family:'Noto Serif SC',serif;letter-spacing:.06em}
  399. .btn-primary{background:var(--accent);color:#fff;box-shadow:0 2px 8px rgba(196,151,58,.25)}
  400. .btn-primary:hover{background:var(--accent-deep);transform:translateY(-1px);box-shadow:0 4px 14px rgba(196,151,58,.4)}
  401. .btn-ghost{background:transparent;color:var(--text-dim);border:1px solid var(--border)}
  402. .btn-ghost:hover{border-color:var(--accent);color:var(--accent)}
  403. /* === 输出区 === */
  404. #result{display:none;margin-top:32px;padding-top:32px;border-top:2px solid var(--accent)}
  405. /* ════════════════════════════════════════════════════════════════════
  406. [2026-07-12 移植] 客户家庭档案卡 · Client Profile passport
  407. 源自「家庭保障体检报告 v0.1」· 替代原「保险配置诊断」result-cover 展示位
  408. 设计灵感:私人银行 client passport · 大字 Cormorant Garamond + 金箔细节
  409. ════════════════════════════════════════════════════════════════════ */
  410. .v01-family-card{
  411. /* [2026-07-12] 跟随 .container(左固定·1480 封顶)填满宽度,不再自设 max-width */
  412. width:100%;
  413. margin:0 0 24px;
  414. padding:0;
  415. background:linear-gradient(135deg, #FFFFFF 0%, #FDFBF6 100%);
  416. border:1px solid rgba(155,124,58,.28);
  417. border-radius:14px;
  418. position:relative;overflow:hidden;
  419. box-shadow:0 8px 30px rgba(122,96,40,.10), inset 0 0 0 1px rgba(155,124,58,.05);
  420. font-family:'Noto Sans SC',sans-serif
  421. }
  422. .v01-family-card::before{
  423. content:'';position:absolute;
  424. top:-60px;right:-40px;
  425. width:240px;height:240px;
  426. background:radial-gradient(circle, rgba(155,124,58,.10) 0%, transparent 70%);
  427. pointer-events:none
  428. }
  429. .v01-family-card::after{
  430. content:'';position:absolute;
  431. bottom:-50px;left:-30px;
  432. width:200px;height:200px;
  433. background:radial-gradient(circle, rgba(155,124,58,.06) 0%, transparent 70%);
  434. pointer-events:none
  435. }
  436. /* —— 顶部 Header(左文字 · 右金环) —— */
  437. .v01-fc-header{
  438. padding:26px 40px 24px;
  439. /* [2026-07-12] 文字整卡居中 + CFPI 金环绝对定位靠右(位置不变) */
  440. display:flex;align-items:center;justify-content:center;gap:32px;
  441. text-align:center;
  442. min-height:182px; /* 预留金环高度,防其绝对定位后溢出到下方区块 */
  443. border-bottom:1px solid rgba(155,124,58,.18);
  444. position:relative;z-index:1
  445. }
  446. .v01-fc-head-text{flex:0 1 auto;min-width:0;text-align:center}
  447. .v01-fc-eyebrow{
  448. display:flex;align-items:center;justify-content:center;
  449. gap:14px;margin-bottom:14px
  450. }
  451. .v01-fc-eyebrow-line{
  452. flex:0 0 60px;height:1px;
  453. background:linear-gradient(90deg, transparent, rgba(155,124,58,.45))
  454. }
  455. .v01-fc-eyebrow-line:last-child{
  456. background:linear-gradient(90deg, rgba(155,124,58,.45), transparent)
  457. }
  458. .v01-fc-eyebrow-text{
  459. font-size:10.5px;letter-spacing:3.5px;
  460. color:#7A6028;
  461. text-transform:uppercase;font-weight:600;
  462. font-family:'Cormorant Garamond','Noto Serif SC',serif
  463. }
  464. .v01-fc-title{
  465. font-family:'Cormorant Garamond','Noto Serif SC',serif;
  466. font-size:2.4rem;font-weight:700;
  467. color:#1A0F05;letter-spacing:-0.5px;line-height:1.1;
  468. margin:0 0 10px 0
  469. }
  470. .v01-fc-subtitle{
  471. font-size:12.5px;
  472. color:rgba(61,41,20,.65);
  473. letter-spacing:.5px;line-height:1.7;
  474. font-family:'EB Garamond','Cormorant Garamond',serif;
  475. font-style:italic;
  476. margin:0
  477. }
  478. /* —— CFPI 金环仪表盘(右侧·绝对定位,位置不变) —— */
  479. .v01-cfpi-gauge{
  480. display:inline-flex;align-items:center;gap:18px;
  481. /* [2026-07-12] 绝对定位靠右垂直居中 → 文字块可相对整卡居中,金环视觉位置不动。
  482. 用 top/bottom:0 + margin:auto 居中,不用 transform(避让入场动画 scale 关键帧)。 */
  483. position:absolute;right:40px;top:0;bottom:0;margin-top:auto;margin-bottom:auto;
  484. height:fit-content;
  485. /* [2026-07-12] 去掉胶囊外壳:无背景/无边框/无圆角/无内边距,只留金环本体 */
  486. padding:0;
  487. background:none;
  488. border:none;
  489. border-radius:0
  490. }
  491. .v01-cfpi-ring{position:relative;width:104px;height:104px;flex:0 0 auto}
  492. .v01-cfpi-ring svg{transform:rotate(-90deg)}
  493. .v01-cfpi-ring-track{fill:none;stroke:rgba(155,124,58,.16);stroke-width:9}
  494. .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)}
  495. .v01-cfpi-ring-center{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center}
  496. .v01-cfpi-ring-num{font-family:'Cormorant Garamond',serif;font-size:2rem;font-weight:900;color:#3D2914;line-height:1;letter-spacing:-0.03em}
  497. .v01-cfpi-ring-max{font-size:9.5px;color:rgba(61,41,20,.5);letter-spacing:.5px;margin-top:2px}
  498. .v01-cfpi-meta{display:flex;flex-direction:column;align-items:flex-start;gap:7px;text-align:left}
  499. .v01-cfpi-meta-eyebrow{font-size:9px;letter-spacing:2px;color:rgba(155,124,58,.75);text-transform:uppercase;font-weight:600}
  500. .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)}
  501. .v01-cfpi-badge.is-warn{background:rgba(166,102,16,.10);color:#A66610;border-color:rgba(166,102,16,.30)}
  502. .v01-cfpi-badge.is-bad{background:rgba(166,28,43,.10);color:#A61C2B;border-color:rgba(166,28,43,.30)}
  503. .v01-cfpi-meta-desc{font-size:11px;color:rgba(61,41,20,.6);line-height:1.5;max-width:180px}
  504. /* —— 三柱核心指标 —— */
  505. .v01-fc-metrics{
  506. display:flex;align-items:stretch;
  507. padding:22px 40px;
  508. border-bottom:1px solid rgba(155,124,58,.14);
  509. position:relative;z-index:1
  510. }
  511. .v01-fc-metric{
  512. flex:1;text-align:center;
  513. padding:0 12px; /* [2026-07-12 5柱化] 18px→12px 让 5 柱更从容 */
  514. min-width:0
  515. }
  516. .v01-fc-metric-label{
  517. font-size:9.5px;letter-spacing:2.5px;
  518. color:rgba(155,124,58,.75);
  519. text-transform:uppercase;font-weight:600;
  520. margin-bottom:10px
  521. }
  522. .v01-fc-metric-value{
  523. font-family:'Cormorant Garamond','Noto Serif SC',serif;
  524. font-size:2.4rem;font-weight:900;
  525. color:#3D2914;
  526. letter-spacing:-0.04em;line-height:1;
  527. font-feature-settings:'lnum' 1,'tnum' 1;
  528. font-variant-numeric:lining-nums tabular-nums;
  529. margin-bottom:8px
  530. }
  531. .v01-fc-metric-value-text{font-size:1.6rem;letter-spacing:-0.02em}
  532. .v01-fc-metric-sub{
  533. font-size:11px;
  534. color:rgba(61,41,20,.55);
  535. letter-spacing:.5px
  536. }
  537. .v01-fc-metric-divider{
  538. width:1px;
  539. background:linear-gradient(180deg, transparent, rgba(155,124,58,.30), transparent);
  540. margin:6px 0
  541. }
  542. /* —— 资产 4 盘 chip 行 —— */
  543. .v01-fc-assets{
  544. display:flex;flex-wrap:wrap;gap:8px;
  545. padding:18px 40px;
  546. border-bottom:1px solid rgba(155,124,58,.14);
  547. position:relative;z-index:1;
  548. justify-content:center
  549. }
  550. .v01-fc-asset-chip{
  551. display:inline-flex;align-items:center;gap:8px;
  552. padding:7px 14px;
  553. background:rgba(155,124,58,.07);
  554. border:1px solid rgba(155,124,58,.25);
  555. border-radius:100px;
  556. font-size:11.5px;color:rgba(61,41,20,.85);
  557. font-family:'Noto Sans SC',sans-serif;
  558. transition:all .18s ease
  559. }
  560. .v01-fc-asset-chip:hover{
  561. background:rgba(155,124,58,.16);
  562. border-color:rgba(155,124,58,.55);
  563. transform:translateY(-1px);
  564. box-shadow:0 4px 14px rgba(155,124,58,.15)
  565. }
  566. .v01-fc-asset-chip-icon{font-size:13px}
  567. .v01-fc-asset-chip-val{
  568. color:#9B7C3A;font-weight:700;
  569. font-family:'Cormorant Garamond',serif;
  570. font-feature-settings:'lnum' 1,'tnum' 1;
  571. letter-spacing:-0.02em
  572. }
  573. /* —— 7 险种保单网格 —— */
  574. .v01-fc-policies-head{
  575. display:flex;align-items:center;gap:10px;
  576. padding:16px 40px 12px;
  577. font-size:11.5px;color:rgba(155,124,58,.8);
  578. letter-spacing:1.5px;text-transform:uppercase;font-weight:600
  579. }
  580. .v01-fc-policies-icon{font-size:14px}
  581. .v01-fc-policies-grid{
  582. display:grid;grid-template-columns:repeat(7, 1fr);
  583. gap:0;
  584. margin:0 40px 24px;
  585. background:#FFFDF7;
  586. border-radius:8px;overflow:hidden;
  587. position:relative;z-index:1
  588. }
  589. .v01-fc-policy{
  590. background:#FFFDF7;
  591. padding:14px 8px;
  592. text-align:center;
  593. transition:transform .2s ease, background .2s ease
  594. }
  595. /* 每个险种间加分隔线(第 1 个之外均加左线) · 无外框 */
  596. .v01-fc-policy + .v01-fc-policy{
  597. border-left:1px solid rgba(155,124,58,.20)
  598. }
  599. .v01-fc-policy:hover{
  600. transform:translateY(-2px);
  601. background:rgba(155,124,58,.06)
  602. }
  603. .v01-fc-policy-icon{font-size:18px;margin-bottom:6px;line-height:1}
  604. .v01-fc-policy-name{
  605. font-size:10.5px;color:rgba(61,41,20,.62);
  606. letter-spacing:1px;margin-bottom:6px;font-weight:600
  607. }
  608. .v01-fc-policy-val{
  609. font-family:'Cormorant Garamond',serif;
  610. font-size:14px;font-weight:700;
  611. color:#3D2914;letter-spacing:-0.02em;
  612. font-feature-settings:'lnum' 1,'tnum' 1
  613. }
  614. .v01-fc-policy.is-empty .v01-fc-policy-icon{opacity:.35}
  615. .v01-fc-policy.is-empty .v01-fc-policy-val{color:#A61C2B;font-family:'Noto Sans SC';font-size:13px;font-weight:600}
  616. .v01-fc-policy.is-covered .v01-fc-policy-val{color:#2D6A4F}
  617. /* —— 进场动画 —— */
  618. @keyframes v01fcFadeUp{from{opacity:0;transform:translateY(28px)}to{opacity:1;transform:translateY(0)}}
  619. @keyframes v01fcSlideRight{from{opacity:0;transform:translateX(-32px)}to{opacity:1;transform:translateX(0)}}
  620. @keyframes v01fcFadeIn{from{opacity:0;transform:scale(0.96)}to{opacity:1;transform:scale(1)}}
  621. @keyframes v01fcEyebrowExpand{from{opacity:0;letter-spacing:0px;transform:scale(0.85)}to{opacity:1;letter-spacing:5px;transform:scale(1)}}
  622. @keyframes v01fcGlow{
  623. 0%, 100%{box-shadow:0 8px 30px rgba(122,96,40,.10), inset 0 0 0 1px rgba(155,124,58,.05)}
  624. 50%{box-shadow:0 12px 40px rgba(155,124,58,.28), inset 0 0 0 1px rgba(155,124,58,.18)}
  625. }
  626. .v01-family-card{animation:v01fcFadeUp .45s cubic-bezier(.2,.7,.3,1) both, v01fcGlow 3.5s ease-in-out .8s infinite}
  627. .v01-fc-eyebrow{animation:v01fcEyebrowExpand .45s ease-out .12s both}
  628. .v01-fc-title{animation:v01fcFadeUp .4s cubic-bezier(.2,.7,.3,1) .24s both}
  629. .v01-fc-subtitle{animation:v01fcFadeUp .35s cubic-bezier(.2,.7,.3,1) .34s both}
  630. .v01-cfpi-gauge{animation:v01fcFadeIn .4s ease-out .42s both}
  631. .v01-fc-metrics > .v01-fc-metric:nth-child(1){animation:v01fcSlideRight .38s cubic-bezier(.2,.7,.3,1) .46s both}
  632. .v01-fc-metrics > .v01-fc-metric:nth-child(3){animation:v01fcSlideRight .38s cubic-bezier(.2,.7,.3,1) .54s both}
  633. .v01-fc-metrics > .v01-fc-metric:nth-child(5){animation:v01fcSlideRight .38s cubic-bezier(.2,.7,.3,1) .62s both}
  634. /* [2026-07-12 提案① 5柱化] 已配置保额(7)/保障缺口(9) 续接 stagger */
  635. .v01-fc-metrics > .v01-fc-metric:nth-child(7){animation:v01fcSlideRight .38s cubic-bezier(.2,.7,.3,1) .70s both}
  636. .v01-fc-metrics > .v01-fc-metric:nth-child(9){animation:v01fcSlideRight .38s cubic-bezier(.2,.7,.3,1) .78s both}
  637. .v01-fc-asset-chip{animation:v01fcFadeIn .35s ease-out both}
  638. .v01-fc-asset-chip:nth-child(1){animation-delay:.74s}
  639. .v01-fc-asset-chip:nth-child(2){animation-delay:.80s}
  640. .v01-fc-asset-chip:nth-child(3){animation-delay:.86s}
  641. .v01-fc-asset-chip:nth-child(4){animation-delay:.92s}
  642. .v01-fc-policy{animation:v01fcFadeIn .35s ease-out both}
  643. .v01-fc-policy:nth-child(1){animation-delay:1.00s}
  644. .v01-fc-policy:nth-child(2){animation-delay:1.06s}
  645. .v01-fc-policy:nth-child(3){animation-delay:1.12s}
  646. .v01-fc-policy:nth-child(4){animation-delay:1.18s}
  647. .v01-fc-policy:nth-child(5){animation-delay:1.24s}
  648. .v01-fc-policy:nth-child(6){animation-delay:1.30s}
  649. .v01-fc-policy:nth-child(7){animation-delay:1.36s}
  650. @media (max-width:900px){
  651. .v01-fc-title{font-size:1.8rem}
  652. .v01-fc-metrics{flex-direction:column;gap:18px}
  653. .v01-fc-metric-divider{display:none}
  654. .v01-fc-metric-value{font-size:1.8rem}
  655. .v01-fc-policies-grid{grid-template-columns:repeat(4, 1fr)}
  656. /* [2026-07-12] 窄屏金环回归文档流,改上下堆叠,避免绝对定位盖住居中文字 */
  657. .v01-fc-header{flex-direction:column;min-height:0}
  658. .v01-cfpi-gauge{position:static;margin:16px auto 0}
  659. }
  660. /* === v3.5.3 · 计算结果 HERO 改深机构黑(对齐 CTA + Demo Portal 黑金调性)
  661. v3.5.5 · 反转色序: 左上深→右下暖 · 三段 stops · 已上升为 Skill 默认 === */
  662. .result-cover{background:linear-gradient(135deg,#080503 0%,#1A1208 50%,#2D2010 100%);border-radius:12px;
  663. padding:28px 32px;margin-bottom:24px;color:#fff;
  664. box-shadow:0 12px 40px rgba(0,0,0,0.40),inset 0 0 0 1px rgba(155,124,58,0.10)}
  665. .rc-eyebrow{font-size:11px;letter-spacing:2.5px;text-transform:uppercase;opacity:.55;margin-bottom:8px}
  666. .rc-title{font-family:var(--font-display),'Noto Serif SC',serif;font-size:1.7rem;font-weight:700;
  667. color:#F5E6B8;margin-bottom:6px;line-height:1.3;letter-spacing:-0.3px;
  668. font-feature-settings:'lnum' 1,'tnum' 1;font-variant-numeric:lining-nums tabular-nums}
  669. .rc-subtitle{font-size:13px;opacity:.7;margin-bottom:20px}
  670. .rc-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:14px;
  671. padding-top:18px;border-top:1px solid rgba(196,151,58,.2)}
  672. .rc-tile{}
  673. .rc-tile-label{font-size:10.5px;color:#C4973A;letter-spacing:1.5px;text-transform:uppercase;
  674. font-weight:600;margin-bottom:6px}
  675. .rc-tile-value{font-family:'Cormorant Garamond',serif;font-size:2.2rem;font-weight:900;
  676. color:#F5E6B8;font-feature-settings:"lnum","tnum";line-height:1;letter-spacing:-0.04em}
  677. .rc-tile-sub{font-size:11px;opacity:.55;margin-top:4px}
  678. /* === v4.0 三栏汇总 · 颜色区分(口径分离) === */
  679. .rc-summary-v4{grid-template-columns:repeat(auto-fit,minmax(180px,1fr))}
  680. .rc-tile-onetime .rc-tile-label{color:#C4973A}
  681. .rc-tile-onetime .rc-tile-value{color:#F5E6B8}
  682. .rc-tile-longterm .rc-tile-label{color:#8FB9D6}
  683. .rc-tile-longterm .rc-tile-value{color:#B8D4E8}
  684. .rc-tile-cost .rc-tile-label{color:#E5827A;font-weight:700}
  685. .rc-tile-cost .rc-tile-value{color:#F5B0A8}
  686. .rc-tile-leverage .rc-tile-label{color:#A0C9A8}
  687. .rc-tile-leverage .rc-tile-value{color:#C8E0CC}
  688. /* [v4.7 + Jack 2026-06-21] 保障缺口 tile · 暖琥珀强调差距语义 */
  689. .rc-tile-gap .rc-tile-label{color:#E5A654;font-weight:700;letter-spacing:.5px}
  690. .rc-tile-gap .rc-tile-value{color:#F5C988;text-shadow:0 0 12px rgba(229,166,84,.25)}
  691. .rc-tile-gap{position:relative}
  692. .rc-tile-gap::before{content:"⚠";position:absolute;top:8px;right:10px;font-size:14px;color:rgba(229,166,84,.5)}
  693. /* === 7 险种卡片 · v3.0 v1.2 嵌套 grid 让金字塔三层强制分行 === */
  694. .policy-grid{display:flex;flex-direction:column;gap:20px;margin-bottom:24px}
  695. .tier-row{display:grid;gap:16px}
  696. .tier-row.tier-base,.tier-row.tier-mid{grid-template-columns:repeat(3,1fr)}
  697. .tier-row.tier-high{grid-template-columns:1fr}
  698. /* P2.3 中间屏(900-1200)2+1 布局 · 大屏 3 列 · 小屏 1 列 */
  699. @media (max-width:1200px) and (min-width:901px){
  700. .tier-row.tier-base,.tier-row.tier-mid{grid-template-columns:repeat(2,1fr)}
  701. /* 第三张卡片(单独一行,占满)·横向居中 */
  702. .tier-row.tier-base > .policy-card:nth-child(3),
  703. .tier-row.tier-mid > .policy-card:nth-child(3){
  704. grid-column:span 2;max-width:680px;margin-left:auto;margin-right:auto;width:100%;
  705. }
  706. }
  707. @media (max-width:900px){
  708. .tier-row.tier-base,.tier-row.tier-mid{grid-template-columns:1fr}
  709. }
  710. .tier-banner-row{
  711. display:flex;align-items:center;gap:14px;
  712. padding:10px 16px;border-radius:8px;
  713. font-size:12.5px;font-weight:600;letter-spacing:0.5px;
  714. border-left:4px solid;
  715. margin-bottom:-6px;
  716. }
  717. .tier-banner-row .tb-emoji{font-size:18px}
  718. .tier-banner-row .tb-meta{font-size:10.5px;opacity:0.8;font-weight:400}
  719. .tier-banner-row.tb-base{background:#FBE3D2;border-color:#E07A3B;color:#6B3416}
  720. .tier-banner-row.tb-mid{background:#F5EBC8;border-color:#D4A93A;color:#5A4912}
  721. .tier-banner-row.tb-high{background:#EFE3F5;border-color:#7A3FA0;color:#3B1A52}
  722. /* === v2026-06-13 v1.4 · 三层 banner 覆盖率进度条 === */
  723. .tier-banner-row .tb-progress{
  724. margin-left:auto;display:flex;align-items:center;gap:10px;
  725. min-width:200px;
  726. }
  727. .tier-banner-row .tb-bar-track{
  728. flex:1;height:8px;background:rgba(0,0,0,0.08);border-radius:100px;overflow:hidden;
  729. box-shadow:inset 0 1px 2px rgba(0,0,0,0.06);
  730. }
  731. .tier-banner-row .tb-bar-fill{
  732. height:100%;border-radius:100px;
  733. transition:width 0.8s cubic-bezier(0.22,1,0.36,1);
  734. position:relative;
  735. }
  736. .tier-banner-row.tb-base .tb-bar-fill{background:linear-gradient(90deg,#D54E42,#962C24)}
  737. .tier-banner-row.tb-mid .tb-bar-fill{background:linear-gradient(90deg,#E5BB3D,#B58A21)}
  738. .tier-banner-row.tb-high .tb-bar-fill{background:linear-gradient(90deg,#7A3FA0,#4A1F70)}
  739. .tier-banner-row .tb-pct{
  740. font-family:'JetBrains Mono','Cormorant Garamond',monospace;
  741. font-size:14px;font-weight:800;letter-spacing:-0.02em;
  742. min-width:48px;text-align:right;
  743. }
  744. .tier-banner-row .tb-status-icon{
  745. font-size:13px;font-weight:700;
  746. }
  747. /* 移动端优化:窄屏隐藏 banner 副标 + 进度条收紧 */
  748. @media (max-width:760px){
  749. .tier-banner-row .tb-meta{display:none}
  750. .tier-banner-row .tb-progress{min-width:140px}
  751. }
  752. /* 终身寿险整行卡片视觉强化 */
  753. .policy-card.whole-life{
  754. background:linear-gradient(135deg,rgba(201,168,76,0.06) 0%,#fff 50%,rgba(201,168,76,0.04) 100%);
  755. border-left-width:6px;
  756. }
  757. .policy-card.whole-life .pc-amount{font-size:32px}
  758. .policy-card{background:var(--card-bg);border:1px solid var(--border);border-radius:var(--radius);
  759. padding:20px 24px;transition:all .2s}
  760. .policy-card:hover{border-color:var(--accent);box-shadow:0 4px 16px rgba(196,151,58,.1)}
  761. .policy-card.med{border-left:4px solid var(--c-green)}
  762. .policy-card.life{border-left:4px solid var(--accent)}
  763. .policy-card.retirement{border-left:4px solid var(--c-blue)}
  764. .policy-card.education{border-left:4px solid var(--c-purple)}
  765. /* === v3.0 风险金字塔三层着色(覆盖原 5 卡颜色,统一为金字塔色系) === */
  766. .policy-card[data-tier="base"]{border-left:4px solid #E07A3B; background:linear-gradient(90deg,rgba(224,122,59,0.04) 0%,#fff 30%)}
  767. .policy-card[data-tier="mid"]{border-left:4px solid #D4A93A; background:linear-gradient(90deg,rgba(212,169,58,0.04) 0%,#fff 30%)}
  768. .policy-card[data-tier="high"]{border-left:4px solid #C9A84C; background:linear-gradient(90deg,rgba(201,168,76,0.05) 0%,#fff 30%)}
  769. /* === P3.1 v2026-06-13 v1.4 · 100% 覆盖卡片折叠态(显示概要 · 点击展开)=== */
  770. .policy-card.is-collapsed{
  771. cursor:pointer;padding:14px 24px 16px;
  772. }
  773. .policy-card.is-collapsed:hover{background:linear-gradient(90deg,rgba(45,106,79,0.04) 0%,#fff 50%)}
  774. .policy-card.is-collapsed .pc-amount{font-size:1.6rem}
  775. .policy-card.is-collapsed .pc-amount-sub,
  776. .policy-card.is-collapsed .pc-bar,
  777. .policy-card.is-collapsed .pc-formula,
  778. .policy-card.is-collapsed .hnw-hl-box,
  779. .policy-card.is-collapsed .life-tabs,
  780. .policy-card.is-collapsed .life-track-pane,
  781. .policy-card.is-collapsed .ppli-table,
  782. .policy-card.is-collapsed .dual-track-summary,
  783. .policy-card.is-collapsed #wlNonHnwHint{display:none !important}
  784. .policy-card.is-collapsed .pc-meta{
  785. border-top:none;padding-top:8px;margin-top:6px;font-size:11.5px;
  786. }
  787. .policy-card.is-collapsed::after{
  788. content:'▾ 点击展开';position:absolute;bottom:8px;right:14px;
  789. font-size:10px;color:var(--text-dim);letter-spacing:0.5px;font-weight:600;opacity:0.6;
  790. pointer-events:none;
  791. }
  792. .policy-card.is-collapsed:hover::after{opacity:1;color:var(--accent)}
  793. .policy-card .pc-tier-badge{
  794. position:absolute; top:8px; right:14px;
  795. font-size:9.5px; font-weight:700; letter-spacing:0.6px;
  796. padding:2px 8px; border-radius:100px;
  797. font-family:-apple-system,'PingFang SC',sans-serif;
  798. }
  799. .policy-card[data-tier="base"] .pc-tier-badge{background:rgba(224,122,59,0.12); color:#9B4D1F}
  800. .policy-card[data-tier="mid"] .pc-tier-badge{background:rgba(212,169,58,0.12); color:#5A4912}
  801. .policy-card[data-tier="high"] .pc-tier-badge{background:rgba(201,168,76,0.14); color:#5C4810}
  802. .policy-card{position:relative}
  803. /* [v4.8 · 2026-06-26 修正] 移除 data-collapsed 冗余系统
  804. 原 codebase 已有 .policy-card.is-collapsed 折叠机制(line 540+)· 不再重复 */
  805. /* === v3.0 金字塔三层概览条(5 险种缺口图上方) === */
  806. .pyramid-overview{
  807. margin:24px 0 16px; padding:16px 20px;
  808. background:#fff; border:1px solid var(--border); border-radius:10px;
  809. box-shadow:0 1px 3px rgba(60,50,30,0.05);
  810. }
  811. .pyramid-overview-title{
  812. font-size:13px; font-weight:600; color:var(--text-primary);
  813. margin-bottom:12px; letter-spacing:0.3px;
  814. }
  815. .pyramid-overview-rows{display:flex; flex-direction:column; gap:8px}
  816. .po-row{display:grid; grid-template-columns:30px 1fr 60px 80px; gap:12px; align-items:center; font-size:12px}
  817. .po-row .po-icon{font-size:16px; text-align:center}
  818. .po-row .po-name{font-weight:600; color:var(--text-primary)}
  819. .po-row .po-name .po-sub{display:block; font-size:10px; color:var(--text-tertiary); font-weight:400; margin-top:1px}
  820. .po-row .po-bar{height:8px; background:rgba(0,0,0,0.05); border-radius:4px; overflow:hidden; position:relative}
  821. .po-row .po-bar-fill{height:100%; transition:width 0.6s ease; border-radius:4px}
  822. .po-row .po-pct{font-family:var(--font-mono,monospace); font-weight:700; text-align:right; font-size:13px}
  823. /* HNW 寿险卡 · 跨 2 行布局(底部和教育金对齐) */
  824. .policy-card.life.hnw-mode{grid-row:span 2;display:flex;flex-direction:column}
  825. /* 境内/境外双 Tab(参照 ActionHub ins-tabs 风格) */
  826. .life-tabs{display:flex;gap:0;margin:14px 0 14px;border-bottom:1.5px solid var(--border)}
  827. .life-track-tab{flex:1;padding:10px 14px;font-size:12.5px;color:var(--text-dim);cursor:pointer;
  828. text-align:center;border:1.5px solid transparent;border-bottom:none;border-radius:6px 6px 0 0;
  829. transition:all .2s;font-weight:500;font-family:'Noto Serif SC',serif;background:var(--bg);
  830. margin-bottom:-1.5px}
  831. .life-track-tab:hover{color:var(--accent)}
  832. .life-track-tab.active{color:var(--accent);background:#fff;border-color:var(--border);
  833. border-bottom-color:#fff;font-weight:600}
  834. .life-track-pane{display:none}
  835. .life-track-pane.active{display:block;animation:lifeTrackFadeIn .25s ease}
  836. @keyframes lifeTrackFadeIn{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}
  837. .life-track-amount{font-family:'Cormorant Garamond',serif;font-size:2.2rem;font-weight:900;
  838. color:var(--text);font-feature-settings:"lnum","tnum";line-height:1.1;margin-bottom:6px;letter-spacing:-0.04em}
  839. .life-track-amount .unit{font-size:1rem;color:var(--text-dim);font-weight:600;margin-left:4px;letter-spacing:0}
  840. .life-track-amount-sub{font-size:11px;color:var(--text-dim);margin-bottom:12px}
  841. .ppli-table{width:100%;border-collapse:collapse;font-size:12px;margin-top:8px;background:#fff;
  842. border:1px solid var(--border);border-radius:6px;overflow:hidden}
  843. .ppli-table th{background:var(--accent-dim);color:var(--accent-deep);font-weight:700;
  844. padding:8px 10px;text-align:left;font-size:11px;letter-spacing:.5px}
  845. .ppli-table td{padding:8px 10px;border-top:1px solid var(--border);color:var(--text)}
  846. .ppli-table .num{text-align:right;font-family:'Cormorant Garamond',serif;font-feature-settings:"lnum","tnum";font-weight:600}
  847. .ppli-table tr:last-child td{font-weight:700;background:var(--accent-dim)}
  848. .hnw-hl-box{background:linear-gradient(135deg,rgba(166,28,43,.08),rgba(166,28,43,.02));
  849. border-left:3px solid var(--c-red);border-radius:4px;padding:10px 14px;margin-top:10px;
  850. font-size:11.5px;color:var(--text);line-height:1.7}
  851. .hnw-hl-box strong{color:var(--c-red)}
  852. .hnw-tag{display:inline-block;font-size:10px;letter-spacing:1px;color:#fff;
  853. background:linear-gradient(135deg,#A61C2B,#8B1C15);padding:2px 8px;border-radius:8px;
  854. margin-left:8px;font-weight:700}
  855. .dual-track-summary{margin-top:auto;padding-top:14px;border-top:1px dashed var(--border);
  856. display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px;font-size:12px}
  857. .dual-track-summary .lbl{color:var(--text-dim)}
  858. .dual-track-summary .ratio{font-family:'Cormorant Garamond',serif;font-feature-settings:"lnum","tnum";
  859. color:var(--accent);font-weight:600;font-size:14px}
  860. .pc-head{display:flex;align-items:center;gap:10px;margin-bottom:14px}
  861. .pc-icon{font-size:26px}
  862. .pc-title{font-size:16.5px;font-weight:700;color:var(--text);letter-spacing:0.3px}
  863. /* === 缺口状态徽章(v2026-06-13 v1.3 · 卡片右上角 pill · 含百分比文案)=== */
  864. .pc-status{
  865. position:absolute; top:34px; right:14px;
  866. display:inline-flex;align-items:center;justify-content:center;gap:4px;
  867. padding:3px 9px;border-radius:100px;
  868. font-size:10.5px;font-weight:700;letter-spacing:0.4px;
  869. font-family:-apple-system,'PingFang SC',sans-serif;
  870. flex-shrink:0;transition:all .3s;white-space:nowrap;
  871. z-index:2;
  872. }
  873. .pc-status.covered{
  874. background:rgba(45,106,79,.14);
  875. color:#2D6A4F;
  876. border:1px solid rgba(45,106,79,.35);
  877. }
  878. .pc-status.gap-partial{
  879. background:rgba(184,139,64,.14);
  880. color:#8B6F1A;
  881. border:1px solid rgba(184,139,64,.35);
  882. }
  883. .pc-status.gap-large{
  884. background:rgba(166,28,43,.12);
  885. color:#A6121C;
  886. border:1px solid rgba(166,28,43,.4);
  887. animation:gapPulse 1.6s ease-in-out infinite;
  888. }
  889. .pc-status.na{
  890. background:rgba(120,120,120,.10);
  891. color:#888;
  892. border:1px solid rgba(120,120,120,.25);
  893. }
  894. @keyframes gapPulse{
  895. 0%,100%{box-shadow:0 0 0 0 rgba(166,28,43,.45);transform:scale(1)}
  896. 50%{box-shadow:0 0 0 6px rgba(166,28,43,0);transform:scale(1.04)}
  897. }
  898. .pc-tag{font-size:10px;letter-spacing:1px;color:var(--text-dim);background:var(--bg);
  899. padding:3px 8px;border-radius:4px;margin-left:auto;text-transform:uppercase;font-weight:600;display:none}
  900. .pc-amount{font-family:'Cormorant Garamond',serif;font-size:3.1rem;font-weight:900;
  901. color:var(--text);font-feature-settings:"lnum","tnum";line-height:1;margin-bottom:6px;
  902. letter-spacing:-0.045em}
  903. .pc-amount .unit{font-size:1.15rem;color:var(--text-dim);font-weight:600;margin-left:5px;letter-spacing:0}
  904. .pc-amount-sub{font-size:12.5px;color:var(--text-dim);margin-bottom:14px;letter-spacing:0.2px}
  905. .pc-bar{margin-bottom:14px}
  906. .pc-bar-meta{display:flex;justify-content:space-between;font-size:11.5px;color:var(--text-dim);margin-bottom:5px}
  907. .pc-bar-meta .v{font-weight:600;color:var(--text);font-family:'Cormorant Garamond',serif;font-feature-settings:"lnum","tnum"}
  908. .pc-bar-track{width:100%;height:8px;background:var(--bg3);border-radius:100px;overflow:hidden;display:flex}
  909. .pc-bar-existing{height:100%;border-radius:100px 0 0 100px;background:var(--accent-light);transition:width .8s ease}
  910. .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}
  911. .pc-formula{background:var(--accent-dim);border-left:3px solid var(--accent);
  912. border-radius:4px;padding:10px 14px;margin-bottom:12px;font-size:11.5px;color:var(--text-dim);
  913. font-family:'Noto Sans SC',monospace;line-height:1.7}
  914. .pc-formula strong{color:var(--accent-deep);font-weight:700}
  915. .pc-formula .formula-line{display:block;margin-top:2px}
  916. .pc-meta{display:flex;justify-content:space-between;align-items:center;
  917. border-top:1px dashed var(--border);padding-top:12px;font-size:12.5px}
  918. .pc-meta-label{color:var(--text-dim);font-weight:600}
  919. .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}
  920. /* === 配置优先级段(v2026-06-13)· 类似 Timeline 让客户明确下一步 === */
  921. .priority-section{
  922. background:linear-gradient(135deg,var(--accent-dim) 0%,rgba(196,151,58,.02) 100%);
  923. border:1px solid var(--border);
  924. border-left:4px solid var(--accent);
  925. border-radius:var(--radius);
  926. padding:24px 28px;margin-bottom:24px;
  927. }
  928. .priority-head{display:flex;align-items:baseline;gap:14px;margin-bottom:6px}
  929. .priority-title{
  930. font-family:var(--font-display),'Noto Serif SC',serif;
  931. font-size:1.1rem;font-weight:700;color:var(--text);letter-spacing:-0.3px;
  932. }
  933. .priority-meta{font-size:12px;color:var(--text-dim);margin-left:auto}
  934. .priority-subtitle{font-size:12.5px;color:var(--text-dim);margin-bottom:18px;line-height:1.7}
  935. .priority-list{display:flex;flex-direction:column;gap:14px}
  936. .priority-item{
  937. background:#fff;border:1px solid var(--border);border-radius:var(--radius);
  938. padding:14px 18px;display:grid;
  939. grid-template-columns:80px auto 1fr;gap:16px;align-items:center;
  940. transition:all .15s;
  941. }
  942. .priority-item:hover{border-color:var(--accent);box-shadow:0 4px 12px rgba(196,151,58,.12)}
  943. .priority-item.p0{border-left:4px solid var(--c-red)}
  944. .priority-item.p1{border-left:4px solid var(--c-yellow)}
  945. .priority-item.p2{border-left:4px solid var(--c-blue)}
  946. .priority-item.done{border-left:4px solid var(--c-green);opacity:.85}
  947. .pi-rank{
  948. display:flex;flex-direction:column;align-items:center;justify-content:center;
  949. padding:8px 0;border-radius:6px;
  950. font-family:var(--font-sans);
  951. font-size:10.5px;font-weight:700;letter-spacing:1.2px;
  952. }
  953. .pi-rank.p0{background:rgba(166,28,43,.12);color:var(--c-red)}
  954. .pi-rank.p1{background:rgba(184,139,64,.14);color:var(--c-yellow)}
  955. .pi-rank.p2{background:rgba(61,111,140,.12);color:var(--c-blue)}
  956. .pi-rank.done{background:rgba(45,106,79,.12);color:var(--c-green)}
  957. .pi-rank-num{
  958. font-family:var(--font-num);
  959. font-feature-settings:'lnum' 1,'tnum' 1;
  960. font-variant-numeric:lining-nums tabular-nums;
  961. font-size:1.4rem;font-weight:900;letter-spacing:-0.04em;
  962. line-height:1;margin-bottom:2px;
  963. }
  964. .pi-icon-wrap{font-size:22px;text-align:center}
  965. .pi-content{display:flex;flex-direction:column;gap:4px}
  966. .pi-name{font-size:14px;font-weight:600;color:var(--text)}
  967. .pi-name .pi-amount{
  968. color:var(--c-red);font-weight:700;
  969. font-family:var(--font-num);
  970. font-feature-settings:'lnum' 1,'tnum' 1;
  971. font-variant-numeric:lining-nums tabular-nums;
  972. letter-spacing:-0.02em;
  973. margin-left:6px;
  974. }
  975. .pi-name .pi-amount.done{color:var(--c-green)}
  976. .pi-action{font-size:12px;color:var(--text-dim);line-height:1.6}
  977. .pi-action strong{color:var(--accent-deep)}
  978. /* === 高净值差异化建议 === */
  979. .uhnw-card{background:linear-gradient(135deg,#FFF8E7 0%,#FFFFFF 100%);
  980. border:1px solid var(--border);border-left:5px solid #C4973A;
  981. border-radius:var(--radius);padding:22px 26px;margin-bottom:24px}
  982. .uhnw-head{display:flex;align-items:baseline;gap:12px;margin-bottom:14px}
  983. .uhnw-title{font-size:16px;font-weight:700;color:var(--text);
  984. font-family:var(--font-display),'Noto Serif SC',serif;letter-spacing:-0.3px}
  985. .uhnw-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:12px}
  986. .uhnw-item{background:#fff;border:1px solid var(--border);border-radius:6px;padding:12px 16px}
  987. .uhnw-item-name{font-size:13px;font-weight:600;color:var(--text);margin-bottom:4px}
  988. .uhnw-item-desc{font-size:11.5px;color:var(--text-dim);line-height:1.6}
  989. /* === v3.0 v1.5 · 金字塔体检卡(分层卡片堆叠版 · 参照 PPTX 风格)=== */
  990. .pyramid-check-card{
  991. background:linear-gradient(135deg,#fff 0%,rgba(201,168,76,0.04) 100%);
  992. border:1px solid var(--border);border-radius:var(--radius);
  993. padding:28px 32px;margin-bottom:24px;
  994. display:grid;grid-template-columns:380px 1fr;gap:36px;align-items:center;
  995. box-shadow:0 4px 18px rgba(60,50,30,0.08);
  996. position:relative;
  997. }
  998. .pyramid-check-card::before{
  999. content:'';position:absolute;top:0;left:0;right:0;height:3px;
  1000. background:linear-gradient(90deg,#854F1F 0%,#B07F32 50%,#D9B05A 100%);
  1001. border-radius:var(--radius) var(--radius) 0 0;
  1002. }
  1003. @media (max-width:900px){.pyramid-check-card{grid-template-columns:1fr;gap:24px}}
  1004. .pcc-svg-wrap{display:flex;align-items:center;justify-content:center;position:relative}
  1005. .pcc-svg-wrap svg{width:100%;max-width:380px;height:auto;display:block}
  1006. /* === v3.3.1 · 金字塔工具开关(左上角 · 更靠近边缘 · 香槟金主题)=== */
  1007. .pyramid-controls{
  1008. position:absolute; top:0px; left:0px; z-index:30;
  1009. display:flex; flex-direction:column; gap:3px;
  1010. }
  1011. .pc-toggle{
  1012. display:inline-flex; align-items:center; gap:5px;
  1013. padding:3px 9px; border-radius:100px;
  1014. font-size:10px; font-weight:700; letter-spacing:0.3px;
  1015. font-family:-apple-system,'PingFang SC',sans-serif;
  1016. background:rgba(255,255,255,0.92);
  1017. border:1px solid rgba(201,168,76,0.45);
  1018. color:#9B7C3A; cursor:pointer;
  1019. transition:all 0.2s;
  1020. box-shadow:0 1px 4px rgba(60,50,30,0.10);
  1021. user-select:none; white-space:nowrap;
  1022. }
  1023. .pc-toggle:hover{background:rgba(252,247,235,0.98); border-color:rgba(201,168,76,0.75); transform:translateY(-1px)}
  1024. .pc-toggle[data-on="0"]{
  1025. background:rgba(0,0,0,0.04); border-color:rgba(0,0,0,0.12); color:#999;
  1026. }
  1027. .pc-toggle[data-on="0"]:hover{background:rgba(0,0,0,0.08); color:#666}
  1028. .pc-toggle .tg-dot{
  1029. width:6px; height:6px; border-radius:50%;
  1030. background:#C9A84C;
  1031. box-shadow:0 0 4px rgba(201,168,76,0.6);
  1032. }
  1033. .pc-toggle[data-on="0"] .tg-dot{background:#bbb; box-shadow:none}
  1034. /* === v3.3.3 · 点击放大动效(金字塔每层可点击 · 选中后放大 + 金色光晕)=== */
  1035. .pyr-layer{
  1036. cursor:pointer;
  1037. transform-box:view-box;
  1038. transition:transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
  1039. filter 0.35s ease;
  1040. }
  1041. .pyr-layer:hover{
  1042. transform:scale(1.025);
  1043. filter:drop-shadow(0 3px 8px rgba(201,168,76,0.30));
  1044. }
  1045. .pyr-layer.is-active{
  1046. transform:scale(1.07);
  1047. filter:drop-shadow(0 8px 20px rgba(201,168,76,0.55));
  1048. }
  1049. /* === v2026-06-13 v1.4 · 年缴保费分配 donut 卡(P2.1)=== */
  1050. .premium-allocation-card{
  1051. background:linear-gradient(135deg,#fff 0%,rgba(201,168,76,0.04) 100%);
  1052. border:1px solid var(--border);border-radius:var(--radius);
  1053. padding:24px 28px;margin-bottom:24px;
  1054. display:grid;grid-template-columns:260px 1fr;gap:32px;align-items:center;
  1055. box-shadow:0 4px 18px rgba(60,50,30,0.06);
  1056. }
  1057. /* [v4.8 · 2026-06-26] 年缴保费分配 卡片外加全宽白带 */
  1058. .premium-allocation-wrap{
  1059. position:relative;
  1060. background:var(--band-white);
  1061. box-shadow:0 0 0 100vmax var(--band-white);
  1062. clip-path:inset(0 -100vmax);
  1063. padding:24px 0;margin:0
  1064. }
  1065. /* [v4.8 · 2026-06-26] 风险层 tier banner + 卡片 外加全宽 band wrap
  1066. 可叠加修饰类 --white / --cream / --pale-gold 切换底色 */
  1067. .tier-band-wrap{
  1068. position:relative;
  1069. padding:20px 0;margin:0;
  1070. border:none;border-radius:0
  1071. }
  1072. .tier-band-wrap--white{
  1073. background:var(--band-white);
  1074. box-shadow:0 0 0 100vmax var(--band-white);
  1075. clip-path:inset(0 -100vmax)
  1076. }
  1077. .tier-band-wrap--cream{
  1078. background:var(--band-cream);
  1079. box-shadow:0 0 0 100vmax var(--band-cream);
  1080. clip-path:inset(0 -100vmax)
  1081. }
  1082. .tier-band-wrap--pale-gold{
  1083. background:var(--band-pale-gold);
  1084. box-shadow:0 0 0 100vmax var(--band-pale-gold);
  1085. clip-path:inset(0 -100vmax)
  1086. }
  1087. /* [v4.8 · 2026-06-26] 暖底 wrap · 用于显式包裹 tier 让结构与其他 wrap 对齐 */
  1088. .tier-band-wrap--warm{
  1089. background:var(--bg);
  1090. box-shadow:0 0 0 100vmax var(--bg);
  1091. clip-path:inset(0 -100vmax)
  1092. }
  1093. /* 在 band 内的 tier-banner-row 间距收紧(band 自身已有 padding) */
  1094. .tier-band-wrap > .tier-banner-row{margin-bottom:14px}
  1095. @media (max-width:900px){.premium-allocation-card{grid-template-columns:1fr;gap:20px}}
  1096. .pa-svg-wrap{position:relative;display:flex;align-items:center;justify-content:center}
  1097. .pa-svg-wrap svg{width:100%;max-width:240px;height:auto;display:block}
  1098. .pa-center{position:absolute;text-align:center;pointer-events:none}
  1099. .pa-center-label{font-size:10.5px;color:var(--text-dim);letter-spacing:1px;font-weight:600;margin-bottom:2px}
  1100. .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}
  1101. .pa-center-sub{font-size:10.5px;color:var(--text-dim);margin-top:3px;letter-spacing:0.5px}
  1102. .pa-info h3{
  1103. font-family:var(--font-display,Georgia,serif);font-size:18px;font-weight:600;
  1104. color:var(--text);margin-bottom:14px;
  1105. }
  1106. .pa-tier-summary{display:flex;gap:12px;margin-bottom:14px;flex-wrap:wrap}
  1107. .pa-tier-pill{
  1108. display:flex;align-items:center;gap:6px;padding:6px 12px;border-radius:100px;
  1109. font-size:11.5px;font-weight:700;letter-spacing:0.3px;
  1110. }
  1111. .pa-tier-pill .ptp-emoji{font-size:13px}
  1112. .pa-tier-pill .ptp-pct{font-family:'JetBrains Mono',monospace;font-weight:800}
  1113. .pa-tier-pill.ptp-base{background:rgba(213,78,66,0.12);color:#962C24;border:1px solid rgba(213,78,66,0.3)}
  1114. .pa-tier-pill.ptp-mid{background:rgba(229,187,61,0.14);color:#8B6F1A;border:1px solid rgba(229,187,61,0.35)}
  1115. .pa-tier-pill.ptp-high{background:rgba(122,63,160,0.10);color:#5C2A7A;border:1px solid rgba(122,63,160,0.3)}
  1116. .pa-legend{display:grid;grid-template-columns:repeat(2,1fr);gap:8px 16px;margin-bottom:14px}
  1117. .pa-legend-item{display:flex;align-items:center;gap:8px;font-size:11.5px}
  1118. .pa-legend-dot{width:12px;height:12px;border-radius:3px;flex-shrink:0}
  1119. .pa-legend-name{color:var(--text);font-weight:600;flex:1}
  1120. .pa-legend-pct{font-family:'JetBrains Mono',monospace;color:var(--text-dim);font-size:11px;font-weight:700}
  1121. .pa-foot{
  1122. font-size:11.5px;line-height:1.6;color:var(--text-dim);
  1123. background:rgba(201,168,76,0.06);border-left:2px solid #C9A84C;
  1124. padding:10px 14px;border-radius:4px;
  1125. }
  1126. .pcc-info h3{
  1127. font-family:var(--font-display,Georgia,serif);font-size:20px;font-weight:600;
  1128. color:var(--text);margin-bottom:14px;
  1129. }
  1130. .pcc-label-badge{
  1131. display:inline-block;padding:3px 12px;border-radius:100px;
  1132. font-size:11px;font-weight:600;letter-spacing:1px;
  1133. margin-left:10px;vertical-align:middle;
  1134. font-family:-apple-system,'PingFang SC',sans-serif;
  1135. }
  1136. .pcc-tier-rows{display:flex;flex-direction:column;gap:10px;margin-bottom:16px}
  1137. .pcc-tier-row{
  1138. display:grid;grid-template-columns:24px 1fr 110px 60px 16px;
  1139. align-items:center;gap:12px;
  1140. padding:8px 12px;border-radius:8px;
  1141. background:rgba(0,0,0,0.025);
  1142. }
  1143. /* [2026-07-12] 可点击展开 */
  1144. .pcc-tier-clickable{cursor:pointer;transition:background .15s}
  1145. .pcc-tier-clickable:hover{background:rgba(155,124,58,.08)}
  1146. .pcc-tier-caret{font-size:11px;color:var(--text-dim);transition:transform .2s;text-align:center}
  1147. .pcc-tier-row.is-expanded .pcc-tier-caret{transform:rotate(90deg);color:var(--accent)}
  1148. .pcc-tier-detail{max-height:0;overflow:hidden;transition:max-height .3s ease;padding:0 4px}
  1149. .pcc-tier-detail.is-open{max-height:600px;padding:10px 4px 4px}
  1150. .pcc-icon-cell,.pcc-tier-icon{font-size:16px;text-align:center}
  1151. .pcc-tier-name{font-size:12.5px;font-weight:600;color:var(--text)}
  1152. .pcc-tier-name .pcc-tier-sub{
  1153. display:block;font-size:10px;color:var(--text-dim);font-weight:400;
  1154. letter-spacing:0.3px;margin-top:1px;
  1155. }
  1156. .pcc-tier-bar{height:8px;background:rgba(0,0,0,0.06);border-radius:4px;overflow:hidden}
  1157. .pcc-tier-bar-fill{height:100%;transition:width 0.8s ease;border-radius:4px}
  1158. .pcc-tier-pct{text-align:right;font-family:var(--font-mono);font-size:13px;font-weight:700}
  1159. .pcc-diagnosis{
  1160. padding:12px 16px;border-radius:8px;
  1161. font-size:12.5px;line-height:1.6;
  1162. border-left:4px solid;margin-bottom:14px;
  1163. }
  1164. .pcc-diag-msg{font-weight:700;margin-bottom:4px}
  1165. .pcc-diag-text{opacity:0.85}
  1166. .pcc-score-strip{
  1167. display:flex;align-items:center;gap:18px;padding-top:14px;
  1168. border-top:1px solid var(--border);
  1169. }
  1170. .pcc-ss-num{
  1171. font-family:var(--font-mono);font-size:30px;font-weight:800;color:var(--accent);
  1172. line-height:1;
  1173. }
  1174. .pcc-ss-suffix{font-size:13px;color:var(--text-dim);font-weight:400;margin-left:2px}
  1175. .pcc-ss-label{font-size:11.5px;color:var(--text-dim);letter-spacing:0.3px}
  1176. /* === Phase 3 · 5 险种缺口对比柱状图 === */
  1177. .gap-chart-section{background:var(--card-bg);border:1px solid var(--border);
  1178. border-radius:var(--radius);padding:24px 28px;margin-bottom:24px}
  1179. /* === v3.4 · 家庭总财富画像(三盘合并视角)=== */
  1180. .wealth-picture-section{
  1181. /* [v4.8 · 2026-06-26] Total Wealth · 全宽白带(承接 §3 L1 风格)
  1182. 用负 margin + 同等 padding 而非 box-shadow + clip-path 嵌套(避免 §3 内渲染 bug)*/
  1183. position:relative;
  1184. background:var(--card);
  1185. margin:24px calc(-50vw + 50%);
  1186. padding:24px calc(50vw - 50%);
  1187. border:none;border-radius:0;box-shadow:none;clip-path:none}
  1188. .wp-head{display:flex;align-items:baseline;gap:14px;margin-bottom:18px;
  1189. border-bottom:1px solid var(--border);padding-bottom:10px}
  1190. .wp-title{font-size:16px;font-weight:700;color:var(--text);
  1191. font-family:var(--font-display),'Noto Serif SC',serif;letter-spacing:-0.3px}
  1192. .wp-meta{font-size:12px;color:var(--text-dim);margin-left:auto}
  1193. .wp-stack{margin-bottom:14px}
  1194. .wp-bar{display:flex;height:32px;border-radius:6px;overflow:hidden;background:#EFE9DC;
  1195. box-shadow:inset 0 1px 3px rgba(0,0,0,.06);margin-bottom:14px}
  1196. .wp-seg{transition:width .8s ease;display:flex;align-items:center;justify-content:center;
  1197. font-size:11px;color:#fff;font-weight:600;font-family:'Cormorant Garamond',serif;
  1198. font-feature-settings:'lnum','tnum';overflow:hidden;white-space:nowrap}
  1199. .wp-seg-liquid{background:linear-gradient(90deg,#3F8DCB,#5BA8E0)}
  1200. .wp-seg-house{background:linear-gradient(90deg,#9B7C3A,#B89A52)}
  1201. .wp-seg-invest{background:linear-gradient(90deg,#7A5A8E,#A480B5)}
  1202. .wp-seg-insur{background:linear-gradient(90deg,#2E7A4F,#4FA379)}
  1203. .wp-legend{display:grid;grid-template-columns:repeat(5,1fr);gap:10px}
  1204. .wp-legend-item{background:#fff;border:1px solid var(--border);border-radius:6px;
  1205. padding:10px 12px;display:flex;align-items:center;gap:6px;flex-wrap:nowrap;white-space:nowrap;overflow:hidden}
  1206. .wp-legend-total{background:linear-gradient(180deg,#FFFBEC 0%,#F8EFD6 100%);border:2px solid var(--accent)}
  1207. .wp-dot{display:inline-block;width:10px;height:10px;border-radius:50%;flex-shrink:0}
  1208. .wp-dot-liquid{background:#3F8DCB}
  1209. .wp-dot-house{background:#9B7C3A}
  1210. .wp-dot-invest{background:#7A5A8E}
  1211. .wp-dot-insur{background:#2E7A4F}
  1212. .wp-dot-total{background:linear-gradient(135deg,#9B7C3A,#7A5A8E)}
  1213. .wp-lbl{font-size:11.5px;color:var(--text);font-weight:500;flex-shrink:1;text-overflow:ellipsis;overflow:hidden;min-width:0}
  1214. .wp-amt{font-family:'Cormorant Garamond',serif;font-feature-settings:'lnum','tnum';
  1215. font-weight:700;font-size:14.5px;color:var(--text);margin-left:auto;flex-shrink:0;letter-spacing:-0.02em}
  1216. .wp-legend-total .wp-amt{color:var(--accent);font-size:16.5px}
  1217. .wp-pct{font-family:'Cormorant Garamond',serif;font-feature-settings:'lnum','tnum';
  1218. font-weight:600;font-size:11.5px;color:var(--text-dim);flex-shrink:0;margin-left:4px;letter-spacing:-0.02em}
  1219. .wp-insight{background:#FFFBEC;border-left:3px solid var(--accent);padding:10px 14px;
  1220. border-radius:0 4px 4px 0;font-size:12.5px;line-height:1.7;color:var(--text);margin-bottom:14px}
  1221. .wp-insight strong{color:var(--accent)}
  1222. .wp-actions{display:flex;gap:12px;flex-wrap:wrap}
  1223. /* === v3.5.3 · 「打开资产配置中心」「打开 Let's See」按钮 改深机构黑(对齐 CTA + result-cover)
  1224. v3.5.5 · 反转色序: 左深→右暖 · 已上升为 Skill 默认 === */
  1225. .wp-action-btn{display:inline-flex;align-items:center;gap:8px;
  1226. background:linear-gradient(135deg,#080503 0%,#2D2010 100%);color:#F5E6B8;
  1227. border:1px solid rgba(155,124,58,0.45);border-radius:6px;padding:9px 16px;
  1228. font-size:13px;font-weight:500;text-decoration:none;
  1229. transition:all .2s;font-family:'Noto Serif SC',serif;
  1230. box-shadow:0 4px 14px rgba(0,0,0,0.30),inset 0 0 0 1px rgba(155,124,58,0.08)}
  1231. .wp-action-btn:hover{background:linear-gradient(135deg,#0F0A04 0%,#3A2A14 100%);
  1232. border-color:var(--accent-light);transform:translateY(-1px);
  1233. box-shadow:0 8px 22px rgba(0,0,0,0.45),0 0 0 1px rgba(184,154,82,0.30)}
  1234. @media (max-width: 900px){
  1235. .wp-legend{grid-template-columns:repeat(2,1fr)}
  1236. }
  1237. /* === v2.8 · 支付能力健康度 + 行业基准对比 === */
  1238. .affordability-section{background:linear-gradient(180deg,#FEFCF7 0%,#FDF8EA 100%);
  1239. border:1px solid var(--gold);border-radius:var(--radius);padding:22px 28px;margin-bottom:24px;
  1240. box-shadow:0 4px 16px rgba(155,124,58,.08)}
  1241. .aff-head{display:flex;align-items:baseline;gap:14px;margin-bottom:18px;
  1242. border-bottom:1px solid var(--gold-pale);padding-bottom:10px}
  1243. .aff-title{font-size:16px;font-weight:700;color:var(--text);
  1244. font-family:var(--font-display),'Noto Serif SC',serif;letter-spacing:-0.3px}
  1245. .aff-meta{font-size:12px;color:var(--text-dim);margin-left:auto}
  1246. .aff-row{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:16px}
  1247. .aff-card{background:#fff;border:1px solid var(--border);border-radius:8px;padding:14px 16px}
  1248. .aff-card-emphasis{background:linear-gradient(180deg,#FFFBEC 0%,#F8EFD6 100%);
  1249. border:2px solid var(--accent);box-shadow:0 2px 8px rgba(155,124,58,.15)}
  1250. .aff-card-label{font-size:11px;color:var(--text-dim);text-transform:uppercase;letter-spacing:.5px;margin-bottom:6px}
  1251. .aff-card-value{font-family:'Cormorant Garamond',serif;font-feature-settings:'lnum','tnum';
  1252. font-weight:700;font-size:24px;color:var(--text);letter-spacing:-1px;line-height:1.1}
  1253. .aff-card-emphasis .aff-card-value{color:var(--accent)}
  1254. .aff-card-sub{font-size:11px;color:var(--text-dim);margin-top:4px}
  1255. .aff-warning{background:#FFF3E0;border:1px solid #E89B3D;border-left:4px solid #E87530;
  1256. border-radius:6px;padding:10px 14px;margin-bottom:16px;display:flex;align-items:flex-start;gap:10px}
  1257. .aff-warn-icon{font-size:18px;flex-shrink:0}
  1258. .aff-warn-text{font-size:12.5px;color:#7A4710;line-height:1.6;font-weight:500}
  1259. .aff-warn-text strong{color:#A61C2B}
  1260. .aff-benchmark{background:#fff;border:1px solid var(--border);border-radius:8px;padding:16px 18px;margin-bottom:16px}
  1261. .aff-bench-row{display:grid;grid-template-columns:160px 1fr 80px;gap:14px;align-items:center;
  1262. padding:10px 0;border-bottom:1px dashed var(--border)}
  1263. .aff-bench-row:last-child{border-bottom:none}
  1264. .aff-bench-label{font-size:12px;font-weight:600;color:var(--text)}
  1265. .aff-bench-bar{position:relative}
  1266. .aff-bench-track{position:relative;height:18px;background:#F0EDE5;border-radius:4px;overflow:hidden}
  1267. .aff-bench-band{position:absolute;top:0;height:100%}
  1268. .aff-bench-band-ok{background:rgba(45,179,124,.35)}
  1269. .aff-bench-band-warn{background:rgba(232,155,61,.35)}
  1270. .aff-bench-band-bad{background:rgba(166,28,43,.35)}
  1271. .aff-bench-marker{position:absolute;top:-4px;width:3px;height:26px;background:#1A1A1A;border-radius:1px;
  1272. box-shadow:0 0 0 2px #fff,0 2px 6px rgba(0,0,0,.4);transition:left .8s ease}
  1273. .aff-bench-scale{display:flex;justify-content:space-between;font-size:10px;color:var(--text-dim);
  1274. margin-top:4px;font-family:'Cormorant Garamond',serif;font-feature-settings:'lnum','tnum';font-weight:600}
  1275. .aff-bench-value{font-family:'Cormorant Garamond',serif;font-feature-settings:'lnum','tnum';
  1276. font-weight:700;font-size:15px;color:var(--accent);text-align:right}
  1277. .aff-bench-legend{display:flex;align-items:center;gap:6px;justify-content:center;font-size:11px;
  1278. color:var(--text-dim);margin-top:8px;padding-top:8px;border-top:1px dashed var(--border)}
  1279. .aff-bench-leg-dot{display:inline-block;width:10px;height:10px;border-radius:50%;margin:0 4px 0 12px}
  1280. .aff-bench-legend .aff-bench-band-ok{background:rgba(45,179,124,.7)}
  1281. .aff-bench-legend .aff-bench-band-warn{background:rgba(232,155,61,.7)}
  1282. .aff-bench-legend .aff-bench-band-bad{background:rgba(166,28,43,.7)}
  1283. /* === [v4.6] 三轨配置建议 · 完整需求 vs 可负担方案 vs 自定义方案 (合并单卡) === */
  1284. .aff-tri-track{background:#fff;border:1px solid var(--gold);border-radius:8px;padding:16px 18px;margin-top:14px}
  1285. .aff-tri-head{display:flex;align-items:baseline;gap:10px;margin-bottom:12px;flex-wrap:wrap;
  1286. border-bottom:1px solid var(--gold-pale);padding-bottom:8px}
  1287. .aff-tri-title{font-size:14px;font-weight:700;color:var(--text);font-family:var(--font-display),serif}
  1288. .aff-tri-edit-hint{font-size:11px;color:var(--text-dim);margin-left:auto}
  1289. .aff-tri-edit-hint strong{color:#2B6CB0}
  1290. .aff-tri-table{width:100%;border-collapse:collapse;font-size:12px;background:#FAF8F2;
  1291. border:1px solid var(--border);border-radius:6px;overflow:hidden}
  1292. .aff-tri-table th{padding:9px 8px;text-align:center;background:#F4EDD8;color:var(--text);
  1293. font-weight:700;font-size:12px;border-bottom:1px solid var(--border);vertical-align:top}
  1294. .aff-tri-table th.tri-col-name{text-align:left;width:34%;background:#F4EDD8}
  1295. .aff-tri-table th.tri-col-full{background:#F4EDD8}
  1296. .aff-tri-table th.tri-col-aff{background:linear-gradient(180deg,#FFFBEC 0%,#FBF3DD 100%);color:var(--accent)}
  1297. .aff-tri-table th.tri-col-custom{background:linear-gradient(180deg,#EEF4FF 0%,#DCE7FB 100%);color:#2B6CB0}
  1298. .aff-tri-table th .tri-col-sub{display:block;font-size:10px;font-weight:500;
  1299. color:var(--text-dim);margin-top:2px;letter-spacing:0;text-transform:none}
  1300. .aff-tri-table th.tri-col-aff .tri-col-sub{color:var(--accent);opacity:.8}
  1301. .aff-tri-table th.tri-col-custom .tri-col-sub{color:#2B6CB0;opacity:.8}
  1302. .aff-tri-table tbody tr{border-bottom:1px dashed var(--border)}
  1303. .aff-tri-table tbody tr:last-child{border-bottom:none}
  1304. .aff-tri-table td{padding:7px 8px;color:var(--text);vertical-align:middle}
  1305. .aff-tri-table td.tri-num{text-align:center;font-family:'Cormorant Garamond',serif;
  1306. font-feature-settings:'lnum','tnum';font-weight:600;font-variant-numeric:tabular-nums;font-size:13px}
  1307. .aff-tri-table td.tri-num-aff{background:rgba(201,168,76,.05);text-align:center}
  1308. .aff-tri-table td.tri-num-custom{background:rgba(43,108,176,.05);text-align:center}
  1309. .aff-tri-table tfoot tr.tri-total-row td{background:#F4EDD8;font-weight:700;font-size:13.5px;
  1310. border-top:1.5px solid var(--gold);padding-top:10px;padding-bottom:10px;text-align:center}
  1311. .aff-tri-table tfoot tr.tri-total-row td:first-child{text-align:left}
  1312. .aff-tri-table tfoot tr.tri-total-row td.tri-num-aff{background:#FBF3DD;color:var(--accent)}
  1313. .aff-tri-table tfoot tr.tri-total-row td.tri-num-custom{background:#DCE7FB;color:#2B6CB0;text-align:center}
  1314. .tri-cell-cut{color:var(--text-dim)!important;font-style:italic}
  1315. .tri-cell-cut::after{content:" ↓";color:#A61C2B;font-style:normal;font-weight:700}
  1316. /* [v4.7 Q1 + Jack 2026-06-21] 三档差异 mini badge */
  1317. .aff-tri-table tfoot tr.tri-diff-row td{background:#FBF7E8;border-top:1px solid var(--border)}
  1318. .tri-diff-pill{display:inline-block;padding:2px 8px;border-radius:10px;font-family:'Cormorant Garamond',serif;
  1319. font-feature-settings:'lnum','tnum';font-weight:700;font-size:12px;letter-spacing:.3px}
  1320. .tri-diff-pill-down{background:rgba(45,179,124,.12);color:#1F7A4D;border:1px solid rgba(45,179,124,.35)}
  1321. .tri-diff-pill-up{background:rgba(166,28,43,.10);color:#A61C2B;border:1px solid rgba(166,28,43,.35)}
  1322. .tri-diff-pill-eq{background:rgba(155,124,58,.10);color:#7A6028;border:1px solid rgba(155,124,58,.30)}
  1323. .tri-diff-amt{font-size:10.5px;color:#7A6028;margin-left:4px;font-family:'Cormorant Garamond',serif;font-feature-settings:'lnum','tnum'}
  1324. .tri-custom-input{width:78px;padding:4px 6px;border:1px solid #B8C9DD;border-radius:4px;
  1325. font-family:'Cormorant Garamond',serif;font-feature-settings:'lnum','tnum';
  1326. font-variant-numeric:tabular-nums;font-size:13px;font-weight:600;color:#2B6CB0;
  1327. background:#fff;text-align:right;transition:all .15s}
  1328. .tri-custom-input:focus{outline:none;border-color:#2B6CB0;box-shadow:0 0 0 2px rgba(43,108,176,.18)}
  1329. .tri-custom-input:hover{border-color:#2B6CB0}
  1330. .tri-custom-input::-webkit-outer-spin-button,
  1331. .tri-custom-input::-webkit-inner-spin-button{opacity:.5;height:18px}
  1332. .tri-custom-suffix{margin-left:3px;color:var(--text-dim);font-size:11px}
  1333. .aff-tri-warn{margin-top:10px;padding:8px 12px;border-radius:6px;font-size:11.5px;
  1334. display:none;line-height:1.5}
  1335. .aff-tri-warn.is-warn{display:block;background:#FFF5F5;border:1px solid #E87070;color:#A61C2B}
  1336. .aff-tri-warn.is-ok{display:block;background:#F0FAF4;border:1px solid #5DB890;color:#1F4D2F}
  1337. .aff-tri-warn strong{font-weight:700}
  1338. .aff-dual-note{margin-top:10px;font-size:11.5px;color:var(--text-dim);background:#FFFBEC;
  1339. border-left:3px solid var(--accent);padding:8px 12px;border-radius:0 4px 4px 0;line-height:1.6}
  1340. .aff-dual-note strong{color:var(--text)}
  1341. @media (max-width: 900px){
  1342. .aff-row{grid-template-columns:repeat(2,1fr)}
  1343. .aff-bench-row{grid-template-columns:120px 1fr 70px}
  1344. }
  1345. @media (max-width: 680px){
  1346. .aff-tri-table{font-size:11px}
  1347. .aff-tri-table th,.aff-tri-table td{padding:6px 4px}
  1348. .tri-custom-input{width:60px;font-size:12px}
  1349. }
  1350. .gap-chart-head{display:flex;align-items:baseline;gap:14px;margin-bottom:18px;
  1351. border-bottom:1px solid var(--border);padding-bottom:10px}
  1352. .gap-chart-title{font-size:16px;font-weight:700;color:var(--text);
  1353. font-family:var(--font-display),'Noto Serif SC',serif;letter-spacing:-0.3px;
  1354. font-feature-settings:'lnum' 1,'tnum' 1;font-variant-numeric:lining-nums tabular-nums}
  1355. .gap-chart-meta{font-size:12px;color:var(--text-dim);margin-left:auto}
  1356. .gap-row{display:grid;grid-template-columns:120px 1fr 100px;gap:14px;align-items:center;
  1357. padding:10px 0;border-bottom:1px dashed var(--border)}
  1358. .gap-row:last-child{border-bottom:none}
  1359. .gap-label{font-size:13px;font-weight:600;color:var(--text);display:flex;align-items:center;gap:6px}
  1360. .gap-bar-wrap{position:relative;height:24px;background:var(--gold-pale);border-radius:6px;overflow:hidden}
  1361. .gap-bar-existing{position:absolute;top:0;left:0;height:100%;background:linear-gradient(90deg,#9B7C3A,#B89A52);
  1362. transition:width .8s ease;display:flex;align-items:center;justify-content:flex-end;padding-right:6px;
  1363. font-size:10px;color:#fff;font-weight:600}
  1364. .gap-bar-gap{position:absolute;top:0;height:100%;background:linear-gradient(90deg,#E87070,#A61C2B);
  1365. transition:all .8s ease;display:flex;align-items:center;justify-content:flex-end;padding-right:6px;
  1366. font-size:10px;color:#fff;font-weight:600}
  1367. .gap-amount{font-family:'Cormorant Garamond',serif;font-feature-settings:"lnum","tnum";
  1368. font-weight:600;color:var(--text);font-size:13px;text-align:right}
  1369. .gap-amount .gap-num{color:var(--c-red)}
  1370. /* === Phase 3 · 推荐产品区 === */
  1371. .product-section{background:var(--card-bg);border:1px solid var(--border);
  1372. border-radius:var(--radius);padding:24px 28px;margin-bottom:24px}
  1373. .product-tabs{display:flex;gap:0;margin-bottom:16px;border-bottom:2px solid var(--border)}
  1374. /* === [v4.4.2] 通用 ⓘ Popover 组件 · 注解折叠节省空间 === */
  1375. .info-pill{
  1376. display:inline-flex;align-items:center;gap:6px;
  1377. padding:5px 12px;background:rgba(196,151,58,.12);
  1378. border:1px solid rgba(196,151,58,.40);border-radius:14px;
  1379. color:#C4973A;font-size:11.5px;cursor:pointer;
  1380. transition:all .15s;font-family:inherit;line-height:1.4;
  1381. user-select:none;white-space:nowrap;
  1382. }
  1383. .info-pill:hover{background:rgba(196,151,58,.22);transform:translateY(-1px)}
  1384. .info-pill .info-icon{font-size:13px;font-weight:700;line-height:1}
  1385. .info-pill .info-label{font-weight:600}
  1386. .info-pill .info-count{color:#7A6028;font-weight:500;font-size:10.5px}
  1387. .info-pill.info-pill-light{
  1388. background:rgba(245,230,184,.10);border-color:rgba(245,230,184,.35);color:#F5E6B8;
  1389. }
  1390. .info-pill.info-pill-light:hover{background:rgba(245,230,184,.20)}
  1391. /* ════════════════════════════════════════════════════════════════════
  1392. [v4.8 · 2026-06-26] 客户家庭报告 · 一页总结(报告尾部"客户带走"卡)
  1393. 外侧 pale-gold 横带 + 内侧白底大字 + 三色编码 3 步行动
  1394. ════════════════════════════════════════════════════════════════════ */
  1395. .client-summary-card{
  1396. background:var(--card);
  1397. border:1px solid var(--accent-light);
  1398. border-left:5px solid var(--accent);
  1399. border-radius:12px;
  1400. padding:28px 32px;
  1401. margin:0 auto;
  1402. max-width:920px;
  1403. box-shadow:0 6px 24px rgba(60,50,30,0.10);
  1404. display:none; /* 由 renderClientSummary() 决定显示 */
  1405. }
  1406. .client-summary-card.show{display:block}
  1407. .cs-head{
  1408. display:flex;align-items:center;gap:12px;margin-bottom:6px;
  1409. }
  1410. .cs-icon{font-size:22px}
  1411. .cs-title{
  1412. font-family:'Cormorant Garamond','Noto Serif SC',serif;
  1413. font-size:1.8rem;font-weight:700;color:var(--text);
  1414. letter-spacing:-0.3px
  1415. }
  1416. .cs-tag{
  1417. margin-left:auto;
  1418. font-size:9.5px;letter-spacing:2.5px;
  1419. color:var(--accent);
  1420. background:var(--accent-dim);
  1421. border:1px solid var(--accent-light);
  1422. padding:3px 10px;border-radius:100px;
  1423. text-transform:uppercase;font-weight:700
  1424. }
  1425. .cs-subtitle{
  1426. font-size:12.5px;color:var(--text-dim);
  1427. margin-bottom:22px;line-height:1.7;
  1428. padding-bottom:14px;border-bottom:1px solid var(--border)
  1429. }
  1430. /* 一句话诊断 · 故事化 */
  1431. .cs-headline{
  1432. font-size:15px;line-height:1.85;
  1433. color:var(--text);
  1434. margin-bottom:22px;
  1435. padding:14px 18px;
  1436. background:var(--gold-pale);
  1437. border-left:3px solid var(--accent);
  1438. border-radius:0 6px 6px 0;
  1439. font-family:'Noto Serif SC',serif;font-weight:500
  1440. }
  1441. .cs-headline strong{color:var(--accent);font-weight:700}
  1442. .cs-headline .cs-h-num{
  1443. font-family:'Cormorant Garamond',serif;font-weight:900;
  1444. letter-spacing:-0.02em;font-size:1.1em
  1445. }
  1446. /* 关键指标 4 列 */
  1447. .cs-metrics{
  1448. display:grid;grid-template-columns:repeat(4,1fr);gap:0;
  1449. border:1px solid var(--border);border-radius:8px;
  1450. margin-bottom:24px;overflow:hidden
  1451. }
  1452. .cs-metric{
  1453. padding:16px 14px;text-align:center;
  1454. border-right:1px solid var(--border);
  1455. background:#FFF
  1456. }
  1457. .cs-metric:last-child{border-right:none}
  1458. .cs-metric-label{
  1459. font-size:10px;color:var(--text-dim);
  1460. letter-spacing:1.5px;font-weight:600;
  1461. text-transform:uppercase;margin-bottom:8px
  1462. }
  1463. .cs-metric-value{
  1464. font-family:'Cormorant Garamond','Noto Serif SC',serif;
  1465. font-size:1.8rem;font-weight:900;
  1466. color:var(--accent);letter-spacing:-0.04em;line-height:1.1;
  1467. font-feature-settings:'lnum' 1,'tnum' 1
  1468. }
  1469. .cs-metric-value-text{font-size:1.3rem;color:var(--text)}
  1470. .cs-metric-sub{
  1471. font-size:10.5px;color:var(--text-dim);
  1472. margin-top:6px;line-height:1.4
  1473. }
  1474. @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)}}
  1475. /* 接下来 3 件事 */
  1476. .cs-actions-head{
  1477. font-family:'Cormorant Garamond','Noto Serif SC',serif;
  1478. font-size:1.15rem;font-weight:700;
  1479. color:var(--text);
  1480. margin-bottom:14px;letter-spacing:-0.2px
  1481. }
  1482. .cs-actions{
  1483. display:flex;flex-direction:column;gap:10px;
  1484. margin-bottom:24px
  1485. }
  1486. .cs-action{
  1487. display:flex;gap:14px;
  1488. padding:14px 18px;
  1489. background:#FFF;
  1490. border:1px solid var(--border);
  1491. border-radius:8px;
  1492. transition:box-shadow .15s, transform .15s
  1493. }
  1494. .cs-action:hover{box-shadow:0 4px 14px rgba(60,50,30,0.08);transform:translateY(-1px)}
  1495. .cs-action-num{
  1496. flex-shrink:0;
  1497. width:32px;height:32px;border-radius:50%;
  1498. display:flex;align-items:center;justify-content:center;
  1499. font-family:'Cormorant Garamond',serif;font-weight:900;
  1500. font-size:16px;color:#FFF;letter-spacing:-0.02em
  1501. }
  1502. .cs-action--base .cs-action-num{background:linear-gradient(135deg,#E07A3B,#9B4D1F)}
  1503. .cs-action--mid .cs-action-num{background:linear-gradient(135deg,#D4A93A,#9B7C3A)}
  1504. .cs-action--high .cs-action-num{background:linear-gradient(135deg,#7A3FA0,#4A1F70)}
  1505. .cs-action-body{flex:1;min-width:0}
  1506. .cs-action-head{
  1507. display:flex;align-items:baseline;gap:8px;
  1508. font-size:13.5px;font-weight:700;color:var(--text);
  1509. margin-bottom:4px
  1510. }
  1511. .cs-action-window{
  1512. font-size:11px;font-weight:600;
  1513. padding:2px 8px;border-radius:100px;
  1514. letter-spacing:0.5px
  1515. }
  1516. .cs-action--base .cs-action-window{background:rgba(224,122,59,0.12);color:#9B4D1F}
  1517. .cs-action--mid .cs-action-window{background:rgba(212,169,58,0.14);color:#8B6F1A}
  1518. .cs-action--high .cs-action-window{background:rgba(122,63,160,0.10);color:#5C2A7A}
  1519. .cs-action-desc{
  1520. font-size:12px;color:var(--text-dim);
  1521. line-height:1.65
  1522. }
  1523. .cs-action-desc strong{color:var(--text);font-weight:600}
  1524. /* CTA · 联系顾问 */
  1525. .cs-cta{
  1526. background:linear-gradient(135deg,#1A0F05 0%,#2A1F0F 60%,#3D2914 100%);
  1527. color:#F5E6B8;
  1528. border-radius:8px;
  1529. padding:18px 24px;
  1530. text-align:center;
  1531. box-shadow:inset 0 0 0 1px rgba(196,151,58,0.20)
  1532. }
  1533. .cs-cta-msg{
  1534. font-size:13.5px;font-weight:600;
  1535. color:#F5E6B8;
  1536. margin-bottom:8px
  1537. }
  1538. .cs-cta-contact{
  1539. font-size:11.5px;
  1540. color:rgba(245,230,184,0.85);
  1541. letter-spacing:0.3px;
  1542. display:flex;align-items:center;justify-content:center;
  1543. gap:10px;flex-wrap:wrap
  1544. }
  1545. .cs-cta-contact strong{color:#C8AB60;font-weight:700;letter-spacing:0.5px}
  1546. .cs-cta-divider{opacity:0.4}
  1547. .info-pill.info-pill-warn{
  1548. background:rgba(232,112,112,.12);border-color:rgba(232,112,112,.40);color:#E87070;
  1549. }
  1550. .info-pill.info-pill-warn:hover{background:rgba(232,112,112,.22)}
  1551. .info-popover-overlay{
  1552. position:fixed;top:0;left:0;right:0;bottom:0;
  1553. background:rgba(0,0,0,.45);backdrop-filter:blur(2px);
  1554. display:none;align-items:center;justify-content:center;
  1555. z-index:1000;animation:popoverFadeIn .15s ease-out;
  1556. }
  1557. .info-popover-overlay.is-open{display:flex}
  1558. @keyframes popoverFadeIn{from{opacity:0}to{opacity:1}}
  1559. .info-popover{
  1560. background:linear-gradient(180deg,#1A0F05 0%,#2A1F0F 100%);
  1561. color:#F5E6B8;padding:0;border-radius:10px;
  1562. border:1px solid rgba(196,151,58,.50);
  1563. box-shadow:0 16px 60px rgba(0,0,0,.55);
  1564. max-width:540px;width:90%;max-height:80vh;
  1565. display:flex;flex-direction:column;
  1566. font-size:12px;line-height:1.75;
  1567. animation:popoverSlideIn .2s ease-out;
  1568. }
  1569. @keyframes popoverSlideIn{from{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}
  1570. .info-popover-head{
  1571. display:flex;align-items:center;gap:12px;
  1572. padding:14px 18px;border-bottom:1px solid rgba(196,151,58,.25);
  1573. font-family:'Noto Serif SC',serif;font-weight:700;font-size:14px;
  1574. color:#F5E6B8;letter-spacing:-.2px;
  1575. }
  1576. .info-popover-head .info-pop-icon{font-size:18px}
  1577. .info-popover-close{
  1578. margin-left:auto;background:transparent;border:1px solid rgba(196,151,58,.40);
  1579. color:#C4973A;width:26px;height:26px;border-radius:50%;
  1580. cursor:pointer;font-size:14px;line-height:1;
  1581. display:flex;align-items:center;justify-content:center;
  1582. transition:all .15s;
  1583. }
  1584. .info-popover-close:hover{background:rgba(196,151,58,.20);color:#F5E6B8}
  1585. .info-popover-body{
  1586. padding:16px 18px;overflow-y:auto;flex:1;
  1587. font-size:12px;line-height:1.75;color:rgba(245,230,184,.88);
  1588. }
  1589. .info-popover-body p{margin:0 0 12px 0}
  1590. .info-popover-body p:last-child{margin-bottom:0}
  1591. .info-popover-body strong{color:#F5E6B8;font-weight:700}
  1592. .info-popover-body ul{margin:8px 0;padding-left:20px}
  1593. .info-popover-body li{margin:4px 0}
  1594. .info-popover-body .info-row{
  1595. margin:10px 0;padding:10px 12px;
  1596. background:rgba(196,151,58,.08);border-left:2px solid #C4973A;
  1597. border-radius:0 4px 4px 0;
  1598. }
  1599. .info-popover-body .info-row.info-row-warn{
  1600. background:rgba(232,112,112,.08);border-left-color:#E87070;
  1601. }
  1602. /* === [v4.5.2] 方案切换器 · 建议 vs 可负担 === */
  1603. .cf-scenario-switch{
  1604. display:flex;align-items:center;gap:10px;flex-wrap:wrap;
  1605. padding:12px 14px;margin-bottom:14px;
  1606. background:rgba(196,151,58,.06);border:1px solid rgba(196,151,58,.25);border-radius:8px;
  1607. }
  1608. .cf-scenario-label{font-size:11.5px;color:#7A6028;font-weight:600;letter-spacing:.3px;flex-shrink:0}
  1609. .cf-scenario-btn{
  1610. display:inline-flex;align-items:center;gap:8px;
  1611. padding:8px 14px;background:#FFFFFF;border:1px solid #C9A84C;
  1612. border-radius:6px;cursor:pointer;font-family:inherit;
  1613. transition:all .15s;font-size:12px;color:#5C4810;
  1614. user-select:none;
  1615. }
  1616. .cf-scenario-btn:hover{background:#FAF6E8;border-color:#9B7C3A}
  1617. .cf-scenario-btn.is-active{
  1618. background:linear-gradient(135deg,#9B7C3A,#C4973A);color:#F5E6B8;
  1619. border-color:#7A6028;box-shadow:0 2px 8px rgba(155,124,58,.30);
  1620. }
  1621. .cf-scenario-btn.is-active.is-affordable{
  1622. background:linear-gradient(135deg,#2DB37C,#5DB890);border-color:#1F8557;
  1623. box-shadow:0 2px 8px rgba(45,179,124,.30);
  1624. }
  1625. /* [v4.6] 自定义方案按钮 active 态 · 蓝色与三轨 C 列保持一致 */
  1626. .cf-scenario-btn.is-active.is-custom{
  1627. background:linear-gradient(135deg,#2B6CB0,#3A82C4);color:#FFFFFF;border-color:#1E4F8A;
  1628. box-shadow:0 2px 8px rgba(43,108,176,.32);
  1629. }
  1630. .cf-scenario-btn.is-custom:not(.is-active){
  1631. border-color:#B8C9DD;color:#2B6CB0;
  1632. }
  1633. .cf-scenario-btn.is-custom:not(.is-active):hover{
  1634. background:#EEF4FF;border-color:#2B6CB0;
  1635. }
  1636. .scn-icon{font-size:14px;line-height:1}
  1637. .scn-name{font-weight:700;letter-spacing:.2px}
  1638. .scn-detail{font-family:'Cormorant Garamond',serif;font-feature-settings:'lnum','tnum';
  1639. font-weight:500;font-size:11px;opacity:.85;margin-left:4px;
  1640. padding-left:8px;border-left:1px solid currentColor;border-left-color:rgba(255,255,255,.30)}
  1641. .cf-scenario-btn:not(.is-active) .scn-detail{border-left-color:rgba(122,96,40,.30);color:#7A6028}
  1642. .cf-scenario-hint{flex:1;font-size:11px;color:#7A6028;font-style:italic;
  1643. text-align:right;line-height:1.5;min-width:200px}
  1644. /* === [v4.5.1] 风险对冲覆盖 KPI 卡片 · 把死亡赔付重新包装 === */
  1645. .risk-hedge-kpi{
  1646. background:linear-gradient(135deg,#1A0F05 0%,#2A1F0F 50%,#3D2914 100%);
  1647. color:#F5E6B8;border-radius:12px;padding:20px 24px;margin-top:20px;
  1648. border:1px solid rgba(196,151,58,.40);
  1649. box-shadow:0 8px 28px rgba(0,0,0,.25);
  1650. position:relative;overflow:hidden;
  1651. }
  1652. .risk-hedge-kpi::before{
  1653. content:'';position:absolute;top:-50%;right:-30%;width:400px;height:300px;
  1654. background:radial-gradient(circle,rgba(196,151,58,.20) 0%,transparent 70%);
  1655. pointer-events:none;
  1656. }
  1657. .rhk-head{display:flex;align-items:center;gap:10px;margin-bottom:16px;
  1658. border-bottom:1px solid rgba(196,151,58,.20);padding-bottom:12px;position:relative;z-index:1}
  1659. .rhk-icon{font-size:22px}
  1660. .rhk-title{font-family:'Noto Serif SC',serif;font-weight:700;font-size:15px;color:#F5E6B8;letter-spacing:-.3px}
  1661. .rhk-body{display:flex;align-items:center;gap:32px;flex-wrap:wrap;position:relative;z-index:1}
  1662. .rhk-value-block{flex-shrink:0;text-align:center;min-width:200px;padding-right:24px;
  1663. border-right:1px solid rgba(196,151,58,.25)}
  1664. .rhk-value{font-family:'Cormorant Garamond','Noto Serif SC',serif;
  1665. font-weight:900;font-size:3.2rem;color:#F5E6B8;letter-spacing:-.04em;line-height:1;
  1666. font-feature-settings:'lnum' 1,'tnum' 1;
  1667. text-shadow:0 2px 12px rgba(196,151,58,.30)}
  1668. .rhk-value-label{font-size:11.5px;color:#C4973A;letter-spacing:.5px;margin-top:6px;font-weight:500}
  1669. .rhk-pillars{flex:1;display:grid;grid-template-columns:repeat(5,1fr);gap:10px;min-width:0}
  1670. .rhk-pillar{display:flex;flex-direction:column;align-items:center;gap:3px;
  1671. padding:10px 6px;background:rgba(245,230,184,.06);border:1px solid rgba(196,151,58,.22);
  1672. border-radius:6px;text-align:center;transition:all .15s}
  1673. .rhk-pillar:hover{background:rgba(245,230,184,.12);border-color:rgba(196,151,58,.40);transform:translateY(-1px)}
  1674. .rhk-pillar-icon{font-size:18px;line-height:1}
  1675. .rhk-pillar-name{font-size:11.5px;font-weight:700;color:#F5E6B8;letter-spacing:.2px;margin-top:2px}
  1676. .rhk-pillar-desc{font-size:10px;color:#C4973A;line-height:1.35;opacity:.85}
  1677. .rhk-footer{margin-top:14px;padding-top:12px;border-top:1px solid rgba(196,151,58,.20);
  1678. font-size:11.5px;color:rgba(245,230,184,.70);line-height:1.65;position:relative;z-index:1}
  1679. .rhk-footer strong{color:#F5E6B8;font-weight:700}
  1680. /* === [v4.5.2] 杠杆比指标(可负担方案下显示) === */
  1681. .rhk-leverage{
  1682. display:flex;align-items:center;gap:18px;flex-wrap:wrap;
  1683. margin-top:14px;padding:12px 16px;
  1684. background:linear-gradient(90deg,rgba(45,179,124,.18) 0%,rgba(196,151,58,.10) 100%);
  1685. border:1px solid rgba(45,179,124,.40);border-radius:8px;
  1686. position:relative;z-index:1;
  1687. }
  1688. .rhk-lev-block{display:flex;align-items:center;gap:8px}
  1689. .rhk-lev-icon{font-size:16px}
  1690. .rhk-lev-label{font-size:11.5px;color:#90E0B0;font-weight:600;letter-spacing:.3px}
  1691. .rhk-lev-value{
  1692. font-family:'Cormorant Garamond',serif;font-feature-settings:'lnum','tnum';
  1693. font-weight:900;font-size:2.2rem;color:#90E0B0;letter-spacing:-.04em;line-height:1;
  1694. display:flex;align-items:baseline;
  1695. }
  1696. .rhk-lev-value > span{}
  1697. .rhk-lev-desc{flex:1;font-size:11.5px;color:rgba(245,230,184,.85);line-height:1.6;
  1698. border-left:1px solid rgba(196,151,58,.30);padding-left:14px}
  1699. .rhk-lev-desc strong{color:#90E0B0;font-weight:700}
  1700. @media (max-width:900px){
  1701. .rhk-leverage{flex-direction:column;align-items:flex-start}
  1702. .rhk-lev-desc{border-left:none;padding-left:0;margin-top:6px}
  1703. }
  1704. @media (max-width:900px){
  1705. .rhk-body{flex-direction:column;align-items:stretch}
  1706. .rhk-value-block{border-right:none;border-bottom:1px solid rgba(196,151,58,.25);
  1707. padding-right:0;padding-bottom:18px;margin-bottom:8px}
  1708. .rhk-pillars{grid-template-columns:repeat(2,1fr)}
  1709. }
  1710. /* === v4.4 现金流规划段 · LDI 视角 === */
  1711. .cashflow-section{
  1712. /* [v4.8 · 2026-06-26 测试] 风险对冲覆盖卡片外侧改为纯白 band 看效果 */
  1713. position:relative;
  1714. background:var(--card);
  1715. box-shadow:0 0 0 100vmax var(--card);
  1716. clip-path:inset(0 -100vmax);
  1717. border:none;border-radius:0;
  1718. padding:32px 0;margin:0
  1719. }
  1720. .cf-section-head{display:flex;align-items:baseline;gap:14px;margin-bottom:8px;
  1721. border-bottom:1px solid rgba(201,168,76,.3);padding-bottom:10px}
  1722. .cf-section-title{font-family:'Noto Serif SC',serif;font-size:17px;font-weight:700;
  1723. color:#3D2914;letter-spacing:-0.3px}
  1724. .cf-section-meta{font-size:11.5px;color:#7A6028;margin-left:auto}
  1725. .cf-chart-wrap{margin-top:18px;background:#FFFFFF;border-radius:8px;padding:18px 20px;
  1726. border:1px solid #E8DFC8}
  1727. .cf-chart-head{display:flex;align-items:baseline;gap:14px;margin-bottom:14px}
  1728. .cf-chart-title{font-size:13px;font-weight:600;color:#1A0F05}
  1729. .cf-chart-meta{font-size:10.5px;color:#7A6028;margin-left:auto}
  1730. .cf-canvas-wrap canvas{cursor:crosshair}
  1731. .cf-tooltip{position:absolute;background:#1A0F05;color:#F5E6B8;
  1732. padding:8px 12px;border-radius:6px;font-size:11px;line-height:1.6;
  1733. pointer-events:none;z-index:100;box-shadow:0 4px 12px rgba(0,0,0,.3);
  1734. font-family:'Inter','Noto Sans SC',sans-serif;max-width:240px;
  1735. border:1px solid rgba(196,151,58,.4)}
  1736. .cf-tooltip strong{color:#F5E6B8;font-weight:700}
  1737. .cf-tooltip .tooltip-row{display:flex;justify-content:space-between;gap:14px;margin:2px 0}
  1738. .cf-tooltip .tooltip-dot{display:inline-block;width:8px;height:8px;border-radius:2px;margin-right:4px;vertical-align:baseline}
  1739. .cf-legend{display:flex;flex-wrap:wrap;gap:14px;margin-top:14px;padding-top:14px;
  1740. border-top:1px solid #E8DFC8;font-size:11.5px;color:#5C4810}
  1741. .cf-legend-item{display:flex;align-items:center;gap:5px}
  1742. .cf-dot{display:inline-block;width:10px;height:10px;border-radius:2px}
  1743. .cf-insights{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:18px}
  1744. .cf-insight{padding:12px 14px;border-radius:8px;font-size:11.5px;line-height:1.6}
  1745. .cf-insight strong{color:#1A0F05;font-weight:700;display:block;margin-bottom:4px;font-size:12px}
  1746. .cf-insight-peak{background:rgba(166,28,43,.08);border-left:3px solid #A61C2B;color:#5C1B1F}
  1747. .cf-insight-mid{background:rgba(196,151,58,.08);border-left:3px solid #C4973A;color:#5C4810}
  1748. .cf-insight-end{background:rgba(141,185,213,.08);border-left:3px solid #3D6F8C;color:#1F3F4D}
  1749. .ldi-suggestion{margin-top:16px;padding:14px 18px;
  1750. background:linear-gradient(90deg,rgba(122,90,142,0.08),rgba(196,151,58,0.06));
  1751. border-left:3px solid #7A5A8E;border-radius:0 6px 6px 0;font-size:12px;
  1752. line-height:1.7;color:#3D2914}
  1753. .ldi-suggestion strong{color:#7A5A8E;font-weight:700}
  1754. @media (max-width:900px){
  1755. .cf-insights{grid-template-columns:1fr}
  1756. }
  1757. .product-tab{padding:10px 20px;font-size:13px;color:var(--text-dim);cursor:pointer;font-weight:500;
  1758. border-bottom:3px solid transparent;margin-bottom:-2px;transition:all .2s;font-family:'Noto Serif SC',serif}
  1759. .product-tab:hover{color:var(--accent)}
  1760. .product-tab.active{color:var(--accent);border-bottom-color:var(--accent);font-weight:600}
  1761. .product-pane{display:none}
  1762. .product-pane.active{display:block}
  1763. .product-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:14px}
  1764. .product-item{background:#fff;border:1px solid var(--border);border-radius:6px;padding:14px 16px;
  1765. border-left:3px solid var(--accent);transition:all .15s}
  1766. .product-item:hover{border-color:var(--accent);box-shadow:0 4px 12px rgba(196,151,58,.1)}
  1767. .product-item.hot{border-left-color:#A61C2B;background:linear-gradient(135deg,#FFF8F8,#FFF)}
  1768. .product-name{font-size:14.5px;font-weight:700;color:var(--text);margin-bottom:4px;display:flex;
  1769. align-items:center;gap:6px;
  1770. font-family:var(--font-display),'Noto Serif SC',serif;letter-spacing:-0.2px;
  1771. font-feature-settings:'lnum' 1,'tnum' 1;font-variant-numeric:lining-nums tabular-nums}
  1772. .product-issuer{font-size:11px;color:var(--text-dim);margin-bottom:6px;
  1773. font-family:var(--font-sans);letter-spacing:.3px;text-transform:uppercase;font-weight:600}
  1774. .product-tagline{font-size:12px;color:var(--accent-deep);font-style:italic;margin-bottom:8px;line-height:1.5;
  1775. font-family:var(--font-eb),'Noto Serif SC',serif}
  1776. .product-feats{font-size:11.5px;color:var(--text-dim);line-height:1.7;
  1777. font-family:var(--font-sans)}
  1778. .product-feats li{margin-bottom:2px;list-style:none;padding-left:14px;position:relative}
  1779. .product-feats li::before{content:"▸";position:absolute;left:2px;color:var(--accent)}
  1780. .product-meta{display:flex;justify-content:space-between;align-items:center;margin-top:10px;
  1781. padding-top:8px;border-top:1px dashed var(--border);font-size:11px;color:var(--text-dim)}
  1782. .product-meta .v{font-weight:600;color:var(--accent);font-family:'Cormorant Garamond',serif;font-feature-settings:"lnum","tnum"}
  1783. .hot-badge{font-size:9px;background:linear-gradient(135deg,#A61C2B,#8B1C15);color:#fff;
  1784. padding:1px 6px;border-radius:8px;letter-spacing:.5px;font-weight:700}
  1785. /* === 产品详情 Modal(v2026-06-13)· 点击产品卡弹出 === */
  1786. .product-modal{
  1787. position:fixed;inset:0;background:rgba(26,15,5,.5);z-index:1000;
  1788. display:none;align-items:flex-start;justify-content:center;
  1789. backdrop-filter:blur(4px);overflow-y:auto;padding:40px 20px;
  1790. }
  1791. .product-modal.active{display:flex;animation:pmFadeIn .2s ease}
  1792. @keyframes pmFadeIn{from{opacity:0}to{opacity:1}}
  1793. .pm-card{
  1794. background:#fff;border-radius:12px;
  1795. max-width:680px;width:100%;
  1796. box-shadow:0 20px 60px rgba(0,0,0,.3);
  1797. position:relative;overflow:hidden;
  1798. animation:pmSlideIn .25s ease;
  1799. }
  1800. @keyframes pmSlideIn{from{transform:translateY(-20px);opacity:0}to{transform:translateY(0);opacity:1}}
  1801. .pm-close{
  1802. position:absolute;top:16px;right:16px;
  1803. width:32px;height:32px;border-radius:50%;
  1804. background:var(--bg);border:1px solid var(--border);
  1805. display:flex;align-items:center;justify-content:center;
  1806. font-size:18px;color:var(--text-dim);cursor:pointer;
  1807. transition:all .15s;z-index:10;
  1808. }
  1809. .pm-close:hover{background:var(--c-red);color:#fff;border-color:var(--c-red)}
  1810. .pm-header{
  1811. background:linear-gradient(135deg,#1A0F05,#3D2914);
  1812. color:#fff;padding:32px 36px 24px;
  1813. }
  1814. .pm-eyebrow{
  1815. font-family:var(--font-sans);
  1816. font-size:10.5px;color:#C4973A;letter-spacing:1.8px;text-transform:uppercase;
  1817. font-weight:700;margin-bottom:10px;
  1818. }
  1819. .pm-title{
  1820. font-family:var(--font-display),'Noto Serif SC',serif;
  1821. font-size:1.5rem;font-weight:700;color:#F5E6B8;letter-spacing:-0.3px;
  1822. line-height:1.3;margin-bottom:6px;display:flex;align-items:center;gap:10px;flex-wrap:wrap;
  1823. }
  1824. .pm-title-en{
  1825. font-family:var(--font-eb),'Noto Serif SC',serif;
  1826. font-size:.85rem;color:rgba(245,230,184,.5);font-style:italic;margin-bottom:14px;
  1827. }
  1828. .pm-meta-row{
  1829. font-family:var(--font-sans);
  1830. font-size:11.5px;color:rgba(245,230,184,.65);
  1831. display:flex;flex-wrap:wrap;gap:12px;
  1832. }
  1833. .pm-meta-row .pm-meta-item{display:flex;align-items:center;gap:5px}
  1834. .pm-tagline{
  1835. font-family:var(--font-eb),'Noto Serif SC',serif;
  1836. font-size:.95rem;color:rgba(245,230,184,.85);font-style:italic;
  1837. margin-top:14px;padding-top:14px;
  1838. border-top:1px solid rgba(196,151,58,.2);
  1839. line-height:1.6;
  1840. }
  1841. .pm-body{padding:28px 36px}
  1842. .pm-section{margin-bottom:22px}
  1843. .pm-section:last-child{margin-bottom:0}
  1844. .pm-section-title{
  1845. font-family:var(--font-display),'Noto Serif SC',serif;
  1846. font-size:13px;color:var(--accent-deep);font-weight:700;
  1847. letter-spacing:-0.2px;margin-bottom:10px;
  1848. display:flex;align-items:center;gap:8px;
  1849. }
  1850. .pm-section-title::before{content:"";width:4px;height:14px;background:var(--accent);border-radius:2px}
  1851. .pm-grid-2{display:grid;grid-template-columns:1fr 1fr;gap:10px 16px;font-size:12.5px}
  1852. .pm-grid-2 .pm-label{color:var(--text-dim);font-family:var(--font-sans)}
  1853. .pm-grid-2 .pm-value{color:var(--text);font-weight:600;
  1854. font-family:var(--font-num);font-feature-settings:'lnum' 1,'tnum' 1;
  1855. font-variant-numeric:lining-nums tabular-nums;letter-spacing:-0.02em}
  1856. .pm-list{margin:0;padding:0;list-style:none}
  1857. .pm-list li{
  1858. font-family:var(--font-sans);
  1859. font-size:12.5px;color:var(--text-dim);line-height:1.7;
  1860. padding-left:18px;position:relative;margin-bottom:6px;
  1861. }
  1862. .pm-list li::before{
  1863. content:"▸";position:absolute;left:2px;color:var(--accent);font-weight:700;
  1864. }
  1865. .pm-tags{display:flex;flex-wrap:wrap;gap:6px}
  1866. .pm-tag{
  1867. font-family:var(--font-sans);
  1868. background:var(--accent-dim);color:var(--accent-deep);
  1869. padding:4px 10px;border-radius:100px;font-size:11px;font-weight:600;
  1870. }
  1871. .pm-indices-table{
  1872. width:100%;border-collapse:collapse;font-size:11.5px;
  1873. background:#fff;border:1px solid var(--border);border-radius:6px;overflow:hidden;
  1874. }
  1875. .pm-indices-table th{
  1876. background:var(--accent-dim);color:var(--accent-deep);
  1877. font-family:var(--font-sans);font-weight:700;
  1878. padding:8px 12px;text-align:left;font-size:10.5px;letter-spacing:.5px;text-transform:uppercase;
  1879. }
  1880. .pm-indices-table td{
  1881. padding:8px 12px;border-top:1px solid var(--border);
  1882. color:var(--text);font-family:var(--font-sans);
  1883. }
  1884. .pm-indices-table td:first-child{font-weight:600;color:var(--text)}
  1885. .pm-partner-box{
  1886. background:linear-gradient(135deg,#FFF8E7 0%,#FFFEF9 100%);
  1887. border:1px solid var(--border);border-left:4px solid var(--accent);
  1888. border-radius:6px;padding:12px 16px;
  1889. font-family:var(--font-sans);font-size:12.5px;color:var(--text);line-height:1.7;
  1890. }
  1891. .pm-partner-box .pm-partner-label{
  1892. font-size:10.5px;color:var(--accent-deep);letter-spacing:1px;
  1893. text-transform:uppercase;font-weight:700;margin-bottom:4px;
  1894. }
  1895. .pm-partner-box .pm-partner-name{font-weight:700;color:var(--text);font-size:13.5px}
  1896. .pm-notes{
  1897. font-family:var(--font-sans);
  1898. font-size:11.5px;color:var(--text-dim);line-height:1.7;
  1899. background:var(--bg);padding:10px 14px;border-radius:6px;
  1900. }
  1901. .pm-footer{
  1902. border-top:1px solid var(--border);padding:16px 36px;
  1903. display:flex;justify-content:flex-end;gap:10px;
  1904. background:var(--bg);
  1905. }
  1906. .pm-btn{
  1907. padding:9px 22px;border-radius:6px;font-size:13px;font-weight:600;
  1908. cursor:pointer;border:1px solid var(--border);background:#fff;color:var(--text-dim);
  1909. font-family:var(--font-sans);transition:all .15s;
  1910. }
  1911. .pm-btn:hover{border-color:var(--accent);color:var(--accent)}
  1912. .pm-btn.primary{background:var(--accent);color:#fff;border-color:var(--accent)}
  1913. .pm-btn.primary:hover{background:var(--accent-deep)}
  1914. @media(max-width:768px){
  1915. .pm-grid-2{grid-template-columns:1fr}
  1916. .pm-header{padding:24px 24px 20px}
  1917. .pm-body,.pm-footer{padding:20px 24px}
  1918. }
  1919. /* === Phase 3 · 打印样式 === */
  1920. @media print {
  1921. body{background:#fff !important}
  1922. .topbar,.ctx-bar,.calc-row,.back-link,.ah-nav-btn,.btn,.ctx-btn,
  1923. .form-grid,.section-head:not(#planning-life){display:none !important}
  1924. #result{display:block !important;border:none;padding:0;margin:0}
  1925. .container{padding:20px;max-width:100%}
  1926. .policy-card{break-inside:avoid;page-break-inside:avoid;
  1927. box-shadow:none !important;transform:none !important}
  1928. .policy-card.life.hnw-mode{break-after:page}
  1929. .gap-chart-section,.product-section,.uhnw-card,.affordability-section,.wealth-picture-section{break-inside:avoid}
  1930. .result-cover{background:#1A0F05 !important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  1931. .product-tab,.life-track-tab{display:none}
  1932. .product-pane,.life-track-pane{display:block !important}
  1933. .footer{font-size:9px}
  1934. }
  1935. @media(max-width:768px){
  1936. .gap-row{grid-template-columns:80px 1fr 80px;gap:8px}
  1937. }
  1938. /* === Footer === */
  1939. .footer{margin-top:40px;padding-top:24px;border-top:1px solid var(--border);
  1940. text-align:center;font-size:11px;color:var(--text-dim);line-height:1.7;opacity:.85}
  1941. .footer .disclaimer{margin-top:8px;font-size:11px;opacity:.75}
  1942. /* 响应式 */
  1943. @media(max-width:768px){
  1944. .container{padding:20px 16px 40px}
  1945. .hero h1{font-size:1.8rem}
  1946. .form-grid{grid-template-columns:1fr}
  1947. .policy-grid{grid-template-columns:1fr}
  1948. .rc-summary{grid-template-columns:repeat(2,1fr)}
  1949. }
  1950. </style>
  1951. <style id="v01-hero-css">
  1952. /* --- 移植:hero容器+light!important覆盖 (源行1502-1567) --- */
  1953. .v01-hero{padding:48px 64px 24px;max-width:1440px;margin:0 auto;color:#F5E6B8;position:relative;z-index:1}
  1954. /* [v0.1 · 2026-06-27] Hero 卡片集群外侧 · 全宽白色横带 · 增强层次感
  1955. 用 box-shadow + clip-path 让白带从浏览器左到右,Hero 内容居中悬浮其上
  1956. Hero 内部所有卡片同时套用 light-theme 样式以适配白底 */
  1957. .v01-hero{
  1958. background:#FFFFFF;
  1959. box-shadow:0 0 0 100vmax #FFFFFF;
  1960. clip-path:inset(0 -100vmax);
  1961. color:#1A0F05
  1962. }
  1963. .v01-hero .v01-hero-title{color:#9B7C3A !important}
  1964. .v01-hero .v01-hero-headline{color:#1A0F05 !important}
  1965. .v01-hero .v01-hero-headline em{color:#9B7C3A !important}
  1966. /* Hero 内 · rings-wrap 强制 light · 在白底上仍有圆润卡片感 */
  1967. .v01-hero .v01-rings-wrap{
  1968. background:rgba(250,247,238,0.85) !important;
  1969. border:1px solid rgba(155,124,58,.20) !important
  1970. }
  1971. .v01-hero .v01-rings-title{color:#1A0F05 !important}
  1972. .v01-hero .v01-rings-perspective{color:rgba(122,96,40,.7) !important}
  1973. .v01-hero .v01-rings-subtitle{color:rgba(61,41,20,.55) !important}
  1974. .v01-hero .v01-ring-tile-track{stroke:rgba(155,124,58,.15) !important}
  1975. .v01-hero .v01-ring-tile:hover{background:rgba(155,124,58,.06) !important}
  1976. /* Hero 内 · KPI 强制 light */
  1977. .v01-hero .v01-kpi{
  1978. background:rgba(250,247,238,0.85) !important;
  1979. border:1px solid rgba(155,124,58,.22) !important;
  1980. color:#3D2914 !important
  1981. }
  1982. .v01-hero .v01-kpi-label{color:rgba(122,96,40,.7) !important}
  1983. .v01-hero .v01-kpi-value{color:#1A0F05 !important}
  1984. .v01-hero .v01-kpi-sub{color:rgba(61,41,20,.62) !important}
  1985. .v01-hero .v01-kpi-icon{filter:none}
  1986. /* Hero 内 · vis-card 强制 light */
  1987. .v01-hero .v01-vis-card{
  1988. background:rgba(250,247,238,0.85) !important;
  1989. border:1px solid rgba(155,124,58,.20) !important
  1990. }
  1991. .v01-hero .v01-vis-title{color:#1A0F05 !important}
  1992. .v01-hero .v01-vis-body{color:#3D2914 !important}
  1993. .v01-hero .v01-vis-foot{
  1994. color:rgba(61,41,20,.55) !important;
  1995. border-top:1px dashed rgba(155,124,58,.18) !important
  1996. }
  1997. /* mini-tri cells */
  1998. .v01-hero .v01-mini-tri-cell{background:rgba(155,124,58,.06) !important}
  1999. .v01-hero .v01-mini-tri-cell.is-aff{background:rgba(45,179,124,.10) !important}
  2000. .v01-hero .v01-mini-tri-cell.is-custom{background:rgba(122,63,160,.08) !important}
  2001. .v01-hero .v01-mini-tri-label{color:rgba(61,41,20,.65) !important}
  2002. .v01-hero .v01-mini-tri-num{color:#3D2914 !important}
  2003. /* emergency mini */
  2004. .v01-hero .v01-mini-emerg-num{color:#1A0F05 !important}
  2005. .v01-hero .v01-mini-emerg-unit{color:rgba(61,41,20,.55) !important}
  2006. .v01-hero .v01-mini-emerg-bar{background:rgba(155,124,58,.10) !important}
  2007. .v01-hero .v01-mini-emerg-scale{color:rgba(61,41,20,.50) !important}
  2008. .v01-hero-title{font-size:13px;letter-spacing:3px;color:rgba(201,168,76,.7);
  2009. text-transform:uppercase;margin-bottom:8px;font-weight:600}
  2010. .v01-hero-headline{font-size:32px;font-family:'Cormorant Garamond','Noto Serif SC',serif;
  2011. font-weight:700;color:#F5E6B8;margin:0 0 32px;letter-spacing:.5px;line-height:1.2}
  2012. .v01-hero-headline em{color:#C9A84C;font-style:italic}
  2013. /* --- 移植:popover (源行1570-1635) --- */
  2014. .v01-ring-popover-overlay{position:fixed;inset:0;z-index:200;
  2015. background:rgba(0,0,0,.5);backdrop-filter:blur(6px);
  2016. display:none;align-items:center;justify-content:center;padding:24px;
  2017. animation:v01PopOverlayIn .2s ease-out}
  2018. .v01-ring-popover-overlay.is-open{display:flex}
  2019. @keyframes v01PopOverlayIn{from{opacity:0}to{opacity:1}}
  2020. .v01-ring-popover{max-width:560px;width:100%;background:linear-gradient(180deg,#FAF8F2,#F5EFE0);
  2021. border:1px solid rgba(155,124,58,.30);border-radius:14px;padding:32px;
  2022. box-shadow:0 24px 64px rgba(0,0,0,.35);position:relative;
  2023. animation:v01PopIn .25s cubic-bezier(.4,0,.2,1);color:#3D2914;
  2024. font-family:'Noto Sans SC',sans-serif}
  2025. @keyframes v01PopIn{from{opacity:0;transform:translateY(20px) scale(.96)}to{opacity:1;transform:translateY(0) scale(1)}}
  2026. .v01-pop-close{position:absolute;top:14px;right:18px;width:32px;height:32px;
  2027. border-radius:50%;background:transparent;border:1px solid rgba(155,124,58,.30);
  2028. color:#9B7C3A;font-size:18px;line-height:1;cursor:pointer;
  2029. display:flex;align-items:center;justify-content:center;transition:all .15s}
  2030. .v01-pop-close:hover{background:rgba(155,124,58,.10);border-color:#9B7C3A}
  2031. .v01-pop-icon{font-size:36px;margin-bottom:8px}
  2032. .v01-pop-label{font-size:11px;letter-spacing:2.5px;color:rgba(122,96,40,.65);
  2033. text-transform:uppercase;font-weight:700;margin-bottom:4px}
  2034. .v01-pop-title{font-size:24px;font-family:'Cormorant Garamond','Noto Serif SC',serif;
  2035. font-weight:700;color:#3D2914;margin-bottom:6px;letter-spacing:.3px}
  2036. .v01-pop-score-row{display:flex;align-items:baseline;gap:12px;margin:14px 0 18px;
  2037. padding:12px 16px;background:rgba(155,124,58,.06);border-radius:8px;border:1px solid rgba(155,124,58,.20)}
  2038. .v01-pop-score-num{font-size:2.4rem;font-family:'Cormorant Garamond',serif;font-weight:700;
  2039. font-feature-settings:'lnum','tnum';color:#9B7C3A;line-height:1}
  2040. .v01-pop-score-unit{font-size:14px;color:rgba(122,96,40,.6)}
  2041. .v01-pop-score-status{margin-left:auto;font-size:13px;color:#9B7C3A;font-weight:600}
  2042. .v01-pop-section{margin-bottom:18px}
  2043. .v01-pop-section-label{font-size:11px;letter-spacing:1.5px;color:rgba(122,96,40,.7);
  2044. text-transform:uppercase;font-weight:700;margin-bottom:8px}
  2045. .v01-pop-formula{padding:12px 16px;background:#FFFBEC;border-left:3px solid #C9A84C;
  2046. border-radius:0 6px 6px 0;font-family:'Cormorant Garamond',serif;font-size:14.5px;
  2047. color:#3D2914;line-height:1.7;font-feature-settings:'lnum','tnum'}
  2048. .v01-pop-formula strong{color:#9B7C3A;font-weight:700}
  2049. .v01-pop-text{font-size:13.5px;line-height:1.75;color:#3D2914}
  2050. .v01-pop-text strong{color:#9B7C3A}
  2051. .v01-pop-actions{margin-top:20px;display:flex;gap:10px;flex-wrap:wrap}
  2052. .v01-pop-action-btn{padding:10px 18px;border-radius:8px;font-size:12.5px;
  2053. font-family:'Noto Sans SC',sans-serif;font-weight:600;letter-spacing:.5px;cursor:pointer;
  2054. border:1px solid rgba(155,124,58,.35);background:transparent;color:#3D2914;
  2055. transition:all .15s}
  2056. .v01-pop-action-btn:hover{background:rgba(155,124,58,.08);border-color:#9B7C3A}
  2057. .v01-pop-action-btn.is-primary{background:#9B7C3A;color:#FAF8F2;border-color:#9B7C3A}
  2058. .v01-pop-action-btn.is-primary:hover{background:#7A6028}
  2059. /* 深色版 popup */
  2060. body.v01-light:not(.theme-light) .v01-ring-popover{
  2061. background:linear-gradient(180deg,#2C1B0E,#1A0F05);color:#F5E6B8;
  2062. border-color:rgba(201,168,76,.30)}
  2063. body.v01-light:not(.theme-light) .v01-pop-close{color:#C9A84C;border-color:rgba(201,168,76,.30)}
  2064. body.v01-light:not(.theme-light) .v01-pop-close:hover{background:rgba(201,168,76,.12);border-color:#C9A84C}
  2065. body.v01-light:not(.theme-light) .v01-pop-label{color:rgba(201,168,76,.65)}
  2066. body.v01-light:not(.theme-light) .v01-pop-title{color:#F5E6B8}
  2067. body.v01-light:not(.theme-light) .v01-pop-score-row{background:rgba(201,168,76,.08);border-color:rgba(201,168,76,.20)}
  2068. body.v01-light:not(.theme-light) .v01-pop-score-num{color:#C9A84C}
  2069. body.v01-light:not(.theme-light) .v01-pop-score-unit{color:rgba(201,168,76,.6)}
  2070. body.v01-light:not(.theme-light) .v01-pop-score-status{color:#C9A84C}
  2071. body.v01-light:not(.theme-light) .v01-pop-section-label{color:rgba(201,168,76,.7)}
  2072. body.v01-light:not(.theme-light) .v01-pop-formula{background:rgba(201,168,76,.08);color:#F5E6B8}
  2073. body.v01-light:not(.theme-light) .v01-pop-formula strong{color:#C9A84C}
  2074. body.v01-light:not(.theme-light) .v01-pop-text{color:#F5E6B8}
  2075. body.v01-light:not(.theme-light) .v01-pop-text strong{color:#C9A84C}
  2076. body.v01-light:not(.theme-light) .v01-pop-action-btn{color:#F5E6B8;border-color:rgba(201,168,76,.35)}
  2077. body.v01-light:not(.theme-light) .v01-pop-action-btn:hover{background:rgba(201,168,76,.10);border-color:#C9A84C}
  2078. body.v01-light:not(.theme-light) .v01-pop-action-btn.is-primary{background:#C9A84C;color:#1A0F05;border-color:#C9A84C}
  2079. /* --- 移植:grid+左列+三环 (源行1637-1705) --- */
  2080. /* === Hero 主网格:左 三环+3KPI / 右 4 mini · [v0.1.5] 左右等高 === */
  2081. .v01-hero-grid{display:grid;grid-template-columns:540px 1fr;gap:32px;align-items:stretch}
  2082. @media (max-width:1200px){.v01-hero-grid{grid-template-columns:1fr;gap:24px}}
  2083. .v01-left-col{display:flex;flex-direction:column}
  2084. .v01-left-col > .v01-rings-wrap{flex:1 1 auto} /* 三环卡撑满左列剩余高度 */
  2085. /* === [v0.1.3] 三环卡片:Whoop 三环风格 + 视角切换 === */
  2086. .v01-rings-wrap{position:relative;background:rgba(255,255,255,.03);border:1px solid rgba(201,168,76,.18);
  2087. border-radius:18px;padding:24px 14px;backdrop-filter:blur(8px)}
  2088. .v01-rings-head{display:flex;align-items:baseline;justify-content:space-between;margin-bottom:18px;
  2089. padding:0 4px}
  2090. .v01-rings-perspective{font-size:11.5px;letter-spacing:2px;color:rgba(201,168,76,.7);
  2091. text-transform:uppercase;font-weight:600}
  2092. .v01-rings-subtitle{font-size:10.5px;color:rgba(245,230,184,.55);
  2093. font-family:'Cormorant Garamond',serif;font-style:italic;letter-spacing:.5px}
  2094. .v01-rings-row{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
  2095. .v01-ring-tile{display:flex;flex-direction:column;align-items:center;
  2096. padding:8px 2px;border-radius:10px;transition:background .2s;cursor:pointer;min-width:0}
  2097. .v01-ring-tile:hover{background:rgba(201,168,76,.06)}
  2098. .v01-ring-tile-canvas{width:100%;max-width:148px;aspect-ratio:1;position:relative}
  2099. .v01-ring-tile-canvas svg{width:100%;height:100%;transform:rotate(-90deg);overflow:visible}
  2100. .v01-ring-tile-track{fill:none;stroke:rgba(201,168,76,.15);stroke-width:11}
  2101. .v01-ring-tile-progress{fill:none;stroke-width:11;stroke-linecap:round;
  2102. transition:stroke-dashoffset 1.0s cubic-bezier(.4,0,.2,1)}
  2103. .v01-ring-tile-text{position:absolute;inset:0;display:flex;flex-direction:column;
  2104. align-items:center;justify-content:center;text-align:center}
  2105. .v01-ring-tile-icon{font-size:18px;margin-bottom:2px;opacity:.85}
  2106. .v01-ring-tile-num{font-size:2.6rem;font-family:'Cormorant Garamond',serif;
  2107. font-weight:600;line-height:1;color:#F5E6B8;font-feature-settings:'lnum','tnum'}
  2108. .v01-ring-tile-unit{font-size:.85rem;color:rgba(201,168,76,.5);margin-top:-2px;letter-spacing:1.5px}
  2109. .v01-ring-tile-label{margin-top:10px;font-size:11.5px;color:#C9A84C;font-weight:700;
  2110. letter-spacing:1px;text-align:center}
  2111. .v01-ring-tile-status{margin-top:4px;font-size:10.5px;color:rgba(245,230,184,.6);
  2112. text-align:center;line-height:1.3;min-height:14px}
  2113. /* 浅色版三环 */
  2114. body.v01-light.theme-light .v01-rings-wrap{background:rgba(255,255,255,.6);border:1px solid rgba(155,124,58,.20)}
  2115. body.v01-light.theme-light .v01-rings-perspective{color:rgba(122,96,40,.7)}
  2116. body.v01-light.theme-light .v01-rings-subtitle{color:rgba(61,41,20,.55)}
  2117. body.v01-light.theme-light .v01-ring-tile:hover{background:rgba(155,124,58,.06)}
  2118. body.v01-light.theme-light .v01-ring-tile-track{stroke:rgba(155,124,58,.15)}
  2119. body.v01-light.theme-light .v01-ring-tile-num{color:#3D2914}
  2120. body.v01-light.theme-light .v01-ring-tile-unit{color:rgba(155,124,58,.55)}
  2121. body.v01-light.theme-light .v01-ring-tile-label{color:#9B7C3A}
  2122. body.v01-light.theme-light .v01-ring-tile-status{color:rgba(61,41,20,.6)}
  2123. /* === 视角切换器(顶栏右侧)=== */
  2124. .v01-perspective-switcher{display:inline-flex;align-items:center;gap:0;
  2125. background:rgba(255,255,255,.04);border:1px solid rgba(201,168,76,.25);
  2126. border-radius:8px;padding:3px;font-family:'Noto Sans SC',sans-serif}
  2127. .v01-perspective-btn{padding:6px 11px;border-radius:6px;font-size:11px;
  2128. background:transparent;color:rgba(201,168,76,.7);border:none;cursor:pointer;
  2129. transition:all .15s;letter-spacing:.3px;white-space:nowrap;display:inline-flex;
  2130. align-items:center;gap:4px}
  2131. .v01-perspective-btn:hover{color:#C9A84C;background:rgba(201,168,76,.08)}
  2132. .v01-perspective-btn.is-active{background:linear-gradient(135deg,#C9A84C,#9B7C3A);
  2133. color:#1A0F05;font-weight:700}
  2134. body.v01-light.theme-light .v01-perspective-switcher{background:rgba(255,255,255,.5);border-color:rgba(155,124,58,.30)}
  2135. body.v01-light.theme-light .v01-perspective-btn{color:rgba(122,96,40,.7)}
  2136. body.v01-light.theme-light .v01-perspective-btn:hover{color:#9B7C3A;background:rgba(155,124,58,.08)}
  2137. body.v01-light.theme-light .v01-perspective-btn.is-active{background:linear-gradient(135deg,#C9A84C,#9B7C3A);color:#FAF8F2}
  2138. /* 移动端折叠 */
  2139. @media (max-width:900px){
  2140. .v01-rings-row{grid-template-columns:1fr}
  2141. .v01-ring-tile-canvas{width:140px;height:140px}
  2142. .v01-perspective-switcher{flex-wrap:wrap}
  2143. .v01-perspective-btn{font-size:10px;padding:5px 9px}
  2144. }
  2145. /* --- 移植:3KPI (源行1748-1769) --- */
  2146. .v01-kpi-row{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-top:18px}
  2147. .v01-kpi{background:rgba(255,255,255,.03);border:1px solid rgba(201,168,76,.18);
  2148. border-radius:12px;padding:18px 16px;cursor:pointer;transition:all .2s;position:relative}
  2149. .v01-kpi:hover{background:rgba(255,255,255,.06);border-color:rgba(201,168,76,.4);
  2150. transform:translateY(-2px)}
  2151. .v01-kpi-icon{font-size:18px;margin-bottom:6px;opacity:.8}
  2152. .v01-kpi-label{font-size:10.5px;letter-spacing:1.5px;color:rgba(201,168,76,.65);
  2153. text-transform:uppercase;margin-bottom:6px;font-weight:600}
  2154. .v01-kpi-value{font-size:1.95rem;font-family:'Cormorant Garamond',serif;
  2155. font-weight:700;color:#F5E6B8;line-height:1.05;font-feature-settings:'lnum','tnum';
  2156. font-variant-numeric:tabular-nums}
  2157. .v01-kpi-sub{font-size:10.5px;color:rgba(245,230,184,.55);margin-top:6px}
  2158. .v01-kpi-arrow{position:absolute;top:16px;right:16px;color:rgba(201,168,76,.45);font-size:14px;
  2159. transition:transform .2s}
  2160. .v01-kpi:hover .v01-kpi-arrow{transform:translate(2px,-2px);color:#C9A84C}
  2161. /* KPI 配色 · 沿用 v4.7 维度色 */
  2162. .v01-kpi-gap .v01-kpi-value{color:#F5C988}
  2163. .v01-kpi-gap .v01-kpi-icon{color:#E5A654}
  2164. .v01-kpi-leverage .v01-kpi-value{color:#A0E0B5}
  2165. .v01-kpi-leverage .v01-kpi-icon{color:#5EE0A0}
  2166. .v01-kpi-cost .v01-kpi-value{color:#F5B0A8}
  2167. .v01-kpi-cost .v01-kpi-icon{color:#E87070}
  2168. /* --- 移植:4mini (源行1771-1836) --- */
  2169. /* === 4 mini 可视化 2x2 === */
  2170. /* === 4 mini 可视化 2x2 · [v0.1.5] 撑满右列高度,与左列等高 === */
  2171. .v01-vis-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;align-content:stretch;height:100%}
  2172. .v01-vis-card{background:rgba(255,255,255,.03);border:1px solid rgba(201,168,76,.18);
  2173. border-radius:14px;padding:18px;cursor:pointer;transition:all .2s;
  2174. min-height:200px;display:flex;flex-direction:column;position:relative}
  2175. .v01-vis-card:hover{background:rgba(255,255,255,.06);border-color:rgba(201,168,76,.4)}
  2176. .v01-vis-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
  2177. .v01-vis-icon{font-size:18px}
  2178. .v01-vis-title{font-size:12px;letter-spacing:1.5px;color:#C9A84C;font-weight:700;
  2179. text-transform:uppercase;flex:1;margin-left:8px}
  2180. .v01-vis-arrow{color:rgba(201,168,76,.45);font-size:13px;transition:transform .2s}
  2181. .v01-vis-card:hover .v01-vis-arrow{transform:translate(2px,-2px);color:#C9A84C}
  2182. .v01-vis-body{flex:1;display:flex;align-items:center;justify-content:center;
  2183. color:rgba(245,230,184,.85);font-size:11px;text-align:center;line-height:1.6}
  2184. .v01-vis-foot{font-size:10.5px;color:rgba(245,230,184,.55);margin-top:8px;
  2185. padding-top:8px;border-top:1px dashed rgba(201,168,76,.15)}
  2186. /* mini 风险金字塔 SVG */
  2187. .v01-mini-pyramid{width:100%;max-width:200px;height:120px}
  2188. /* mini 现金流 Canvas */
  2189. .v01-mini-cashflow{width:100%;max-width:240px;height:110px;display:block;margin:0 auto}
  2190. /* mini 三轨表 · 3 数字横排 */
  2191. .v01-mini-tri{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;width:100%}
  2192. .v01-mini-tri-cell{padding:10px 6px;border-radius:8px;background:rgba(255,255,255,.04);
  2193. text-align:center}
  2194. .v01-mini-tri-cell.is-aff{background:rgba(201,168,76,.10);border:1px solid rgba(201,168,76,.3)}
  2195. .v01-mini-tri-cell.is-custom{background:rgba(43,108,176,.10);border:1px solid rgba(43,108,176,.3)}
  2196. .v01-mini-tri-label{font-size:9.5px;letter-spacing:1px;color:rgba(201,168,76,.7);
  2197. margin-bottom:4px;text-transform:uppercase}
  2198. .v01-mini-tri-num{font-size:1.15rem;font-family:'Cormorant Garamond',serif;
  2199. font-weight:700;color:#F5E6B8;font-feature-settings:'lnum','tnum'}
  2200. /* mini 杠杆 KPI · 单一大数字 */
  2201. .v01-mini-leverage{text-align:center;width:100%}
  2202. .v01-mini-lev-num{font-size:3.4rem;font-family:'Cormorant Garamond',serif;
  2203. font-weight:700;color:#A0E0B5;line-height:1;font-feature-settings:'lnum','tnum'}
  2204. .v01-mini-lev-x{font-size:1.4rem;color:rgba(201,168,76,.6);margin-left:4px}
  2205. .v01-mini-lev-bar{margin-top:14px;height:6px;border-radius:3px;
  2206. background:rgba(255,255,255,.08);overflow:hidden;position:relative}
  2207. .v01-mini-lev-fill{height:100%;background:linear-gradient(90deg,#5EE0A0,#A0E0B5);
  2208. border-radius:3px;transition:width 1s ease-out}
  2209. .v01-mini-lev-scale{margin-top:6px;display:flex;justify-content:space-between;
  2210. font-size:9.5px;color:rgba(201,168,76,.5)}
  2211. /* [v0.1.6] mini 应急储备健康度 · 替换风险对冲 KPI(避免与保障杠杆 3 KPI 重复)*/
  2212. .v01-mini-emergency{text-align:center;width:100%}
  2213. .v01-mini-emerg-num{font-size:3.4rem;font-family:'Cormorant Garamond',serif;
  2214. font-weight:700;color:#5EE0A0;line-height:1;font-feature-settings:'lnum','tnum'}
  2215. .v01-mini-emerg-unit{font-size:1.4rem;color:rgba(201,168,76,.6);margin-left:6px}
  2216. .v01-mini-emerg-bar{margin-top:14px;height:6px;border-radius:3px;
  2217. background:rgba(255,255,255,.08);overflow:hidden;position:relative}
  2218. .v01-mini-emerg-bar::before{content:"";position:absolute;left:25%;top:0;width:1px;height:100%;
  2219. background:rgba(201,168,76,.5);z-index:1} /* 6月健康线 */
  2220. .v01-mini-emerg-bar::after{content:"";position:absolute;left:50%;top:0;width:1px;height:100%;
  2221. background:rgba(201,168,76,.5);z-index:1} /* 12月健康线 */
  2222. .v01-mini-emerg-fill{height:100%;background:linear-gradient(90deg,#E87070,#E89B3D,#5EE0A0);
  2223. border-radius:3px;transition:width 1s ease-out}
  2224. .v01-mini-emerg-scale{margin-top:6px;display:flex;justify-content:space-between;
  2225. font-size:9.5px;color:rgba(201,168,76,.5)}
  2226. body.v01-light.theme-light .v01-mini-emerg-num{color:#1F7A4D}
  2227. body.v01-light.theme-light .v01-mini-emerg-unit{color:rgba(155,124,58,.55)}
  2228. body.v01-light.theme-light .v01-mini-emerg-bar{background:rgba(155,124,58,.10)}
  2229. body.v01-light.theme-light .v01-mini-emerg-scale{color:rgba(155,124,58,.55)}
  2230. /* --- 移植:入场动画stagger(引用已存在的v01fcFadeUp) (源行2260-2269) --- */
  2231. .v01-hero .v01-rings-wrap{
  2232. animation:v01fcFadeUp .65s cubic-bezier(.2,.7,.3,1) .20s both
  2233. }
  2234. .v01-hero .v01-kpi:nth-child(1){animation:v01fcFadeUp .55s cubic-bezier(.2,.7,.3,1) .35s both}
  2235. .v01-hero .v01-kpi:nth-child(2){animation:v01fcFadeUp .55s cubic-bezier(.2,.7,.3,1) .45s both}
  2236. .v01-hero .v01-kpi:nth-child(3){animation:v01fcFadeUp .55s cubic-bezier(.2,.7,.3,1) .55s both}
  2237. .v01-hero .v01-vis-grid > .v01-vis-card:nth-child(1){animation:v01fcFadeUp .55s cubic-bezier(.2,.7,.3,1) .30s both}
  2238. .v01-hero .v01-vis-grid > .v01-vis-card:nth-child(2){animation:v01fcFadeUp .55s cubic-bezier(.2,.7,.3,1) .40s both}
  2239. .v01-hero .v01-vis-grid > .v01-vis-card:nth-child(3){animation:v01fcFadeUp .55s cubic-bezier(.2,.7,.3,1) .50s both}
  2240. .v01-hero .v01-vis-grid > .v01-vis-card:nth-child(4){animation:v01fcFadeUp .55s cubic-bezier(.2,.7,.3,1) .60s both}
  2241. /* ══════ [2026-07-12 移植] 体检报告 Hero (第5 Tab) · 白底浅色版 ══════ */
  2242. /* 中和源 .v01-hero 的 100vmax 全宽出血 + 居中 max-width, 让其在 Tab 面板内左对齐填满 */
  2243. .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}
  2244. </style>
  2245. <style id="fav-module-css">
  2246. /* ══════ [2026-07-12 移植自 FAV v0.1] 家族保单(01) + 生命周期/水位金字塔(02) ══════ */
  2247. .fav-family-policies, .fav-lifecycle-block, .fav-pyramid-block, .pcc-tier-detail, #pccTierRows {
  2248. --bg-warm-1:#F2F3EF; --bg-warm-2:#E9EAE4;
  2249. --card:#FFFFFF; --card-hover:#F7F8F5;
  2250. --border:#E4E5DF; --border-mid:#C8C9C0;
  2251. --gold:#9B7C3A; --gold-2:#B89A52; --gold-3:#C8AB60; --gold-soft:rgba(155,124,58,0.08);
  2252. --ink:#12100B;
  2253. --text-primary:#0F0E0C; --text-secondary:#4A4640; --text-tertiary:#8B8478; --text-muted:#B5AE9F;
  2254. --green:#2D6A4F; --amber:#8B7030; --red:#8B3030; --blue:#2D4A6A; --blue-soft:rgba(45,74,106,0.10);
  2255. --r-sm:4px; --r-md:8px; --r-lg:12px; --r-xl:16px;
  2256. --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);
  2257. --font-serif:'Cormorant Garamond','Noto Serif SC',Georgia,serif;
  2258. }
  2259. .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)}
  2260. .fav-sec-head .num{color:#9B7C3A;font-size:.8rem;margin-right:8px}
  2261. .fav-note{font-size:.68rem;color:#8B8478;margin-top:10px;line-height:1.6}
  2262. .fav-lifecycle-block,.fav-pyramid-block{margin-top:22px;padding-top:20px;border-top:1px dashed rgba(155,124,58,.20)}
  2263. .member-pills { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-bottom:16px; }
  2264. .member-pills .label { font-size:.7rem; color:var(--text-tertiary); letter-spacing:.06em; margin-right:2px; }
  2265. .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); }
  2266. .m-pill:hover { border-color:var(--gold); color:var(--gold); }
  2267. .m-pill.active { background:linear-gradient(135deg,var(--gold-3),var(--gold)); color:#fff; border-color:var(--gold); font-weight:500; }
  2268. .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); }
  2269. /* ── 保单表 ── */
  2270. .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); }
  2271. .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); }
  2272. .policy-table td { padding:11px 14px; font-size:.78rem; border-bottom:1px solid var(--border); color:var(--text-secondary); }
  2273. .policy-table tr:last-child td { border-bottom:none; }
  2274. .policy-table tr:hover td { background:var(--card-hover); }
  2275. .tag { display:inline-block; font-size:.64rem; padding:2px 8px; border-radius:99px; font-weight:500; }
  2276. .tag-trust { background:var(--gold-soft); color:var(--gold); border:1px solid var(--gold-2); }
  2277. .tag-lc { background:var(--blue-soft); color:var(--blue); }
  2278. .num-cell { font-family:var(--font-serif); font-weight:600; color:var(--text-primary); }
  2279. /* ── 视图切换 ── */
  2280. .view-switch { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:18px; }
  2281. .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; }
  2282. .vs-tab:hover { border-color:var(--gold); color:var(--gold); }
  2283. .vs-tab.active { background:var(--ink); color:#fff; border-color:var(--ink); }
  2284. .vs-hint { font-size:.68rem; color:var(--text-muted); font-style:italic; margin-left:4px; }
  2285. /* ── 生命周期两阶段 ── */
  2286. .lc-track { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
  2287. .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; }
  2288. .lc-stage h3 { font-family:var(--font-serif); font-size:1.15rem; font-weight:600; margin-bottom:2px; }
  2289. .lc-stage .lc-en { font-size:.62rem; letter-spacing:.14em; text-transform:uppercase; color:var(--gold); margin-bottom:6px; }
  2290. .lc-stage .lc-needs-note { font-size:.66rem; color:var(--text-tertiary); margin-bottom:14px; padding-bottom:10px; border-bottom:1px solid var(--border); }
  2291. /* ── 金字塔视图 ── */
  2292. .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); }
  2293. .pyr-svg-col { position:relative; display:flex; align-items:center; justify-content:center; align-self:stretch; }
  2294. .fav-pyramid-svg { width:100%; max-width:420px; height:auto; }
  2295. /* 水位开关(平移自 PolicySummary v1.2 · 左上角香槟金 pill) */
  2296. .pyr-controls { position:absolute; top:0; left:0; z-index:10; display:flex; flex-direction:column; gap:4px; }
  2297. .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; }
  2298. .pc-toggle:hover { background:rgba(252,247,235,.98); border-color:rgba(201,168,76,.75); transform:translateY(-1px); }
  2299. .pc-toggle[data-on="0"] { background:rgba(0,0,0,.04); border-color:rgba(0,0,0,.12); color:#999; }
  2300. .pc-toggle[data-on="0"]:hover { background:rgba(0,0,0,.08); color:#666; }
  2301. .pc-toggle .tg-dot { width:6px; height:6px; border-radius:50%; background:#C9A84C; box-shadow:0 0 4px rgba(201,168,76,.6); }
  2302. .pc-toggle[data-on="0"] .tg-dot { background:#bbb; box-shadow:none; }
  2303. .pyr-gap-col { display:flex; flex-direction:column; gap:14px; }
  2304. .pyr-note { font-size:.68rem; color:var(--text-tertiary); padding-bottom:10px; border-bottom:1px solid var(--border); font-style:italic; }
  2305. /* 风险三分组 · 彩色 capsule 头 + 左侧色条 */
  2306. .rtier-group { background:var(--rt-bg); border:1px solid var(--rt-bd); border-radius:var(--r-lg); padding:12px 14px; overflow:hidden; }
  2307. .rtier-cap { display:inline-flex; align-items:center; gap:8px; margin-bottom:10px; }
  2308. .rtier-name { font-size:.72rem; font-weight:700; color:#fff; background:var(--rt-c); padding:3px 12px; border-radius:99px; letter-spacing:.05em; }
  2309. .rtier-desc { font-size:.66rem; color:var(--rt-c); font-weight:600; }
  2310. .rtier-group .gap-list { gap:8px; }
  2311. /* [2026-07-16] 上方金字塔(#pccTierRows)专属:头部可点折叠,险种明细默认隐藏 */
  2312. #pccTierRows .rtier-cap { cursor:pointer; user-select:none; margin-bottom:0; width:100%; }
  2313. #pccTierRows .rtier-caret { font-size:.7rem; color:var(--rt-c); transition:transform .2s; flex-shrink:0; }
  2314. #pccTierRows .rtier-group.is-open .rtier-caret { transform:rotate(90deg); }
  2315. #pccTierRows .rtier-body { max-height:0; overflow:hidden; transition:max-height .3s ease; }
  2316. #pccTierRows .rtier-group.is-open .rtier-body { max-height:600px; margin-top:10px; }
  2317. /* 该层聚合覆盖率进度条(折叠时也常显在头部) */
  2318. #pccTierRows .rtier-cov { display:flex; align-items:center; gap:8px; margin-left:auto; min-width:100px; flex-shrink:0; }
  2319. #pccTierRows .rtier-cov-bar { flex:1; height:6px; background:rgba(0,0,0,.06); border-radius:99px; overflow:hidden; min-width:44px; }
  2320. #pccTierRows .rtier-cov-fill { height:100%; border-radius:99px; background:var(--rt-c); transition:width .8s ease; }
  2321. #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; }
  2322. /* 信托架构 capsule(生命周期 Stage2 · 家族信托为父 · 大额保单为子缩进注入) */
  2323. .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; }
  2324. .trust-head { display:flex; align-items:center; gap:8px; margin-bottom:10px; flex-wrap:wrap; }
  2325. .trust-name { font-size:.72rem; font-weight:700; color:#fff; background:#7A3FA0; padding:3px 12px; border-radius:99px; letter-spacing:.05em; }
  2326. .trust-desc { font-size:.66rem; color:#7A3FA0; font-weight:600; }
  2327. .trust-cap .gap-list { gap:8px; }
  2328. .trust-child { position:relative; padding-left:20px; }
  2329. .trust-child::before { content:'└'; position:absolute; left:4px; top:2px; color:#9B61C2; font-size:.85rem; font-weight:700; }
  2330. /* ── 缺口条(两视图共用) ── */
  2331. .gap-list { display:flex; flex-direction:column; gap:10px; }
  2332. .gap-row { padding:2px 0; }
  2333. .gap-top { display:flex; justify-content:space-between; align-items:baseline; margin-bottom:6px; gap:8px; }
  2334. .gap-name { font-size:.8rem; font-weight:500; display:flex; align-items:center; gap:6px; }
  2335. .gap-fig { font-size:.7rem; color:var(--text-tertiary); text-align:right; }
  2336. .gap-fig b { font-family:var(--font-serif); font-size:.86rem; }
  2337. .gap-fig .gap-amt { color:var(--red); }
  2338. .gap-fig .gap-amt.ok { color:var(--green); }
  2339. .gap-bar { height:6px; background:var(--bg-warm-2); border-radius:99px; overflow:hidden; }
  2340. .gap-fill { height:100%; border-radius:99px; background:linear-gradient(90deg,var(--green),var(--gold-2)); transition:width .8s ease; }
  2341. .dot-tier { width:7px; height:7px; border-radius:50%; flex-shrink:0; display:inline-block; }
  2342. .tag-ext { background:var(--gold-soft); color:var(--gold); border:1px solid var(--gold-2); }
  2343. .tag-p2 { background:var(--blue-soft); color:var(--blue); }
  2344. /* [2026-07-12 修复] IC 主样式有同名 .gap-row{display:grid;120px 1fr 100px} 会把险种名挤成竖排。
  2345. 在 fav 三容器 + 金字塔明细内作用域覆盖:恢复 FAV 的纵向堆叠布局 + 险种名强制横排不换行。
  2346. [2026-07-16] 追加 #pccTierRows(上方金字塔改用 rtier-group 胶囊卡后同样需覆盖)。 */
  2347. .fav-lifecycle-block .gap-row, .fav-pyramid-block .gap-row, .pcc-tier-detail .gap-row, #pccTierRows .gap-row{
  2348. display:block!important;grid-template-columns:none!important;padding:2px 0!important;border-bottom:none!important;
  2349. }
  2350. .fav-lifecycle-block .gap-top, .fav-pyramid-block .gap-top, .pcc-tier-detail .gap-top, #pccTierRows .gap-top{
  2351. display:flex;justify-content:space-between;align-items:baseline;gap:8px;margin-bottom:6px;
  2352. }
  2353. .fav-lifecycle-block .gap-name, .fav-pyramid-block .gap-name, .pcc-tier-detail .gap-name, #pccTierRows .gap-name{
  2354. white-space:nowrap;flex-shrink:0;
  2355. }
  2356. .fav-lifecycle-block .gap-fig, .fav-pyramid-block .gap-fig, .pcc-tier-detail .gap-fig, #pccTierRows .gap-fig{
  2357. text-align:right;
  2358. }
  2359. </style>
  2360. </head>
  2361. <body>
  2362. <!-- ============================================================== -->
  2363. <!-- v5.0 app-shell 化:常驻侧栏(mode-aware)+ 主内容区 -->
  2364. <!-- 侧栏由 data/cy-sidebar.js 渲染;平台版含 cy-config.js 显示全导航 -->
  2365. <!-- ============================================================== -->
  2366. <div class="cy-app">
  2367. <aside id="cy-sidebar-mount" class="sidebar"></aside>
  2368. <div class="cy-main">
  2369. <!-- 顶栏 -->
  2370. <div class="topbar">
  2371. <div class="brand">
  2372. <div class="brand-logo" aria-label="Benchmark Wealth logo">
  2373. <svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" role="img">
  2374. <defs>
  2375. <linearGradient id="g-wealth-ic" x1="0" y1="0" x2="1" y2="1">
  2376. <stop offset="0%" stop-color="#D97757"/>
  2377. <stop offset="100%" stop-color="#a95d44"/>
  2378. </linearGradient>
  2379. </defs>
  2380. <g fill="url(#g-wealth-ic)">
  2381. <rect x="46" y="6" width="8" height="38" rx="4" transform="rotate(0 50 50)"/>
  2382. <rect x="46" y="6" width="8" height="38" rx="4" transform="rotate(30 50 50)"/>
  2383. <rect x="46" y="6" width="8" height="38" rx="4" transform="rotate(60 50 50)"/>
  2384. <rect x="46" y="6" width="8" height="38" rx="4" transform="rotate(90 50 50)"/>
  2385. <rect x="46" y="6" width="8" height="38" rx="4" transform="rotate(120 50 50)"/>
  2386. <rect x="46" y="6" width="8" height="38" rx="4" transform="rotate(150 50 50)"/>
  2387. <rect x="46" y="6" width="8" height="38" rx="4" transform="rotate(180 50 50)"/>
  2388. <rect x="46" y="6" width="8" height="38" rx="4" transform="rotate(210 50 50)"/>
  2389. <rect x="46" y="6" width="8" height="38" rx="4" transform="rotate(240 50 50)"/>
  2390. <rect x="46" y="6" width="8" height="38" rx="4" transform="rotate(270 50 50)"/>
  2391. <rect x="46" y="6" width="8" height="38" rx="4" transform="rotate(300 50 50)"/>
  2392. <rect x="46" y="6" width="8" height="38" rx="4" transform="rotate(330 50 50)"/>
  2393. </g>
  2394. </svg>
  2395. </div>
  2396. <div class="brand-text">
  2397. <span class="t1">保额计算器 <span class="agent-badge">代理人专用</span></span>
  2398. <span class="t2">INSURANCE CALCULATOR</span>
  2399. </div>
  2400. </div>
  2401. <div class="topbar-right">
  2402. <!-- v3.3.4 · 画像快速切换 dropdown(与 PolicySummary 同源 · vault 全部 CY_PORTRAITS)-->
  2403. <select id="portraitSwitcher" onchange="switchPortrait(this.value)"
  2404. style="padding:6px 12px; border:1px solid var(--gold,#9B7C3A);
  2405. border-radius:6px; background:white; color:var(--gold,#9B7C3A);
  2406. font-size:12px; font-weight:600; font-family:-apple-system,'PingFang SC',sans-serif;
  2407. cursor:pointer; outline:none;">
  2408. <option value="">⇄ 切换画像(共 0)</option>
  2409. </select>
  2410. <button class="ah-nav-btn" onclick="jumpActionHubIC()" title="回客户画像 · ActionHub">⌘ ActionHub</button>
  2411. <a class="back-link" href="javascript:void(0)" onclick="goBackIC()">← 返回</a>
  2412. </div>
  2413. </div>
  2414. <!-- ctx-bar 当前客户 (portrait 自动预填) -->
  2415. <div class="ctx-bar" id="ctxBar">
  2416. <span class="ctx-icon">📌</span>
  2417. <span>当前客户:</span>
  2418. <span class="ctx-name" id="ctxName">--</span>
  2419. <span class="ctx-portrait" id="ctxPortrait"></span>
  2420. <span style="color:var(--text-dim)">|</span>
  2421. <span class="ctx-meta" id="ctxMeta">--</span>
  2422. <div class="ctx-actions">
  2423. <button class="ctx-btn primary" onclick="reloadFromPortrait()">🔄 重新载入画像</button>
  2424. <button class="ctx-btn" onclick="switchToNewClient()">✕ 改为新客户</button>
  2425. </div>
  2426. </div>
  2427. <div class="container">
  2428. <!-- Hero 已移除(2026-07-11 Jack:去标题+6 capsule,直接从 9 家庭画像开始)-->
  2429. <!-- 段 0 · ⚡ 快速导入预设画像 -->
  2430. <div class="persona-section collapsed" id="personaSection">
  2431. <div class="persona-head">
  2432. <span class="persona-eyebrow">⚡ 快速导入</span>
  2433. <span class="persona-title">9 个代表性家庭画像</span>
  2434. <span class="persona-meta">点击 chip 一键填好 18 字段 · 后续仍可手动调整</span>
  2435. <button class="persona-toggle" onclick="togglePersonaSection(this)">
  2436. <span class="caret">▾</span>
  2437. <span class="toggle-label">展开画像库</span>
  2438. </button>
  2439. </div>
  2440. <div class="persona-subtitle">
  2441. 代理人现场演示无需逐字填表 · 选最贴近客户场景的画像作为起点 · 选完后可微调每个字段。
  2442. 画像 ≠ 真实客户(顶部 ctx-bar 会优先显示真实客户上下文)。
  2443. </div>
  2444. <div class="persona-tier-row">
  2445. <span class="persona-tier-label"><span class="pc-tag-color std"></span> 普通客户(DIME 模式)</span>
  2446. <div class="persona-chips">
  2447. <div class="persona-chip" onclick="loadPersona('middle_3')">
  2448. <span class="pc-name"><span class="pc-icon-em">👨‍👩‍👧</span>三口之家·中产</span>
  2449. <span class="pc-desc">35岁 / 1子5岁 / 50+30万 / 房贷200</span>
  2450. </div>
  2451. <div class="persona-chip" onclick="loadPersona('two_child')">
  2452. <span class="pc-name"><span class="pc-icon-em">👨‍👩‍👧‍👦</span>二孩·新中产</span>
  2453. <span class="pc-desc">40岁 / 大10+二5 / 100+50万 / 全英美</span>
  2454. </div>
  2455. <div class="persona-chip" onclick="loadPersona('single_lady')">
  2456. <span class="pc-name"><span class="pc-icon-em">👩‍💼</span>单身贵族·一线女</span>
  2457. <span class="pc-desc">32岁女 / 未婚 / 80万 / 早退55</span>
  2458. </div>
  2459. <div class="persona-chip" onclick="loadPersona('dink')">
  2460. <span class="pc-name"><span class="pc-icon-em">💑</span>DINK·双高收入</span>
  2461. <span class="pc-desc">38+35 / 无子 / 100+80万 / 房贷600</span>
  2462. </div>
  2463. </div>
  2464. </div>
  2465. <div class="persona-tier-row">
  2466. <span class="persona-tier-label"><span class="pc-tag-color mid"></span> 中等复杂(特殊场景)</span>
  2467. <div class="persona-chips">
  2468. <div class="persona-chip" onclick="loadPersona('single_mom')">
  2469. <span class="pc-name"><span class="pc-icon-em">👩‍👦</span>离异·单亲妈妈</span>
  2470. <span class="pc-desc">38岁女 / 1子8岁 / 60万单收入</span>
  2471. </div>
  2472. <div class="persona-chip" onclick="loadPersona('entrepreneur')">
  2473. <span class="pc-name"><span class="pc-icon-em">🏢</span>创业者·民企主</span>
  2474. <span class="pc-desc">42岁 / 2子 / 300万 / 经营贷1000 / 股权5000</span>
  2475. </div>
  2476. <div class="persona-chip" onclick="loadPersona('silver')">
  2477. <span class="pc-name"><span class="pc-icon-em">👴</span>银发族·准退休</span>
  2478. <span class="pc-desc">55岁 / 子女已成年 / 80+50万 / 流动800</span>
  2479. </div>
  2480. </div>
  2481. </div>
  2482. <div class="persona-tier-row">
  2483. <span class="persona-tier-label"><span class="pc-tag-color hnw"></span> HNW(双轨触发 · 境内+境外 IUL/VUL/PPLI)</span>
  2484. <div class="persona-chips">
  2485. <div class="persona-chip" onclick="loadPersona('cross_border')">
  2486. <span class="pc-name"><span class="pc-icon-em">🌏</span>跨境·二代美籍</span>
  2487. <span class="pc-desc">50岁 / 1子22美籍 / 300万 / 流动1500 / FATCA</span>
  2488. </div>
  2489. <div class="persona-chip" onclick="loadPersona('uhnw_succession')">
  2490. <span class="pc-name"><span class="pc-icon-em">🏛</span>HNW 传承家族</span>
  2491. <span class="pc-desc">55岁 / 2子接班+留学 / 流动5000 / 股权10亿</span>
  2492. </div>
  2493. </div>
  2494. </div>
  2495. <div class="persona-section-tip" style="margin-top:14px;font-size:11.5px;color:rgba(229,220,196,0.78);padding:8px 12px;
  2496. background:rgba(155,124,58,.10);border:1px solid rgba(155,124,58,0.20);border-radius:4px;line-height:1.7">
  2497. 💡 <strong style="color:#F5E6B8">使用说明</strong>:点击 chip 后会自动填好下方所有 18 字段,顶部出现绿色 toast 提示。
  2498. 点击「📊 计算保额」即可看到该画像的诊断报告。代理人可基于画像微调任何字段。
  2499. </div>
  2500. </div>
  2501. <!-- ===== 段 1: 客户基本信息 ===== -->
  2502. <div class="ic-section ic-section--L1" data-section="1">
  2503. <div class="section-head">
  2504. <span class="sh-num">01</span>
  2505. <span class="sh-title">客户基本信息</span>
  2506. <span class="sh-meta">用于生命表查保费 + DIME 公式收入替代</span>
  2507. </div>
  2508. <div class="form-grid">
  2509. <div class="form-field">
  2510. <label>客户姓 *</label>
  2511. <input type="text" id="surname" placeholder="如:陈" maxlength="4" />
  2512. </div>
  2513. <div class="form-field">
  2514. <label>主理人年龄 *<span class="hint">(影响保费)</span></label>
  2515. <input type="number" id="age" placeholder="35" min="18" max="80" />
  2516. </div>
  2517. <div class="form-field">
  2518. <label>性别 *</label>
  2519. <select id="gender">
  2520. <option value="M">男</option>
  2521. <option value="F">女</option>
  2522. </select>
  2523. </div>
  2524. <div class="form-field">
  2525. <label>婚姻状况</label>
  2526. <select id="marriage">
  2527. <option value="married">已婚</option>
  2528. <option value="single">未婚</option>
  2529. <option value="divorced">离异</option>
  2530. </select>
  2531. </div>
  2532. </div>
  2533. <!-- ===== /段 1 结束 ===== -->
  2534. </div>
  2535. <!-- ===== 段 2: 子女与教育 ===== -->
  2536. <div class="ic-section ic-section--L0" data-section="2">
  2537. <div class="section-head">
  2538. <span class="sh-num">02</span>
  2539. <span class="sh-title">子女与教育规划</span>
  2540. <span class="sh-meta">用于教育金 + 寿险 DIME 之 E 项</span>
  2541. </div>
  2542. <div class="form-grid">
  2543. <div class="form-field">
  2544. <label>子女数量</label>
  2545. <select id="childCount" onchange="updateChildAgeFields()">
  2546. <option value="0">无子女</option>
  2547. <option value="1">1 个</option>
  2548. <option value="2" selected>2 个</option>
  2549. <option value="3">3 个</option>
  2550. </select>
  2551. </div>
  2552. <div class="form-field" id="childAge1Wrap">
  2553. <label>大儿/独子 年龄</label>
  2554. <input type="number" id="childAge1" placeholder="8" min="0" max="30" value="8" />
  2555. </div>
  2556. <div class="form-field" id="childAge2Wrap">
  2557. <label>二孩 年龄</label>
  2558. <input type="number" id="childAge2" placeholder="5" min="0" max="30" value="5" />
  2559. </div>
  2560. <div class="form-field" id="childAge3Wrap" style="display:none">
  2561. <label>三孩 年龄</label>
  2562. <input type="number" id="childAge3" placeholder="3" min="0" max="30" />
  2563. </div>
  2564. <div class="form-field" style="grid-column:1/-1">
  2565. <label>教育路径 *<span class="hint">(影响单子女教育金单价)</span></label>
  2566. <select id="eduPath">
  2567. <option value="domestic">🇨🇳 国内本科 · ¥100 万/子女</option>
  2568. <option value="domestic_plus">🇨🇳+🌐 国内 + 海外硕士 · ¥250 万/子女</option>
  2569. <option value="full_overseas" selected>🇬🇧🇺🇸 全程英美 · ¥600 万/子女</option>
  2570. <option value="elite_us">🇺🇸 美高 + 美本 + 美研 · ¥1000 万/子女</option>
  2571. </select>
  2572. </div>
  2573. </div>
  2574. <!-- ===== /段 2 结束 ===== -->
  2575. </div>
  2576. <!-- ===== 段 3: 财务信息 (v3.4 · 加自住房产 + 投资资产 → 总财富画像) ===== -->
  2577. <div class="ic-section ic-section--L1" data-section="3">
  2578. <div class="section-head">
  2579. <span class="sh-num">03</span>
  2580. <span class="sh-title">家庭财务信息</span>
  2581. <span class="sh-meta">所有金额单位为「万元」 · 流动资产/自住房产/投资资产分开填,体现总财富画像</span>
  2582. </div>
  2583. <div class="form-grid">
  2584. <div class="form-field">
  2585. <label>主理人年薪 (万) *</label>
  2586. <input type="number" id="salary" placeholder="100" min="0" step="10" value="100" />
  2587. </div>
  2588. <div class="form-field">
  2589. <label>配偶年薪 (万)</label>
  2590. <input type="number" id="spouseSalary" placeholder="0" min="0" step="10" value="0" />
  2591. </div>
  2592. <div class="form-field">
  2593. <label>房贷余额 (万)</label>
  2594. <input type="number" id="mortgage" placeholder="500" min="0" step="10" value="500" />
  2595. </div>
  2596. <div class="form-field">
  2597. <label>其他负债 (万)<span class="hint">(车贷/经营贷)</span></label>
  2598. <input type="number" id="otherDebt" placeholder="0" min="0" step="10" value="0" />
  2599. </div>
  2600. <div class="form-field">
  2601. <label>💧 流动资产 (万)<span class="hint">(现金+银行理财+股票/基金)</span></label>
  2602. <input type="number" id="liquidAssets" placeholder="300" min="0" step="10" value="300" />
  2603. </div>
  2604. <div class="form-field">
  2605. <label>🏠 自住房产估值 (万)<span class="hint">(仅自住)</span></label>
  2606. <input type="number" id="primaryResidence" placeholder="0" min="0" step="50" value="0" />
  2607. </div>
  2608. <div class="form-field" style="grid-column:1/-1">
  2609. <label>🏛 其他投资资产 (万)<span class="hint">(投资性房产+黄金+私募+信托+银行理财等总额估算)</span></label>
  2610. <input type="number" id="investAssets" placeholder="0" min="0" step="50" value="0" />
  2611. <div style="margin-top:6px;font-size:11px;color:var(--text-dim);line-height:1.5">
  2612. 💡 需要细致拆分股票/基金/黄金/私募的资产配置?
  2613. <a href="javascript:void(0)" onclick="jumpToAssetCenter()" style="color:var(--accent);text-decoration:underline;font-weight:600">→ 打开资产配置中心(将本表数据带过去)</a>
  2614. </div>
  2615. </div>
  2616. <!-- [v4.2] 境外资产 · 用于境外寿险按实际境外资产分配,而非整体 AUM × 比例 -->
  2617. <!-- [v4.4.3] 单位改为万美金(跨境美籍/UHNW 境外资产通常美元计价 · 内部按 1 USD = 7 CNY 换算)-->
  2618. <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">
  2619. <label style="color:#3D6F8C;font-weight:700">🌏 境外资产 (万美金)<span class="hint" style="color:#6B5239;font-weight:400">[v4.4.3] (上述资产中位于境外的部分 · 海外金融账户/海外房产/海外公司股权 · <strong>美元计价</strong>)</span></label>
  2620. <div style="display:flex;align-items:center;gap:10px">
  2621. <input type="number" id="overseasAssets" placeholder="0" min="0" step="10" value="0" style="flex:1" />
  2622. <span id="overseasAssetsCnyHint" style="font-size:11.5px;color:#7A6028;font-family:'Cormorant Garamond',serif;font-weight:600;white-space:nowrap">≈ ¥0 万</span>
  2623. </div>
  2624. <div style="margin-top:8px;display:flex;align-items:center;gap:10px;font-size:11.5px;color:var(--text-dim)">
  2625. <label style="display:flex;align-items:center;gap:6px;cursor:pointer;font-weight:500">
  2626. <input type="checkbox" id="overseasFuturePlan" style="width:14px;height:14px;cursor:pointer" />
  2627. <span>客户计划未来 3-5 年配置境外资产</span>
  2628. </label>
  2629. <span style="color:#9B7C3A;font-style:italic">(勾选后按 AUM × 30% 估算境外寿险需求)</span>
  2630. </div>
  2631. <div style="margin-top:6px;font-size:11px;color:#7A6028;line-height:1.5">
  2632. 💡 普通客户境外资产默认 0 → 不配境外寿险。跨境美籍 / UHNW 通常 30-60% AUM 在境外。汇率 <strong>1 USD = 7 CNY</strong> (内部换算用,精确测算请咨询 1v1 顾问)。<br>
  2633. ⚠ 如果勾选"未来计划",代理人需在 1v1 服务中确认客户跨境意向(移民/海外置业/子女留学/跨境家办等)。
  2634. </div>
  2635. </div>
  2636. </div>
  2637. <!-- ===== /段 3 结束 ===== -->
  2638. </div>
  2639. <!-- ===== 段 4: 现有保障 (v3.1 · 7 险种全覆盖 · 按金字塔基础→中端→高端顺序) ===== -->
  2640. <div class="ic-section ic-section--L2" data-section="4">
  2641. <div class="section-head">
  2642. <span class="sh-num">04</span>
  2643. <span class="sh-title">现有保障盘点</span>
  2644. <span class="sh-meta">7 险种全盘点 · 用于计算每个险种的「缺口」</span>
  2645. </div>
  2646. <div class="form-grid form-grid--risk-tiers">
  2647. <!-- 🟧 基础风险层 -->
  2648. <div class="risk-layer-group risk-layer--basic">
  2649. <div class="risk-layer-head">
  2650. <span>🟧</span>
  2651. <span>基础风险层</span>
  2652. <span class="rl-meta">意外 / 医疗 / 重疾 · 损失性风险</span>
  2653. </div>
  2654. <div class="risk-layer-fields">
  2655. <div class="form-field">
  2656. <label>① 现有意外险保额 (万) <span class="hint">(基础)</span></label>
  2657. <input type="number" id="existingAccident" placeholder="0" min="0" step="50" value="0" />
  2658. </div>
  2659. <div class="form-field">
  2660. <label>② 现有高端医疗 <span class="hint">(基础)</span></label>
  2661. <select id="existingMed">
  2662. <option value="0">无</option>
  2663. <option value="1" selected>有 (¥800 万级)</option>
  2664. </select>
  2665. </div>
  2666. <div class="form-field">
  2667. <label>③ 现有重疾保额 (万) <span class="hint">(基础)</span></label>
  2668. <input type="number" id="existingCI" placeholder="0" min="0" step="50" value="50" />
  2669. </div>
  2670. </div>
  2671. </div>
  2672. <!-- 🟨 中端风险层 -->
  2673. <div class="risk-layer-group risk-layer--mid">
  2674. <div class="risk-layer-head">
  2675. <span>🟨</span>
  2676. <span>中端风险层</span>
  2677. <span class="rl-meta">定寿 / 教育 / 养老 · 支出性风险</span>
  2678. </div>
  2679. <div class="risk-layer-fields">
  2680. <div class="form-field">
  2681. <label>④ 现有定期寿险保额 (万) <span class="hint">(中端·收入替代)</span></label>
  2682. <input type="number" id="existingLife" placeholder="0" min="0" step="50" value="200" />
  2683. </div>
  2684. <div class="form-field">
  2685. <label>⑤ 教育金储备 (万) <span class="hint">(中端·年金/分红型保险)</span></label>
  2686. <input type="number" id="existingEduInsurance" placeholder="0" min="0" step="50" value="0" />
  2687. </div>
  2688. <div class="form-field">
  2689. <label>⑥ 养老金储备 (万) <span class="hint">(中端·年金)</span></label>
  2690. <input type="number" id="existingRetirement" placeholder="0" min="0" step="50" value="0" />
  2691. </div>
  2692. </div>
  2693. </div>
  2694. <!-- 🟡 高端风险层 -->
  2695. <div class="risk-layer-group risk-layer--high">
  2696. <div class="risk-layer-head">
  2697. <span>🟡</span>
  2698. <span>高端风险层</span>
  2699. <span class="rl-meta">终身寿 · 传承隔离</span>
  2700. </div>
  2701. <div class="risk-layer-fields">
  2702. <div class="form-field">
  2703. <label>⑦ 现有终身寿险保额 (万) <span class="hint">(高端·传承隔离)</span></label>
  2704. <input type="number" id="existingWholeLife" placeholder="0" min="0" step="50" value="0" />
  2705. </div>
  2706. </div>
  2707. </div>
  2708. </div>
  2709. <!-- ===== /段 4 结束 ===== -->
  2710. </div>
  2711. <!-- ===== 段 5: 退休 & 预期 ===== -->
  2712. <div class="ic-section ic-section--L1" data-section="5">
  2713. <div class="section-head">
  2714. <span class="sh-num">05</span>
  2715. <span class="sh-title">退休与预期</span>
  2716. <span class="sh-meta">用于寿险 I 项 + 养老金缺口</span>
  2717. </div>
  2718. <div class="form-grid">
  2719. <div class="form-field">
  2720. <label>计划退休年龄</label>
  2721. <input type="number" id="retireAge" placeholder="60" min="40" max="80" value="60" />
  2722. </div>
  2723. <div class="form-field">
  2724. <label>预期寿命<span class="hint">(用于养老金)</span></label>
  2725. <input type="number" id="lifeExpectancy" placeholder="90" min="70" max="120" value="90" />
  2726. </div>
  2727. <div class="form-field">
  2728. <label>退休后生活水平偏好<span class="hint">(退休后年支出 / 工作期年薪)</span></label>
  2729. <select id="retireLifestyleRatio">
  2730. <option value="0.45">极简生活 45% · 房贷已清 + 子女独立</option>
  2731. <option value="0.56">标准默认 56% · 70%×80% 链式公式</option>
  2732. <option value="0.70" selected>维持现状 70% · 中产舒适退休</option>
  2733. <option value="0.85">高端维持 85% · UHNW 不降标</option>
  2734. <option value="1.00">高于现状 100% · 退休后旅行/医疗增加</option>
  2735. </select>
  2736. </div>
  2737. <div class="form-field">
  2738. <label>未来收入折现率<span class="hint">(寿险 I 项现值,默认 4%)</span></label>
  2739. <select id="incomeDiscountRate">
  2740. <option value="0">不折现(简单累加 · 保守)</option>
  2741. <option value="0.03" selected>3% (低利率假设)</option>
  2742. <option value="0.04">4% (国债基准)</option>
  2743. <option value="0.05">5% (标准理财)</option>
  2744. <option value="0.06">6% (积极假设)</option>
  2745. </select>
  2746. </div>
  2747. <div class="form-field">
  2748. <label>重疾保额倍数<span class="hint">(重疾保额 = 年薪 × N)</span></label>
  2749. <select id="ciMultiplier">
  2750. <option value="2">2× · 极简(已有大额储蓄/医疗)</option>
  2751. <option value="3" selected>3× · 标准(行业默认 · 中产)</option>
  2752. <option value="4">4× · 加强(35-50 岁主理人)</option>
  2753. <option value="5">5× · UHNW(留足体面康复期)</option>
  2754. </select>
  2755. </div>
  2756. <div class="form-field">
  2757. <label>家庭年缴保费上限</label>
  2758. <select id="affordabilityCap">
  2759. <option value="0.10">10% · 防御型(纯保障)</option>
  2760. <option value="0.15">15% · 平衡型(保障+轻储蓄)</option>
  2761. <option value="0.20" selected>20% · 储蓄型(保障+教育/养老)</option>
  2762. <option value="0.30">30% · 激进储蓄(谨慎使用)</option>
  2763. <option value="1.00">不设上限(仅显示完整需求)</option>
  2764. </select>
  2765. </div>
  2766. </div>
  2767. <!-- ===== /段 5 结束 ===== -->
  2768. </div>
  2769. <div class="calc-row" id="calcRow">
  2770. <button class="btn btn-ghost" onclick="resetForm()">↺ 重置</button>
  2771. <button class="btn btn-primary" onclick="calculate()">📊 计算保额 →</button>
  2772. </div>
  2773. <!-- ===== 输出区 ===== -->
  2774. <div id="result">
  2775. <!-- [2026-07-12 移植] 客户家庭档案卡 · 替代原「保险配置诊断」展示位(源:家庭保障体检报告 v0.1) -->
  2776. <div class="v01-family-card" id="v01FamilyCard" style="display:none">
  2777. <!-- 顶部 eyebrow + 大标题(左) · CFPI 金环(右) -->
  2778. <div class="v01-fc-header">
  2779. <div class="v01-fc-head-text">
  2780. <div class="v01-fc-eyebrow">
  2781. <span class="v01-fc-eyebrow-line"></span>
  2782. <span class="v01-fc-eyebrow-text">客户家庭档案 · Client Profile</span>
  2783. <span class="v01-fc-eyebrow-line"></span>
  2784. </div>
  2785. <h2 class="v01-fc-title" id="v01FcTitle">— 待载入画像 —</h2>
  2786. <div class="v01-fc-subtitle" id="v01FcSubtitle">请填写左侧表单或从画像下拉选择</div>
  2787. </div>
  2788. <!-- CFPI 保障完整度金环仪表盘(右侧) -->
  2789. <div class="v01-cfpi-gauge" id="v01CfpiGauge">
  2790. <div class="v01-cfpi-ring">
  2791. <svg width="104" height="104" viewBox="0 0 104 104">
  2792. <defs><linearGradient id="cfpiGrad" x1="0" y1="0" x2="1" y2="1">
  2793. <stop offset="0%" stop-color="#B89A52"/><stop offset="100%" stop-color="#2D6A4F"/>
  2794. </linearGradient></defs>
  2795. <circle class="v01-cfpi-ring-track" cx="52" cy="52" r="44"/>
  2796. <circle class="v01-cfpi-ring-fill" id="v01CfpiRingFill" cx="52" cy="52" r="44"
  2797. stroke-dasharray="276.5" stroke-dashoffset="276.5"/>
  2798. </svg>
  2799. <div class="v01-cfpi-ring-center">
  2800. <div class="v01-cfpi-ring-num" id="v01CfpiNum">—</div>
  2801. <div class="v01-cfpi-ring-max">CFPI / 10</div>
  2802. </div>
  2803. </div>
  2804. <div class="v01-cfpi-meta">
  2805. <span class="v01-cfpi-meta-eyebrow">保障完整度</span>
  2806. <span class="v01-cfpi-badge" id="v01CfpiBadge">— 待评</span>
  2807. <span class="v01-cfpi-meta-desc" id="v01CfpiDesc">计算后显示 7 险种保障评分</span>
  2808. </div>
  2809. </div>
  2810. </div>
  2811. <!-- 三柱核心指标(大字 Cormorant Garamond) -->
  2812. <div class="v01-fc-metrics">
  2813. <div class="v01-fc-metric">
  2814. <div class="v01-fc-metric-label">家庭年收入</div>
  2815. <div class="v01-fc-metric-value" id="v01FcIncome">¥ —</div>
  2816. <div class="v01-fc-metric-sub" id="v01FcIncomeSub">主理人 + 配偶</div>
  2817. </div>
  2818. <div class="v01-fc-metric-divider"></div>
  2819. <div class="v01-fc-metric">
  2820. <div class="v01-fc-metric-label">总资产</div>
  2821. <div class="v01-fc-metric-value" id="v01FcWealth">¥ —</div>
  2822. <div class="v01-fc-metric-sub" id="v01FcWealthSub">4 盘合计</div>
  2823. </div>
  2824. <div class="v01-fc-metric-divider"></div>
  2825. <!-- [2026-07-12 提案① · 对齐 FAV 顶部卡] 已配置保额 · 7 险种 existing 合计 -->
  2826. <div class="v01-fc-metric">
  2827. <div class="v01-fc-metric-label">已配置保额</div>
  2828. <div class="v01-fc-metric-value" id="v01FcInsured">¥ —</div>
  2829. <div class="v01-fc-metric-sub" id="v01FcInsuredSub">7 险种现有保单</div>
  2830. </div>
  2831. <div class="v01-fc-metric-divider"></div>
  2832. <!-- [2026-07-12 提案① · 对齐 FAV 顶部卡] 保障缺口 · 镜像 totalGapHero -->
  2833. <div class="v01-fc-metric">
  2834. <div class="v01-fc-metric-label">保障缺口</div>
  2835. <div class="v01-fc-metric-value" id="v01FcGap">¥ —</div>
  2836. <div class="v01-fc-metric-sub" id="v01FcGapSub">需求 − 现有</div>
  2837. </div>
  2838. <div class="v01-fc-metric-divider"></div>
  2839. <div class="v01-fc-metric">
  2840. <div class="v01-fc-metric-label">退休规划</div>
  2841. <div class="v01-fc-metric-value v01-fc-metric-value-text" id="v01FcRetire">—</div>
  2842. <div class="v01-fc-metric-sub" id="v01FcRetireSub">月支出 / 寿期</div>
  2843. </div>
  2844. </div>
  2845. <!-- 资产 4 盘细分 -->
  2846. <div class="v01-fc-assets" id="v01FcAssets"></div>
  2847. <!-- 7 险种现有保单 -->
  2848. <div class="v01-fc-policies-head">
  2849. <span class="v01-fc-policies-icon">📋</span>
  2850. <span class="v01-fc-policies-title">现有保单 · 7 险种保障概览</span>
  2851. </div>
  2852. <div class="v01-fc-policies-grid" id="v01FcPolicies"></div>
  2853. </div>
  2854. <!-- [2026-07-12 移植] 体检报告 Hero · 作为 #result 直接子元素 → Tab 引擎抓成第5 Tab -->
  2855. <div class="v01-hero" id="v01Hero">
  2856. <div class="v01-hero-title">保险配置 · 5 分钟诊断</div>
  2857. <h1 class="v01-hero-headline" id="v01Headline">您的家庭保障 <em>体检报告</em></h1>
  2858. <div class="v01-hero-grid">
  2859. <!-- 左侧:三环 + 3 KPI(Jack 2026-06-22:Coach 移出 grid 放最下方,左右等高) -->
  2860. <div class="v01-left-col">
  2861. <!-- [v0.1.3] 三环卡片 · 视角切换驱动 -->
  2862. <div class="v01-rings-wrap">
  2863. <div class="v01-rings-head">
  2864. <div>
  2865. <div class="v01-rings-perspective" id="v01RingsTitle">保险三层 · 基础 / 中端 / 高端</div>
  2866. <div class="v01-rings-subtitle" id="v01RingsSubtitle">沿用 v4.7 风险金字塔架构 · 数据已有</div>
  2867. </div>
  2868. </div>
  2869. <div class="v01-rings-row" id="v01RingsRow">
  2870. <!-- 3 个环 tile · 由 JS v01RenderRings 渲染 -->
  2871. </div>
  2872. </div>
  2873. <div class="v01-kpi-row" style="margin-top:18px">
  2874. <div class="v01-kpi v01-kpi-gap">
  2875. <div class="v01-kpi-icon">💰</div>
  2876. <div class="v01-kpi-label">保障缺口</div>
  2877. <div class="v01-kpi-value" id="v01KpiGap">¥ —</div>
  2878. <div class="v01-kpi-sub" id="v01KpiGapSub">7 险种合计</div>
  2879. </div>
  2880. <div class="v01-kpi v01-kpi-leverage">
  2881. <div class="v01-kpi-icon">⚖</div>
  2882. <div class="v01-kpi-label">保障杠杆</div>
  2883. <div class="v01-kpi-value" id="v01KpiLeverage">— ×</div>
  2884. <div class="v01-kpi-sub">纯保障型</div>
  2885. </div>
  2886. <div class="v01-kpi v01-kpi-cost">
  2887. <div class="v01-kpi-icon">💸</div>
  2888. <div class="v01-kpi-label">实际年成本</div>
  2889. <div class="v01-kpi-value" id="v01KpiCost">¥ —</div>
  2890. <div class="v01-kpi-sub" id="v01KpiCostSub">年缴 / 收入</div>
  2891. </div>
  2892. </div>
  2893. </div>
  2894. <!-- 右侧:4 mini 可视化 2x2 -->
  2895. <div class="v01-vis-grid">
  2896. <div class="v01-vis-card">
  2897. <div class="v01-vis-head">
  2898. <span class="v01-vis-icon">🔺</span>
  2899. <span class="v01-vis-title">风险金字塔</span>
  2900. </div>
  2901. <div class="v01-vis-body">
  2902. <svg class="v01-mini-pyramid" viewBox="0 0 200 120" id="v01MiniPyramid">
  2903. <!-- 由 v01UpdateHero() 动态填充 -->
  2904. </svg>
  2905. </div>
  2906. <div class="v01-vis-foot" id="v01PyramidFoot">7 险种水位 · 0% 已配齐</div>
  2907. </div>
  2908. <div class="v01-vis-card">
  2909. <div class="v01-vis-head">
  2910. <span class="v01-vis-icon">📊</span>
  2911. <span class="v01-vis-title">现金流 60 年</span>
  2912. </div>
  2913. <div class="v01-vis-body">
  2914. <canvas class="v01-mini-cashflow" id="v01MiniCashflow" width="240" height="110"></canvas>
  2915. </div>
  2916. <div class="v01-vis-foot" id="v01CashflowFoot">↑ 流出 / ↓ 流入 双向柱</div>
  2917. </div>
  2918. <div class="v01-vis-card">
  2919. <div class="v01-vis-head">
  2920. <span class="v01-vis-icon">🎯</span>
  2921. <span class="v01-vis-title">三轨方案</span>
  2922. </div>
  2923. <div class="v01-vis-body">
  2924. <div class="v01-mini-tri">
  2925. <div class="v01-mini-tri-cell">
  2926. <div class="v01-mini-tri-label">完整需求</div>
  2927. <div class="v01-mini-tri-num" id="v01MiniTriFull">¥ —</div>
  2928. </div>
  2929. <div class="v01-mini-tri-cell is-aff">
  2930. <div class="v01-mini-tri-label">可负担</div>
  2931. <div class="v01-mini-tri-num" id="v01MiniTriAff">¥ —</div>
  2932. </div>
  2933. <div class="v01-mini-tri-cell is-custom">
  2934. <div class="v01-mini-tri-label">自定义</div>
  2935. <div class="v01-mini-tri-num" id="v01MiniTriCustom">¥ —</div>
  2936. </div>
  2937. </div>
  2938. </div>
  2939. <div class="v01-vis-foot">三档方案对比 · 完整 / 可负担 / 自定义</div>
  2940. </div>
  2941. <div class="v01-vis-card">
  2942. <div class="v01-vis-head">
  2943. <span class="v01-vis-icon">💧</span>
  2944. <span class="v01-vis-title">应急储备健康度</span>
  2945. </div>
  2946. <div class="v01-vis-body">
  2947. <div class="v01-mini-emergency">
  2948. <div class="v01-mini-emerg-num"><span id="v01EmergencyNum">—</span><span class="v01-mini-emerg-unit">月</span></div>
  2949. <div class="v01-mini-emerg-bar"><div class="v01-mini-emerg-fill" id="v01EmergencyFill" style="width:0%"></div></div>
  2950. <div class="v01-mini-emerg-scale"><span>0月</span><span>6月</span><span>12月</span><span>24月+</span></div>
  2951. </div>
  2952. </div>
  2953. <div class="v01-vis-foot" id="v01EmergencyFoot">流动资产 / 月生活费 · 行业建议 6-12 月</div>
  2954. </div>
  2955. </div>
  2956. </div>
  2957. </div>
  2958. <!-- [2026-07-12 移植自 FAV] 01 家族保单 → 第6 Tab(sel .fav-family-policies) -->
  2959. <div class="fav-family-policies" id="favFamilyPolicies">
  2960. <div class="fav-sec-head"><span class="num">家族</span>家族保单聚合</div>
  2961. <div class="member-pills" id="favMemberPills"></div>
  2962. <div class="member-desc" id="favMemberDesc">📋 当前查看:家族总览 · 显示家庭全部保单记录</div>
  2963. <table class="policy-table">
  2964. <thead><tr><th>成员</th><th>险种</th><th>保险公司</th><th>保额</th><th>被保险人</th><th>受益人</th><th>阶段</th></tr></thead>
  2965. <tbody id="favPolicyBody"></tbody>
  2966. </table>
  2967. <p class="fav-note">💡 演示口径:IC 为家庭级数据,现有保单默认归主理人投保;逐成员归属为合成展示。家族全成员真实保单映射请用「家族账户 FAV」页面。</p>
  2968. </div>
  2969. <!-- [2026-07-12 移植自 FAV] 02a 生命周期两阶段 → 并入 Tab A(sel 追加 .fav-lifecycle-block) -->
  2970. <div class="fav-lifecycle-block" id="favLifecycleBlock">
  2971. <div class="fav-sec-head"><span class="num">生命周期</span>保障缺口 · 按生命周期两阶段</div>
  2972. <div id="favLcBody"></div>
  2973. </div>
  2974. <!-- 总览 Cover · [2026-07-12] 隐藏保留 · calculate() 与下游卡片仍读写其子节点 ID -->
  2975. <div class="result-cover" style="display:none">
  2976. <div class="rc-eyebrow">INSURANCE CALCULATOR · RESULT</div>
  2977. <div class="rc-title" id="rcTitle">陈先生(35 岁) · 保险配置诊断</div>
  2978. <div class="rc-subtitle" id="rcSubtitle">基于 DIME 法 + 高端医疗 800 万 cover + 子女教育路径自动计算</div>
  2979. <!-- [v3.6] 计算依据展开按钮 -->
  2980. <div style="margin-top:12px;text-align:center">
  2981. <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>
  2982. </div>
  2983. <div class="rc-summary rc-summary-v4">
  2984. <div class="rc-tile rc-tile-onetime">
  2985. <div class="rc-tile-label">一次性赔付保额合计</div>
  2986. <div class="rc-tile-value" id="totalOnetimeCoverage">¥ -</div>
  2987. <div class="rc-tile-sub">重疾 + 医疗 + 定寿 + 终身寿 + 意外</div>
  2988. </div>
  2989. <div class="rc-tile rc-tile-longterm">
  2990. <div class="rc-tile-label">长周期累积需求合计</div>
  2991. <div class="rc-tile-value" id="totalLongtermNeed">¥ -</div>
  2992. <div class="rc-tile-sub">养老金 / 教育金 PV 现值</div>
  2993. </div>
  2994. <!-- [v4.7 + Jack 2026-06-21] 保障缺口 · 7 险种 need - existing 累计 · 客户最直观的"还差多少" -->
  2995. <div class="rc-tile rc-tile-gap">
  2996. <div class="rc-tile-label">保障缺口</div>
  2997. <div class="rc-tile-value" id="totalGapHero">¥ -</div>
  2998. <div class="rc-tile-sub" id="totalGapHeroSub">7 险种现有保单 vs 完整需求差额</div>
  2999. </div>
  3000. <div class="rc-tile rc-tile-cost">
  3001. <div class="rc-tile-label">客户实际年成本</div>
  3002. <div class="rc-tile-value" id="totalAnnualPremium">¥ -</div>
  3003. <div class="rc-tile-sub" id="totalAnnualPremiumSub">年缴保费 · 占资产比例</div>
  3004. </div>
  3005. <div class="rc-tile rc-tile-leverage">
  3006. <div class="rc-tile-label">保障杠杆</div>
  3007. <div class="rc-tile-value" id="leverage">- 倍</div>
  3008. <div class="rc-tile-sub">一次性赔付 / 20年纯保障型保费</div>
  3009. </div>
  3010. </div>
  3011. <!-- v4.0 兼容 · 老 totalCoverage / totalGap / totalPremium 节点保留(JS 仍写入,但不显示) -->
  3012. <span id="totalCoverage" style="display:none">-</span>
  3013. <span id="totalGap" style="display:none">-</span>
  3014. <span id="totalPremium" style="display:none">-</span>
  3015. <!-- [v4.3] 软提示警示条(超 AUM 100% 时显示,不强制缩减) -->
  3016. <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>
  3017. <!-- [v4.4.2] 注解折叠 · 5 条 disclaimer 用 ⓘ popover 节省空间 -->
  3018. <div style="margin-top:14px;display:flex;gap:8px;flex-wrap:wrap;justify-content:center">
  3019. <button class="info-pill info-pill-light" onclick="toggleInfoPopover('disclaimers')">
  3020. <span class="info-icon">ⓘ</span>
  3021. <span class="info-label">公式与假设说明</span>
  3022. <span class="info-count">· 5 条</span>
  3023. </button>
  3024. </div>
  3025. <!-- ⓘ Popover · 5 条 disclaimer -->
  3026. <div class="info-popover-overlay" id="info-disclaimers" onclick="event.stopPropagation()">
  3027. <div class="info-popover" onclick="event.stopPropagation()">
  3028. <div class="info-popover-head">
  3029. <span class="info-pop-icon">📐</span>
  3030. <span>v4.4 公式 / 假设 / Disclaimer 共 5 条</span>
  3031. <button class="info-popover-close" onclick="toggleInfoPopover('disclaimers')">×</button>
  3032. </div>
  3033. <div class="info-popover-body">
  3034. <div class="info-row">
  3035. <strong>① v4.3 公式与软提示</strong><br>
  3036. 相比 v4.2 硬性 100% AUM 缩减,v4.3 三处优化 — 配偶补充按 spouseSalary/salary 比例(无收入则 0,避免虚假需求);境内增额终身寿合计 ≤ 境内资产 × 50% 上限(防止 max 公式过激);一次性赔付 100% AUM 改为软提示,超出后只显示警示,不强制砍。
  3037. </div>
  3038. <div class="info-row info-row-warn">
  3039. <strong>② 杠杆倍数 disclaimer</strong><br>
  3040. 80/40/20/10x 按健康标体非吸烟测算,实际由保司精算综合年龄/健康/性别/烟酒史定价,可能偏差 ±30%。
  3041. </div>
  3042. <div class="info-row info-row-warn">
  3043. <strong>③ 美籍 50% needRatio 复合系数</strong><br>
  3044. 跨境美籍 50% 是Benchmark 对外标准复合系数,综合 3 层需求 — 跨境法律隔离(STAR/VISTA 信托)~ 20%;流动性桥梁(资产变现期家庭过渡)~ 10-15%;美籍遗产税敞口对冲 ~ 10-30%(因身份+US-situs 比例+豁免额变动)。
  3045. </div>
  3046. <div class="info-row info-row-warn">
  3047. <strong>④ 美籍敞口具体规则</strong><br>
  3048. US Person(公民/绿卡)= 全球资产 × 40%(豁免 $1393 万 USD,2027 预期减半);NRA(非居民)= 仅 US-situs assets × 40%(豁免 $6 万)。精确测算需 1v1 顾问服务,Benchmark 后续版本将加 UI 输入字段(身份/US-situs 比例/豁免自动扣)。
  3049. </div>
  3050. <div class="info-row info-row-warn">
  3051. <strong>⑤ 重疾(储蓄型)意外身故</strong><br>
  3052. 储蓄型重疾<strong>意外身故也赔保额</strong>(身故责任),不只是诊断重疾才赔。
  3053. </div>
  3054. </div>
  3055. </div>
  3056. </div>
  3057. </div>
  3058. <!-- [v3.6] 7 险种计算依据展开块(默认隐藏 · 点 result-cover 上的按钮触发) -->
  3059. <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)">
  3060. <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">
  3061. <span style="font-size:18px">📐</span>
  3062. <span style="font-size:15px;font-weight:700;font-family:'Noto Serif SC',serif;color:#3D2914;letter-spacing:-.3px">7 险种总保额完整计算依据</span>
  3063. <span style="font-size:11.5px;color:#7A6028;margin-left:auto" id="fpKpiHeader">客户感知口径 · 详细公式 + 数字</span>
  3064. <button onclick="toggleFormulaPanel()" style="background:transparent;border:1px solid #9B7C3A;color:#7A6028;padding:3px 10px;border-radius:4px;cursor:pointer;font-size:11px">✕ 收起</button>
  3065. </div>
  3066. <div id="formulaPanelBody" style="font-size:12.5px;line-height:1.85;color:#3D2914"></div>
  3067. <!-- [v4.4.2] fp-disclaimer 折叠为 ⓘ popover -->
  3068. <div style="margin-top:12px;text-align:center">
  3069. <button class="info-pill" onclick="toggleInfoPopover('fp-disclaimer')">
  3070. <span class="info-icon">ⓘ</span>
  3071. <span class="info-label">口径说明</span>
  3072. <span class="info-count">· 双口径分离</span>
  3073. </button>
  3074. </div>
  3075. <div class="info-popover-overlay" id="info-fp-disclaimer">
  3076. <div class="info-popover" onclick="event.stopPropagation()">
  3077. <div class="info-popover-head">
  3078. <span class="info-pop-icon">📐</span>
  3079. <span>v4.0 口径说明 · 双口径分离</span>
  3080. <button class="info-popover-close" onclick="toggleInfoPopover('fp-disclaimer')">×</button>
  3081. </div>
  3082. <div class="info-popover-body">
  3083. <p>本工具采用<strong>"一次性赔付 vs 长周期累积"双口径分离</strong>。其中:</p>
  3084. <div class="info-row">
  3085. <strong>一次性赔付组(金色)</strong><br>
  3086. 意外险 / 重疾 / 高端医疗 / 寿险 / 终身寿险 — 出险即赔保额(精算严格风险敞口)
  3087. </div>
  3088. <div class="info-row">
  3089. <strong>长周期累积组(蓝色)</strong><br>
  3090. 养老金 / 教育金 — <strong>v4.0 已改用 PV 现值</strong>(今天该准备的购买力,非未来名义金额),避免数字虚高
  3091. </div>
  3092. <div class="info-row">
  3093. <strong>实际成本(年缴保费)</strong><br>
  3094. 7 项保费总和 ÷ 20 年 = 客户每年实际支出,这才是和资产做对比的合理口径
  3095. </div>
  3096. </div>
  3097. </div>
  3098. </div>
  3099. </div>
  3100. <!-- v3.4 · 家庭总财富画像(流动 / 自住 / 投资三盘) -->
  3101. <div class="wealth-picture-section" id="wealthPictureSection">
  3102. <div class="wp-head">
  3103. <span style="font-size:18px">📊</span>
  3104. <span class="wp-title">家庭总财富画像 · Total Wealth</span>
  3105. <span class="wp-meta" id="wpMeta">v3.4 新增 · 流动+自住+投资 三盘合并视角</span>
  3106. </div>
  3107. <div class="wp-stack">
  3108. <div class="wp-bar" id="wpBar">
  3109. <div class="wp-seg wp-seg-liquid" id="wpSegLiquid" title="流动资产"></div>
  3110. <div class="wp-seg wp-seg-house" id="wpSegHouse" title="自住房产"></div>
  3111. <div class="wp-seg wp-seg-invest" id="wpSegInvest" title="其他投资"></div>
  3112. <div class="wp-seg wp-seg-insur" id="wpSegInsur" title="保险现金价值"></div>
  3113. </div>
  3114. <div class="wp-legend">
  3115. <div class="wp-legend-item">
  3116. <span class="wp-dot wp-dot-liquid"></span>
  3117. <span class="wp-lbl">💧 流动资产</span>
  3118. <span class="wp-amt" id="wpLiquidAmt">¥ -</span>
  3119. <span class="wp-pct" id="wpLiquidPct">- %</span>
  3120. </div>
  3121. <div class="wp-legend-item">
  3122. <span class="wp-dot wp-dot-house"></span>
  3123. <span class="wp-lbl">🏠 自住房产</span>
  3124. <span class="wp-amt" id="wpHouseAmt">¥ -</span>
  3125. <span class="wp-pct" id="wpHousePct">- %</span>
  3126. </div>
  3127. <div class="wp-legend-item">
  3128. <span class="wp-dot wp-dot-invest"></span>
  3129. <span class="wp-lbl">🏛 其他投资</span>
  3130. <span class="wp-amt" id="wpInvestAmt">¥ -</span>
  3131. <span class="wp-pct" id="wpInvestPct">- %</span>
  3132. </div>
  3133. <div class="wp-legend-item">
  3134. <span class="wp-dot wp-dot-insur"></span>
  3135. <span class="wp-lbl">📜 保险现金价值</span>
  3136. <span class="wp-amt" id="wpInsurAmt">¥ -</span>
  3137. <span class="wp-pct" id="wpInsurPct">- %</span>
  3138. </div>
  3139. <div class="wp-legend-item wp-legend-total">
  3140. <span class="wp-dot wp-dot-total"></span>
  3141. <span class="wp-lbl">总财富</span>
  3142. <span class="wp-amt" id="wpTotalAmt">¥ -</span>
  3143. <span class="wp-pct">100%</span>
  3144. </div>
  3145. </div>
  3146. </div>
  3147. <div class="wp-insight" id="wpInsight"></div>
  3148. <div class="wp-actions">
  3149. <a class="wp-action-btn" href="javascript:void(0)" onclick="jumpToAssetCenter()">
  3150. 🏛 打开资产配置中心 <span style="opacity:.7">(细化股票/基金/黄金/私募)</span>
  3151. </a>
  3152. <a class="wp-action-btn" href="javascript:void(0)" onclick="jumpToLetsSee()">
  3153. 🔮 打开 Let's See <span style="opacity:.7">(看 30 年财富推演)</span>
  3154. </a>
  3155. </div>
  3156. </div>
  3157. <!-- v2.8 · 支付能力健康度 + 行业基准对比 -->
  3158. <div class="affordability-section" id="affordabilitySection">
  3159. <div class="aff-head">
  3160. <span style="font-size:18px">⚖</span>
  3161. <span class="aff-title">支付能力健康度 · Affordability Check</span>
  3162. <span class="aff-meta">v2.9 升级 · HNW 以 AUM 为分母 + 教育金分级保留(留学优先)</span>
  3163. </div>
  3164. <div class="aff-row">
  3165. <div class="aff-card">
  3166. <div class="aff-card-label" id="affFamilyIncomeLabel">家庭年收入</div>
  3167. <div class="aff-card-value" id="affFamilyIncome">¥ -</div>
  3168. <div class="aff-card-sub" id="affFamilyIncomeSub">主理人 + 配偶</div>
  3169. </div>
  3170. <div class="aff-card">
  3171. <div class="aff-card-label">完整需求年缴(理论)</div>
  3172. <div class="aff-card-value" id="affFullPremium">¥ -</div>
  3173. <div class="aff-card-sub" id="affFullPremiumSub">基于 7 险种缺口</div>
  3174. </div>
  3175. <div class="aff-card">
  3176. <div class="aff-card-label">保费占收入比</div>
  3177. <div class="aff-card-value" id="affPremiumRatio">- %</div>
  3178. <div class="aff-card-sub" id="affPremiumRatioSub">普通家庭 10-20% / HNW 1-3%</div>
  3179. </div>
  3180. <div class="aff-card aff-card-emphasis">
  3181. <div class="aff-card-label">可负担年缴(推荐)</div>
  3182. <div class="aff-card-value" id="affAffordablePremium">¥ -</div>
  3183. <div class="aff-card-sub" id="affAffordablePremiumSub">按上限自动缩减储蓄型</div>
  3184. </div>
  3185. </div>
  3186. <div class="aff-warning" id="affWarning" style="display:none">
  3187. <span class="aff-warn-icon">⚠</span>
  3188. <span class="aff-warn-text" id="affWarnText"></span>
  3189. </div>
  3190. <div class="aff-benchmark">
  3191. <div class="aff-bench-row">
  3192. <div class="aff-bench-label" id="affCoverageBenchLabel">总保额 / 家庭年收入</div>
  3193. <div class="aff-bench-bar">
  3194. <div class="aff-bench-track">
  3195. <div class="aff-bench-band aff-bench-band-ok" style="left:0;width:50%"></div>
  3196. <div class="aff-bench-band aff-bench-band-warn" style="left:50%;width:25%"></div>
  3197. <div class="aff-bench-band aff-bench-band-bad" style="left:75%;width:25%"></div>
  3198. <div class="aff-bench-marker" id="affCoverageMarker" style="left:0%"></div>
  3199. </div>
  3200. <div class="aff-bench-scale" id="affCoverageScale">
  3201. <span>0×</span><span>10×</span><span>20×</span><span>30×</span><span>40×+</span>
  3202. </div>
  3203. </div>
  3204. <div class="aff-bench-value" id="affCoverageMultiple">- ×</div>
  3205. </div>
  3206. <div class="aff-bench-row">
  3207. <div class="aff-bench-label" id="affPremiumBenchLabel">年缴 / 家庭年收入</div>
  3208. <div class="aff-bench-bar">
  3209. <div class="aff-bench-track">
  3210. <div class="aff-bench-band aff-bench-band-ok" style="left:0;width:33%"></div>
  3211. <div class="aff-bench-band aff-bench-band-warn" style="left:33%;width:33%"></div>
  3212. <div class="aff-bench-band aff-bench-band-bad" style="left:66%;width:34%"></div>
  3213. <div class="aff-bench-marker" id="affPremiumMarker" style="left:0%"></div>
  3214. </div>
  3215. <div class="aff-bench-scale" id="affPremiumScale">
  3216. <span>0%</span><span>15%</span><span>30%</span><span>45%+</span>
  3217. </div>
  3218. </div>
  3219. <div class="aff-bench-value" id="affPremiumPct">- %</div>
  3220. </div>
  3221. <div class="aff-bench-legend">
  3222. <span class="aff-bench-leg-dot aff-bench-band-ok"></span><span>合理区</span>
  3223. <span class="aff-bench-leg-dot aff-bench-band-warn"></span><span>警示区</span>
  3224. <span class="aff-bench-leg-dot aff-bench-band-bad"></span><span>超出区</span>
  3225. </div>
  3226. </div>
  3227. <div class="aff-tri-track" id="affDualTrack" style="display:none">
  3228. <div class="aff-tri-head">
  3229. <span style="font-size:16px">🎯</span>
  3230. <span class="aff-tri-title">三轨配置建议 · 完整需求 vs 可负担方案 vs 自定义方案</span>
  3231. <span class="aff-tri-edit-hint">💡 第三列「自定义方案」可<strong>直接编辑</strong>,Canvas 实时同步</span>
  3232. </div>
  3233. <table class="aff-tri-table" id="affTriTable">
  3234. <thead>
  3235. <tr>
  3236. <th class="tri-col-name">险种</th>
  3237. <th class="tri-col-full">A. 完整需求<span class="tri-col-sub">理论上限</span></th>
  3238. <th class="tri-col-aff">B. 可负担方案<span class="tri-col-sub">系统推荐落地</span></th>
  3239. <th class="tri-col-custom">C. 自定义方案<span class="tri-col-sub">代理人自定义</span></th>
  3240. </tr>
  3241. </thead>
  3242. <tbody id="affTriTableBody">
  3243. <!-- 由 JS 渲染 -->
  3244. </tbody>
  3245. <tfoot>
  3246. <tr class="tri-total-row">
  3247. <td>年缴合计</td>
  3248. <td class="tri-num" id="triFullTotal">¥-</td>
  3249. <td class="tri-num tri-num-aff" id="triAffTotal">¥-</td>
  3250. <td class="tri-num tri-num-custom" id="triCustomTotal">¥-</td>
  3251. </tr>
  3252. <!-- [v4.7 Q1 + Jack 2026-06-21] 三档差异 mini badge · 让客户秒看出"自定义方案 vs 可负担/完整需求"差额 -->
  3253. <tr class="tri-diff-row">
  3254. <td style="font-size:11px;color:#7A6028;padding:6px 8px;font-weight:600">vs 完整需求</td>
  3255. <td class="tri-diff-cell" style="text-align:center;padding:6px 8px;font-size:11px;color:#7A6028">基准</td>
  3256. <td class="tri-diff-cell" id="triAffDiff" style="text-align:center;padding:6px 8px;font-size:11px"></td>
  3257. <td class="tri-diff-cell" id="triCustomDiff" style="text-align:center;padding:6px 8px;font-size:11px"></td>
  3258. </tr>
  3259. </tfoot>
  3260. </table>
  3261. <div class="aff-tri-warn" id="triCustomWarn"></div>
  3262. <div id="triExtraWarn"><!-- [v4.7] Q2 准退休护栏 + Q3 中端档现金流提示 由 renderAffordabilityCheck 注入 --></div>
  3263. <div class="aff-dual-note">
  3264. 💡 <strong>缩减策略 v2.9</strong>:刚需险(重疾/医疗/寿险)按完整需求保留;储蓄型险按比例缩减,但<strong>教育金按子女路径分级保留</strong> —— 留学(elite_us / full_overseas)floor 70% / 混合(domestic_plus)floor 50% / 国内 floor 30%,因签证 + 入学窗口刚性,留学不可缓。养老金可延后补足。<br>
  3265. 🔵 <strong>自定义方案(C 列)</strong>默认 = 可负担方案,代理人可基于客户实际意愿微调每个险种 —— Canvas 现金流图会同步重画一条<strong style="color:#2B6CB0">蓝色虚线</strong>对照真实方案。
  3266. </div>
  3267. </div>
  3268. </div>
  3269. <!-- ===== [v4.5] 现金流规划段 · LDI 视角(60 年生命周期净现金流)===== -->
  3270. <div class="cashflow-section" id="cashflowSection">
  3271. <div class="cf-section-head">
  3272. <span style="font-size:20px">💰</span>
  3273. <span class="cf-section-title">现金流规划 · LDI 视角(60 年生命周期)</span>
  3274. <span class="cf-section-meta">支出期(Y0-Y30 向上)+ 领取期(Y30-Y60 向下)· 服务于 Liability Driven Investment 全周期投资规划</span>
  3275. </div>
  3276. <div class="cf-chart-wrap">
  3277. <div class="cf-chart-head">
  3278. <span class="cf-chart-title">📊 60 年净现金流(¥万/年)</span>
  3279. <span class="cf-chart-meta">↑ 流出 · 7 险种保费(支出)/ ↓ 流入 · 养老月领 + 教育返还 · 鼠标悬停查看年份明细</span>
  3280. </div>
  3281. <!-- [v4.5.2] 方案切换器 · 建议 vs 可负担 -->
  3282. <div class="cf-scenario-switch">
  3283. <span class="cf-scenario-label">展示方案:</span>
  3284. <button class="cf-scenario-btn is-active" data-scenario="full" onclick="switchCfScenario('full')">
  3285. <span class="scn-icon">📋</span>
  3286. <span class="scn-name">建议方案</span>
  3287. <span class="scn-detail" id="scnFullDetail">完整需求 · 年缴 ¥-</span>
  3288. </button>
  3289. <button class="cf-scenario-btn" data-scenario="affordable" onclick="switchCfScenario('affordable')">
  3290. <span class="scn-icon">✓</span>
  3291. <span class="scn-name">可负担方案</span>
  3292. <span class="scn-detail" id="scnAffordableDetail">系统缩减 · 年缴 ¥-</span>
  3293. </button>
  3294. <button class="cf-scenario-btn is-custom" data-scenario="custom" onclick="switchCfScenario('custom')">
  3295. <span class="scn-icon">🔵</span>
  3296. <span class="scn-name">自定义方案</span>
  3297. <span class="scn-detail" id="scnCustomDetail">代理人编辑 · 年缴 ¥-</span>
  3298. </button>
  3299. <span class="cf-scenario-hint" id="cfScenarioHint">💡 当前展示「建议方案」· 完整需求口径,养老/教育按完整 retireNeed/eduNeed 计算</span>
  3300. </div>
  3301. <!-- Canvas 趋势图 + tooltip · v4.5 高度增加给双向柱 -->
  3302. <div class="cf-canvas-wrap" style="position:relative;width:100%">
  3303. <canvas id="premiumTimelineCanvas" width="900" height="400" style="width:100%;height:auto;max-height:440px;display:block"></canvas>
  3304. <div id="cfTooltip" class="cf-tooltip" style="display:none"></div>
  3305. </div>
  3306. <!-- 图例 (v4.5 加流入项) -->
  3307. <div class="cf-legend">
  3308. <span style="color:#7A6028;font-weight:600;font-size:11px;margin-right:6px">↑ 流出</span>
  3309. <span class="cf-legend-item"><span class="cf-dot" style="background:#9B7C3A"></span>意外险</span>
  3310. <span class="cf-legend-item"><span class="cf-dot" style="background:#C4973A"></span>高端医疗</span>
  3311. <span class="cf-legend-item"><span class="cf-dot" style="background:#A61C2B"></span>重疾</span>
  3312. <span class="cf-legend-item"><span class="cf-dot" style="background:#7A3FA0"></span>定期寿险</span>
  3313. <span class="cf-legend-item"><span class="cf-dot" style="background:#3D6F8C"></span>养老金</span>
  3314. <span class="cf-legend-item"><span class="cf-dot" style="background:#5DB890"></span>教育金</span>
  3315. <span class="cf-legend-item"><span class="cf-dot" style="background:#7A5A8E"></span>终身寿险</span>
  3316. <span style="border-left:1px solid #C9A84C;height:14px;margin:0 4px"></span>
  3317. <span style="color:#2DB37C;font-weight:600;font-size:11px;margin-right:6px">↓ 流入</span>
  3318. <span class="cf-legend-item"><span class="cf-dot" style="background:#2DB37C"></span>养老月领</span>
  3319. <span class="cf-legend-item"><span class="cf-dot" style="background:#5DB890"></span>教育金返还</span>
  3320. </div>
  3321. </div>
  3322. <!-- 关键节点说明 -->
  3323. <div class="cf-insights" id="cfInsights">
  3324. <!-- 由 renderPremiumTimeline 动态生成 -->
  3325. </div>
  3326. </div>
  3327. <!-- v1.3 · 金字塔体检卡(取代 7 险种缺口图 · 与 PolicySummary 视觉一致) -->
  3328. <div class="pyramid-check-card" id="pyramidCheckCard">
  3329. <div class="pcc-svg-wrap">
  3330. <!-- v3.2.1 · 金字塔左上工具开关(水位动画 / 立体感)-->
  3331. <div class="pyramid-controls" data-card="cy_calc">
  3332. <button class="pc-toggle" data-key="anim" data-on="1" title="水位动画 · 开:显示实际覆盖率水位 · 关:显示满覆盖原色对照(用于看缺口)">
  3333. <span class="tg-dot"></span><span class="tg-label">💧 实际</span>
  3334. </button>
  3335. <button class="pc-toggle" data-key="stereo" data-on="1" title="立体感开关 · 关闭后金字塔变扁平,适合白天演示反光环境">
  3336. <span class="tg-dot"></span><span class="tg-label">🎨 3D</span>
  3337. </button>
  3338. </div>
  3339. <svg viewBox="0 0 280 240" id="calcPyramidSvg"></svg>
  3340. </div>
  3341. <div class="pcc-info">
  3342. <h3>家族风险金字塔体检
  3343. <span class="pcc-label-badge" id="pccLabelBadge"></span>
  3344. </h3>
  3345. <div class="pcc-tier-rows" id="pccTierRows"></div>
  3346. <div class="pcc-diagnosis" id="pccDiagnosis">
  3347. <div class="pcc-diag-msg" id="pccDiagMsg"></div>
  3348. <div class="pcc-diag-text" id="pccDiagText"></div>
  3349. </div>
  3350. <div class="pcc-score-strip">
  3351. <div>
  3352. <div class="pcc-ss-num" id="pccScoreNum">—<span class="pcc-ss-suffix">/ 10</span></div>
  3353. </div>
  3354. <div class="pcc-ss-label">家族风险综合评分<br/><span style="opacity:.7;font-size:10px">已买保险 6.0 起评 · 配置完整度加分 · 险种均衡度加分</span></div>
  3355. </div>
  3356. </div>
  3357. </div>
  3358. <!-- [v4.8 · 2026-06-26] 年缴保费分配 donut 图已移除(冗余信息) · JS 函数保留 -->
  3359. <!-- 7 险种卡片 · v3.0 v1.2 · 按金字塔三层强制分行 -->
  3360. <div class="policy-grid">
  3361. <!-- ━━━ 🟧 基础风险层(进/防 · 没钱 · 损失性风险 · 所有家庭必配) ━━━ -->
  3362. <div class="tier-banner-row tb-base">
  3363. <span class="tb-emoji">🟧</span>
  3364. <span>基础风险层</span>
  3365. <span class="tb-meta">进 / 防 · 损失性风险 · 解决"没钱"问题 · 所有家庭必配</span>
  3366. <span class="tb-progress" id="tbBaseProgress">
  3367. <span class="tb-bar-track"><span class="tb-bar-fill" id="tbBaseFill" style="width:0%"></span></span>
  3368. <span class="tb-pct" id="tbBasePct">—</span>
  3369. <span class="tb-status-icon" id="tbBaseIcon">○</span>
  3370. </span>
  3371. </div>
  3372. <div class="tier-row tier-base">
  3373. <!-- 1.1 意外险(基础) -->
  3374. <div class="policy-card accident" data-tier="base">
  3375. <span class="pc-tier-badge">🟧 基础</span>
  3376. <div class="pc-head">
  3377. <span class="pc-icon">⚡</span>
  3378. <span class="pc-status" id="accStatus" title="缺口状态">—</span>
  3379. <span class="pc-title">意外险</span>
  3380. <span class="pc-tag">ACCIDENT</span>
  3381. </div>
  3382. <div class="pc-amount" id="accAmount">¥ -<span class="unit">万</span></div>
  3383. <div class="pc-amount-sub">突发性身故/伤残的家庭维持缓冲 · 5 年家庭支出</div>
  3384. <div class="pc-bar">
  3385. <div class="pc-bar-meta"><span>现有 <span class="v" id="accExisting">¥0万</span></span><span>缺口 <span class="v" id="accGapText">¥0万</span></span></div>
  3386. <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>
  3387. </div>
  3388. <div class="pc-formula">
  3389. <strong>公式</strong> 意外险保额 = 年支出 × 5(覆盖 5 年家庭维持缓冲)
  3390. <span class="formula-line" id="accCalc">= --</span>
  3391. <span class="formula-line">▸ 推荐:**百万意外险**(高保额低保费 · 1500-3000 元/年)</span>
  3392. </div>
  3393. <div class="pc-meta">
  3394. <span class="pc-meta-label">建议年缴保费</span>
  3395. <span class="pc-meta-value" id="accPremium">¥ -</span>
  3396. </div>
  3397. </div>
  3398. <!-- 1.2 医疗险(基础) -->
  3399. <div class="policy-card med" data-tier="base">
  3400. <span class="pc-tier-badge">🟧 基础</span>
  3401. <div class="pc-head">
  3402. <span class="pc-icon">💚</span>
  3403. <span class="pc-status" id="medStatus" title="缺口状态">—</span>
  3404. <span class="pc-title">医疗险</span>
  3405. <span class="pc-tag">HIGH-END MEDICAL</span>
  3406. </div>
  3407. <div class="pc-amount" id="medAmount">¥ 800<span class="unit">万</span></div>
  3408. <div class="pc-amount-sub">推荐保额 · cover 境内顶级私立 + 海外医疗</div>
  3409. <div class="pc-bar">
  3410. <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>
  3411. <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>
  3412. </div>
  3413. <div class="pc-formula">
  3414. <strong>公式</strong> 800 万固定建议
  3415. <span class="formula-line">▸ 覆盖治疗费 + 康复费 → 让重疾纯做收入替代</span>
  3416. <span class="formula-line">▸ 推荐:**国际医疗险**(覆盖境内顶级私立 + 海外医疗)</span>
  3417. </div>
  3418. <div class="pc-meta">
  3419. <span class="pc-meta-label">建议年缴保费</span>
  3420. <span class="pc-meta-value" id="medPremium">¥ -</span>
  3421. </div>
  3422. </div>
  3423. <!-- 1.3 重疾险(基础) -->
  3424. <div class="policy-card ci" data-tier="base">
  3425. <span class="pc-tier-badge">🟧 基础</span>
  3426. <div class="pc-head">
  3427. <span class="pc-icon">🔴</span>
  3428. <span class="pc-status" id="ciStatus" title="缺口状态">—</span>
  3429. <span class="pc-title">重疾险</span>
  3430. <span class="pc-tag">CRITICAL ILLNESS</span>
  3431. </div>
  3432. <div class="pc-amount" id="ciAmount">¥ -<span class="unit">万</span></div>
  3433. <div class="pc-amount-sub">建议保额 · 用于 5 年康复期收入替代</div>
  3434. <div class="pc-bar">
  3435. <div class="pc-bar-meta"><span>现有 <span class="v" id="ciExisting">¥0万</span></span><span>缺口 <span class="v" id="ciGapText">¥0万</span></span></div>
  3436. <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>
  3437. </div>
  3438. <div class="pc-formula">
  3439. <strong>公式</strong> 重疾保额 = 年收入 × N(倍数,默认 3,可调 2-5)
  3440. <span class="formula-line">▸ 因高端医疗 cover 治疗费,重疾纯粹用于收入替代</span>
  3441. <span class="formula-line" id="ciCalc">= --</span>
  3442. </div>
  3443. <div class="pc-meta">
  3444. <span class="pc-meta-label">建议年缴保费</span>
  3445. <span class="pc-meta-value" id="ciPremium">¥ -</span>
  3446. </div>
  3447. </div>
  3448. </div><!-- /.tier-row.tier-base -->
  3449. <!-- ━━━ 🟨 中端风险层(出/增 · 花钱 · 支出性风险 + 收入替代) ━━━ -->
  3450. <!-- [v4.8 · 2026-06-26] 中端 tier 外侧暖色 wrap(白带 → 暖底) -->
  3451. <div class="tier-band-wrap tier-band-wrap--warm">
  3452. <div class="tier-banner-row tb-mid">
  3453. <span class="tb-emoji">🟨</span>
  3454. <span>中端风险层</span>
  3455. <span class="tb-meta">出 / 增 · 支出性风险 · 解决"花钱"问题 · 中产 + 中高净值</span>
  3456. <span class="tb-progress" id="tbMidProgress">
  3457. <span class="tb-bar-track"><span class="tb-bar-fill" id="tbMidFill" style="width:0%"></span></span>
  3458. <span class="tb-pct" id="tbMidPct">—</span>
  3459. <span class="tb-status-icon" id="tbMidIcon">○</span>
  3460. </span>
  3461. </div>
  3462. <div class="tier-row tier-mid">
  3463. <!-- 2.1 教育年金(中端) -->
  3464. <div class="policy-card education" data-tier="mid">
  3465. <span class="pc-tier-badge">🟨 中端</span>
  3466. <div class="pc-head">
  3467. <span class="pc-icon">🎓</span>
  3468. <span class="pc-status" id="eduStatus" title="缺口状态">—</span>
  3469. <span class="pc-title">教育年金</span>
  3470. <span class="pc-tag">EDUCATION FUND</span>
  3471. </div>
  3472. <div class="pc-amount" id="eduAmount">¥ -<span class="unit">万</span></div>
  3473. <div class="pc-amount-sub">所有子女教育金合计 · 含 5% 教育通胀</div>
  3474. <div class="pc-bar">
  3475. <div class="pc-bar-meta"><span>已储备 <span class="v" id="eduExisting">¥0万</span></span><span>缺口 <span class="v" id="eduGapText">¥0万</span></span></div>
  3476. <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>
  3477. </div>
  3478. <div class="pc-formula">
  3479. <strong>公式</strong> Σ(单子女单价 × (1.05)^到大学剩余年数) - 储备
  3480. <span class="formula-line" id="eduCalc">--</span>
  3481. </div>
  3482. <div class="pc-meta">
  3483. <span class="pc-meta-label">建议年缴保费 (10 年缴)</span>
  3484. <span class="pc-meta-value" id="eduPremium">¥ -</span>
  3485. </div>
  3486. </div>
  3487. <!-- 2.2 养老年金(中端) -->
  3488. <div class="policy-card retirement" data-tier="mid">
  3489. <span class="pc-tier-badge">🟨 中端</span>
  3490. <div class="pc-head">
  3491. <span class="pc-icon">💰</span>
  3492. <span class="pc-status" id="retireStatus" title="缺口状态">—</span>
  3493. <span class="pc-title">养老年金</span>
  3494. <span class="pc-tag">RETIREMENT</span>
  3495. </div>
  3496. <div class="pc-amount" id="retireAmount">¥ -<span class="unit">万</span></div>
  3497. <div class="pc-amount-sub">退休后总缺口 · 维持现有生活水平</div>
  3498. <div class="pc-bar">
  3499. <div class="pc-bar-meta"><span>已储备 <span class="v" id="retireExisting">¥0万</span></span><span>缺口 <span class="v" id="retireGapText">¥0万</span></span></div>
  3500. <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>
  3501. </div>
  3502. <div class="pc-formula">
  3503. <strong>公式</strong> 退休后月支出 = 年薪 × 替代率 / 12 · 月缺口 × 12 × 年金终值因子
  3504. <span class="formula-line" id="retireCalc1">退休后月支出 = - </span>
  3505. <span class="formula-line" id="retireCalc2">月缺口(扣社保 ¥1.2万) × 12 × 年金现值因子(PV) = -</span>
  3506. </div>
  3507. <div class="pc-meta">
  3508. <span class="pc-meta-label">建议年缴保费</span>
  3509. <span class="pc-meta-value" id="retirePremium">¥ -</span>
  3510. </div>
  3511. </div>
  3512. <!-- 2.3 定期寿险(中端 · 主理人收入替代 · DIME 公式) -->
  3513. <div class="policy-card life" id="lifeCard" data-tier="mid">
  3514. <span class="pc-tier-badge">🟨 中端</span>
  3515. <div class="pc-head">
  3516. <span class="pc-icon">🛡</span>
  3517. <span class="pc-status" id="lifeStatus" title="缺口状态">—</span>
  3518. <span class="pc-title">定期寿险</span>
  3519. <span class="pc-tag">TERM LIFE</span>
  3520. <span class="hnw-tag" id="hnwBadge" style="display:none">HNW 模式</span>
  3521. </div>
  3522. <div class="pc-amount" id="lifeAmount">¥ -<span class="unit">万</span></div>
  3523. <div class="pc-amount-sub" id="lifeAmountSub">建议保额 · 主理人意外身故时的家庭保障</div>
  3524. <div class="pc-bar">
  3525. <div class="pc-bar-meta"><span>现有 <span class="v" id="lifeExisting">¥0万</span></span><span>缺口 <span class="v" id="lifeGapText">¥0万</span></span></div>
  3526. <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>
  3527. </div>
  3528. <div class="pc-formula" id="dimeFormula">
  3529. <strong>DIM 公式</strong> = 房贷+负债 + 收入替代(主理人占比 · 折现到现值) - 现有资产
  3530. <span class="formula-line" id="lifeCalcD">D = -</span>
  3531. <span class="formula-line" id="lifeCalcI">I = -</span>
  3532. <span class="formula-line" id="lifeCalcE" style="opacity:.55">E = (教育金已在独立险种,寿险不重复计入)</span>
  3533. <span class="formula-line" id="lifeCalcA">A = -</span>
  3534. </div>
  3535. <div class="pc-meta">
  3536. <span class="pc-meta-label">建议年缴保费</span>
  3537. <span class="pc-meta-value" id="lifePremium">¥ -</span>
  3538. </div>
  3539. </div>
  3540. </div><!-- /.tier-row.tier-mid -->
  3541. </div><!-- /.tier-band-wrap (中端 v4.8 暖底) -->
  3542. <!-- ━━━ 🟡 高端风险层(保/传 · 留钱 · 所有性风险 · UHNW/跨境配置) ━━━ -->
  3543. <!-- [v4.8 · 2026-06-26] 高端 tier 外加全宽暖底 wrap(结构对称) -->
  3544. <div class="tier-band-wrap tier-band-wrap--warm">
  3545. <div class="tier-banner-row tb-high">
  3546. <span class="tb-emoji">🟡</span>
  3547. <span>高端风险层</span>
  3548. <span class="tb-meta">保 / 传 · 所有性风险 · 解决"留钱"问题 · UHNW / 跨境配置</span>
  3549. <span class="tb-progress" id="tbHighProgress">
  3550. <span class="tb-bar-track"><span class="tb-bar-fill" id="tbHighFill" style="width:0%"></span></span>
  3551. <span class="tb-pct" id="tbHighPct">—</span>
  3552. <span class="tb-status-icon" id="tbHighIcon">○</span>
  3553. </span>
  3554. </div>
  3555. <div class="tier-row tier-high">
  3556. <!-- 3.1 终身寿险(高端 · 整行 · 含境内/境外双 Tab) -->
  3557. <div class="policy-card whole-life" data-tier="high">
  3558. <span class="pc-tier-badge">🟡 高端</span>
  3559. <div class="pc-head">
  3560. <span class="pc-icon">💎</span>
  3561. <span class="pc-status" id="wlStatus" title="缺口状态">—</span>
  3562. <span class="pc-title">终身寿险</span>
  3563. <span class="pc-tag">WHOLE LIFE · 传承隔离 · 装入信托</span>
  3564. </div>
  3565. <div class="pc-amount" id="wlAmount">¥ -<span class="unit">万</span></div>
  3566. <div class="pc-amount-sub">资产传承隔离基线 · 总资产 × 30%</div>
  3567. <div class="pc-bar">
  3568. <div class="pc-bar-meta"><span>现有 <span class="v" id="wlExisting">¥0万</span></span><span>缺口 <span class="v" id="wlGapText">¥0万</span></span></div>
  3569. <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>
  3570. </div>
  3571. <div class="pc-formula">
  3572. <strong>公式</strong> 终身寿保额 = 总资产 × 30%(传承隔离基线)
  3573. <span class="formula-line" id="wlCalc">= --</span>
  3574. </div>
  3575. <!-- [v3.6] 双轨展示:境内增额终身寿 + 境外 IUL/VUL/PPLI(分级) -->
  3576. <!-- [v4.8] 加 ic-hnw-wrap class · L2 金调全宽 band(高级功能区视觉提示)-->
  3577. <div id="hnwTabsWrap" class="ic-hnw-wrap" data-collapsed="1">
  3578. <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">
  3579. <span><span class="hnw-toggle-arrow" style="display:inline-block;transition:transform 0.2s;margin-right:8px">▶</span>境内 / 境外双轨配置详情(产品 / 杠杆 / 法律)</span>
  3580. <span class="hnw-toggle-hint" style="font-size:11px;font-weight:600;color:#7A3FA0;opacity:0.7">点击展开</span>
  3581. </div>
  3582. <div class="hnw-detail-body" style="display:none;margin-top:14px">
  3583. <div class="life-tabs">
  3584. <div class="life-track-tab active" onclick="switchLifeTrack('domestic', this)">🇨🇳 境内增额终身寿</div>
  3585. <div class="life-track-tab" onclick="switchLifeTrack('overseas', this)">🌏 境外 · IUL / VUL / PPLI ★</div>
  3586. </div>
  3587. <!-- 境内 Tab · v3.6 加回:境内增额终身寿 -->
  3588. <div class="life-track-pane active" id="lifeTrackDomestic">
  3589. <div class="life-track-amount" id="domesticAmount">¥ -<span class="unit">亿</span></div>
  3590. <div class="life-track-amount-sub">境内增额终身寿建议 · 主理人 + 配偶分散投保</div>
  3591. <div class="pc-formula">
  3592. <strong>境内增额终身寿拆解</strong>
  3593. <span class="formula-line" id="domesticCalc1">▸ 主理人 = -</span>
  3594. <span class="formula-line" id="domesticCalc2">▸ 配偶补充 = -</span>
  3595. <span class="formula-line" id="domesticCalc3">⚠ 64 岁以上 + 健康因素综合上限 ¥3-5 亿/单人</span>
  3596. </div>
  3597. <div class="hnw-hl-box">
  3598. <strong>📦 推荐配置类型</strong> 境内增额终身寿(主)+ 终身寿(配偶补充 · 分散投保)<br>
  3599. <strong>💰 杠杆</strong> 5-10x · 杠杆比 = 保额 / 总保费(20-30 年缴清)<br>
  3600. <strong>⚖ 法律</strong> 《保险法》§42 · 指定受益人 · 不属遗产 · 免个税<br>
  3601. <strong>🏷 推荐产品</strong> 友邦传世金生 / 中宏盈丰 / 平安御享金生 / 中国人寿鑫盈鸿利
  3602. </div>
  3603. </div>
  3604. <!-- 境外 Tab · v3.6 重设计:IUL / VUL / PPLI 分级 -->
  3605. <div class="life-track-pane" id="lifeTrackOverseas">
  3606. <div class="life-track-amount" id="overseasAmount">¥ -<span class="unit">亿</span></div>
  3607. <div class="life-track-amount-sub" id="overseasAmountSub">境外终身寿险 · 按资产档分级推荐</div>
  3608. <div class="pc-formula">
  3609. <strong>境外终身寿拆解</strong>
  3610. <span class="formula-line" id="overseasCalc1">▸ 推荐档位 = -</span>
  3611. <span class="formula-line" id="overseasCalc2">▸ 装入资产 = -</span>
  3612. <span class="formula-line" id="overseasCalc3" style="color:var(--accent)">⚠ AUM &lt; $2000 万美金不启用 PPLI · 优先 IUL / VUL · 建议 3-5 张保单分批配置</span>
  3613. </div>
  3614. <table class="ppli-table" id="ppliTableWrapper">
  3615. <thead><tr><th>装入资产类别</th><th>装入比例</th><th class="num">境外保额(¥万)</th></tr></thead>
  3616. <tbody id="ppliTableBody">
  3617. <!-- 由 JS 渲染 -->
  3618. </tbody>
  3619. </table>
  3620. <div class="hnw-hl-box">
  3621. <strong>🌏 跨境通道</strong> 持牌境外保险公司(开曼/百慕大/列支敦士登)· 通过持牌经纪通道办理<br>
  3622. <strong>✓ 产品分级</strong>
  3623. · IUL(指数型万能寿险)入门款 - $500 万美金以下 ·
  3624. · VUL(投连型万能寿险)中段 - $500-2000 万美金 ·
  3625. · <strong style="color:var(--accent)">PPLI(私募定制寿险)顶级 - $2000 万美金以上(¥1.4 亿)</strong><br>
  3626. <strong>✓ 杠杆倍数</strong> 35-45 岁 80x · 46-55 岁 40x · 56-65 岁 20x · 66+ 岁 10x(Benchmark middle-funded · 健康标体非吸烟测算)<br>
  3627. <strong>✓ 免遗产税</strong> 死亡赔付按保单计税(美籍二代 40% 税率重灾区)<br>
  3628. <strong>✓ 跨境合规</strong> CRS / FATCA 友好 · 跨代信托受益(STAR/VISTA)<br>
  3629. <strong>🏷 推荐产品</strong> Sun Life Hong Kong IUL / Manulife Singapore SIUL3 / NHW Life Solution PPLI<br>
  3630. <strong style="color:var(--c-red)">⚠ 实操建议</strong> 跨境美籍/大额保额建议 3-5 张保单分批配置(单笔 ¥3000-5000 万),避免单保单核保压力 + 分散通道风险
  3631. </div>
  3632. </div>
  3633. <div class="dual-track-summary">
  3634. <span class="lbl">境内 / 境外 配置比例</span>
  3635. <span class="ratio" id="dualRatio">-</span>
  3636. <span class="lbl">终身寿合计</span>
  3637. <span class="ratio" id="dualTotal">-</span>
  3638. </div>
  3639. </div><!-- /.hnw-detail-body -->
  3640. </div>
  3641. <!-- 非 HNW 客户提示(v3.1 · 双轨详情已默认折叠 · 此提示文案配合调整) -->
  3642. <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">
  3643. 💡 <strong>当前为普通家庭模式</strong> · 终身寿险按"总资产 × 30%"展示传承隔离基线建议。「境内 / 境外双轨详情」默认折叠,展开可查看产品 / 杠杆 / PPLI 装入资产明细(高净值场景配置)。
  3644. </div>
  3645. <div class="pc-meta">
  3646. <span class="pc-meta-label">建议年缴保费</span>
  3647. <span class="pc-meta-value" id="wlPremium">¥ -</span>
  3648. </div>
  3649. </div>
  3650. </div><!-- /.tier-row.tier-high -->
  3651. </div><!-- /.tier-band-wrap (高端 v4.8 暖底) -->
  3652. </div><!-- /.policy-grid -->
  3653. <!-- 配置优先级 · 接下来要做什么(v2026-06-13) -->
  3654. <!-- [v4.8 · 2026-06-26] 外加全宽白带 wrap(由 pale-gold 改为 white) -->
  3655. <div class="tier-band-wrap tier-band-wrap--white">
  3656. <div class="priority-section" id="prioritySection">
  3657. <div class="priority-head">
  3658. <span style="font-size:20px">⏵</span>
  3659. <span class="priority-title">配置优先级 · 接下来要做什么</span>
  3660. <span class="priority-meta">基于 7 险种 × 风险金字塔三层 · 自动按 tier 优先级 + 缺口大小排序</span>
  3661. </div>
  3662. <div class="priority-subtitle">
  3663. 系统按缺口金额 + 紧迫度 + 投保窗口期综合排序 · 数字越靠前优先级越高 · 每项配套**具体下一步行动**(产品 / 通道 / 时间窗口)。代理人可基于此清单为客户制定 90 天 / 180 天 / 365 天行动计划。
  3664. </div>
  3665. <div class="priority-list" id="priorityList">
  3666. <!-- 由 renderPriorityTimeline() 渲染 -->
  3667. </div>
  3668. </div>
  3669. </div><!-- /.tier-band-wrap (priority white v4.8) -->
  3670. <!-- [v4.8 · 2026-06-26] 高净值差异化建议卡已移除(信息冗余 · 已被客户一页总结取代)
  3671. JS 函数 renderUhnwSuggestions() 保留,DOM 缺失时早期 return,不影响渲染 -->
  3672. <!-- [v4.8 · 2026-06-26] 客户家庭报告 · 一页总结(报告尾部"客户带走"卡)-->
  3673. <!-- 外侧暖色 wrap(pale-gold → warm 2026-06-26) -->
  3674. <div class="tier-band-wrap tier-band-wrap--warm">
  3675. <div class="client-summary-card" id="clientSummaryCard">
  3676. <div class="cs-head">
  3677. <span class="cs-icon">📋</span>
  3678. <span class="cs-title">您的家庭保障 · 一页总结</span>
  3679. <span class="cs-tag">CLIENT TAKEAWAY</span>
  3680. </div>
  3681. <div class="cs-subtitle">30 秒带走的核心信息 · 您看完整份报告后,只需记住这一页</div>
  3682. <!-- 一句话诊断 -->
  3683. <div class="cs-headline" id="csHeadline">
  3684. <!-- 由 renderClientSummary() 渲染 -->
  3685. </div>
  3686. <!-- 关键指标 4 项 -->
  3687. <div class="cs-metrics" id="csMetrics">
  3688. <div class="cs-metric">
  3689. <div class="cs-metric-label">总缺口</div>
  3690. <div class="cs-metric-value" id="csMetricGap">¥ -</div>
  3691. <div class="cs-metric-sub">7 险种合计</div>
  3692. </div>
  3693. <div class="cs-metric">
  3694. <div class="cs-metric-label">综合评分</div>
  3695. <div class="cs-metric-value" id="csMetricScore">- / 10</div>
  3696. <div class="cs-metric-sub" id="csMetricScoreLabel">—</div>
  3697. </div>
  3698. <div class="cs-metric">
  3699. <div class="cs-metric-label">最大缺口</div>
  3700. <div class="cs-metric-value cs-metric-value-text" id="csMetricMaxGap">—</div>
  3701. <div class="cs-metric-sub" id="csMetricMaxGapAmt">¥ -</div>
  3702. </div>
  3703. <div class="cs-metric">
  3704. <div class="cs-metric-label">年缴 / 年薪</div>
  3705. <div class="cs-metric-value" id="csMetricRatio">- %</div>
  3706. <div class="cs-metric-sub" id="csMetricRatioLabel">—</div>
  3707. </div>
  3708. </div>
  3709. <!-- 接下来 3 件事 -->
  3710. <div class="cs-actions-head">🎯 接下来 3 件事 · 按时间窗口排优先级</div>
  3711. <div class="cs-actions" id="csActions">
  3712. <!-- 由 renderClientSummary() 渲染 3 个 cs-action 块 -->
  3713. </div>
  3714. <!-- 顾问联系 -->
  3715. <div class="cs-cta">
  3716. <div class="cs-cta-msg">💬 准备好了吗?联系您的 1v1 顾问开始下一步</div>
  3717. <div class="cs-cta-contact">
  3718. <strong>Jack · Benchmark Wealth</strong>
  3719. <span class="cs-cta-divider">|</span>
  3720. <span>微信 jackpara</span>
  3721. <span class="cs-cta-divider">|</span>
  3722. <span>邮箱 jack@benchmarkwealth.com</span>
  3723. </div>
  3724. </div>
  3725. </div>
  3726. </div><!-- /.tier-band-wrap (client-summary 暖底 v4.8) -->
  3727. <!-- Phase 3 · 推荐产品区(接 products-bundle.js) -->
  3728. <!-- [v4.8 · 2026-06-26] 外加全宽白带 wrap -->
  3729. <div class="tier-band-wrap tier-band-wrap--white">
  3730. <div class="product-section">
  3731. <div class="gap-chart-head">
  3732. <span style="font-size:18px">📦</span>
  3733. <span class="gap-chart-title">推荐产品 · 真实产品库匹配</span>
  3734. <span class="gap-chart-meta">数据来源 products-bundle.js · 33 款产品池</span>
  3735. </div>
  3736. <div class="product-tabs">
  3737. <div class="product-tab active" onclick="switchProductTab('onshore', this)">🇨🇳 境内寿险/年金</div>
  3738. <div class="product-tab" onclick="switchProductTab('offshore', this)">🌏 境外 IUL / VUL / PPLI</div>
  3739. </div>
  3740. <div class="product-pane active" id="productPaneOnshore">
  3741. <div class="product-grid" id="onshoreProducts"></div>
  3742. </div>
  3743. <div class="product-pane" id="productPaneOffshore">
  3744. <div class="product-grid" id="offshoreProducts"></div>
  3745. </div>
  3746. </div>
  3747. </div><!-- /.tier-band-wrap (product-section white v4.8) -->
  3748. <div class="calc-row">
  3749. <button class="btn btn-ghost" onclick="document.getElementById('result').style.display='none';window.scrollTo({top:0,behavior:'smooth'})">↺ 重新填写</button>
  3750. <button class="btn btn-ghost" onclick="window.print()">📥 导出 PDF / 打印</button>
  3751. <button class="btn btn-primary" onclick="alert('1v1 顾问咨询\\n\\n联系 Jack:\\n• 微信: jackpara\\n• 邮箱: jack@chengyan.com\\n\\nBenchmark Wealth · 保险配置专项咨询')">📞 对接 1v1 顾问咨询</button>
  3752. </div>
  3753. </div>
  3754. <!-- Footer -->
  3755. <div class="footer">
  3756. Benchmark Wealth © 2026 · Insurance Calculator v5.1 · Powered by 助飞科技
  3757. <div class="disclaimer">
  3758. ⚠ 保额建议基于行业公式(DIME / 5 倍年收入 / 教育金通胀)演算,**仅供代理人现场参考**。<br>
  3759. 具体配置以 Benchmark Wealth 1v1 服务 + 完整 CFPI 评测 + 持牌代理人核保结果为准。本工具不构成保险销售建议。
  3760. </div>
  3761. </div>
  3762. </div>
  3763. <!-- 产品详情 Modal(v2026-06-13 · 点击产品卡弹出)-->
  3764. <div class="product-modal" id="productModal" onclick="if(event.target===this)closeProductModal()">
  3765. <div class="pm-card" id="pmCard">
  3766. <button class="pm-close" onclick="closeProductModal()" title="关闭">✕</button>
  3767. <div id="pmContent"><!-- 由 showProductModal() 渲染 --></div>
  3768. </div>
  3769. </div>
  3770. </div><!-- /.cy-main -->
  3771. </div><!-- /.cy-app -->
  3772. <!-- ============================================================== -->
  3773. <!-- 计算引擎 v1.0 · Phase 1 MVP + Phase 2 portrait 接入 + Phase 3 -->
  3774. <!-- ============================================================== -->
  3775. <!-- v5.0:cy-config.js(平台开关·白标版不带)+ cy-sidebar.js(mode-aware 侧栏)-->
  3776. <script src="data/cy-config.js"></script>
  3777. <script src="data/portraits-bundle.js"></script>
  3778. <script src="data/cy-portraits-extended.js"></script>
  3779. <script src="data/products-bundle.js"></script>
  3780. <script src="data/cy-renderer.js?v=20260611a"></script>
  3781. <script src="data/cy-policy-meta.js?v=20260613a"></script>
  3782. <script src="data/cy-sidebar.js?v=20260716-ssot3"></script>
  3783. <script src="data/cy-ic-tabs.js?v=20260711-phase2-v3"></script>
  3784. <script src="data/cy-client-context.js?v=20260718"></script>
  3785. <script>
  3786. // v5.0 · 渲染 mode-aware 常驻侧栏(保额计算器 active)
  3787. (function(){
  3788. function boot(){
  3789. if (!window.CYSidebar) { console.warn('[IC v5.0] CYSidebar 未加载'); return; }
  3790. window.CYSidebar.render({
  3791. mount: '#cy-sidebar-mount',
  3792. activeKey: 'insurance',
  3793. moduleName: '保额计算器',
  3794. moduleEn: 'Insurance Calculator',
  3795. demoUrl: '#', // 独立版 CTA:预约演示(部署时填真实地址)
  3796. contactUrl: '#' // 独立版 CTA:联系顾问
  3797. });
  3798. }
  3799. if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', boot);
  3800. else boot();
  3801. })();
  3802. </script>
  3803. <script>
  3804. 'use strict';
  3805. // ============================================================
  3806. // v3.0 跨页跳转预填 · 接收 PolicySummary 的 cy_calc_prefill
  3807. // ============================================================
  3808. (function applyCrossPagePrefill() {
  3809. try {
  3810. const raw = sessionStorage.getItem('cy_calc_prefill');
  3811. if (!raw) return;
  3812. const prefill = JSON.parse(raw);
  3813. sessionStorage.removeItem('cy_calc_prefill');
  3814. // 5 分钟过期(避免老 prefill 误触发)
  3815. if (prefill.timestamp && Date.now() - prefill.timestamp > 5 * 60 * 1000) return;
  3816. // 等待 DOM ready 后写入
  3817. function apply() {
  3818. // 1. 写姓氏
  3819. const surnameEl = document.getElementById('surname');
  3820. if (surnameEl && prefill.insured_name) {
  3821. surnameEl.value = prefill.insured_name.replace(/\s/g, '').slice(0, 1) || prefill.insured_name;
  3822. }
  3823. // 2. 显示一个高亮提示条(在 hero 后插入)
  3824. if (prefill.risk_dimension) {
  3825. const hero = document.querySelector('.hero');
  3826. if (hero && !document.getElementById('xpagePrefillBanner')) {
  3827. const banner = document.createElement('div');
  3828. banner.id = 'xpagePrefillBanner';
  3829. banner.style.cssText = [
  3830. 'margin:18px 0;padding:14px 20px;border-radius:8px',
  3831. 'background:linear-gradient(90deg,rgba(155,124,58,0.12) 0%,rgba(155,124,58,0.04) 100%)',
  3832. 'border-left:4px solid #C9A84C;color:#5C4810;font-size:13px;line-height:1.55'
  3833. ].join(';');
  3834. const gapWan = (prefill.gap_cents || 0) / 100 / 10000;
  3835. const gapStr = gapWan >= 10000
  3836. ? (gapWan / 10000).toFixed(2) + ' 亿'
  3837. : Math.round(gapWan).toLocaleString('zh-CN') + ' 万';
  3838. banner.innerHTML =
  3839. '🎯 <strong>从保单汇总携带过来</strong>:' +
  3840. (prefill.insured_name || '客户') + ' · ' +
  3841. '<strong>' + prefill.risk_dimension + '</strong> 缺口 ' +
  3842. '<strong style="color:#B71C1C">¥' + gapStr + '</strong>' +
  3843. ' · 已自动填充姓氏,请补充其他字段后点击「📊 计算 7 险种保额」';
  3844. hero.parentNode.insertBefore(banner, hero.nextSibling);
  3845. }
  3846. }
  3847. console.log('[v3.0 prefill] 已应用 PolicySummary 跨页参数:', prefill);
  3848. }
  3849. if (document.readyState === 'loading') {
  3850. document.addEventListener('DOMContentLoaded', apply);
  3851. } else {
  3852. apply();
  3853. }
  3854. } catch(e) { console.warn('[v3.0 prefill]', e); }
  3855. })();
  3856. /* === 教育路径单价 (¥万/子女) === */
  3857. const EDU_PATH_COST = {
  3858. 'domestic': 100,
  3859. 'domestic_plus': 250,
  3860. 'full_overseas': 600,
  3861. 'elite_us': 1000
  3862. };
  3863. /* === Phase 4 · 9 个预设客户画像(代表性场景库) ===
  3864. [v2.9 完善] 每个画像加 v29_params 块,按场景调优 retireRatio/ciMul/cap/discount;
  3865. HNW 画像加 aumWan(让 v2.9 AUM 分母模式完整生效)
  3866. */
  3867. const CLIENT_PERSONAS = [
  3868. {
  3869. id: 'middle_3', tier: 'std', name: '三口之家·中产',
  3870. forceHNW: false,
  3871. data: {
  3872. surname:'李', age:35, gender:'M', marriage:'married',
  3873. childCount:1, childAge1:5, childAge2:'', childAge3:'',
  3874. eduPath:'domestic_plus',
  3875. salary:50, spouseSalary:30, mortgage:200, otherDebt:0, liquidAssets:50,
  3876. primaryResidence:500, investAssets:0, overseasAssets:0, // [v4.2] 默认无境外资产
  3877. existingLife:100, existingCI:30, existingMed:'0',
  3878. existingRetirement:0, existingEduInsurance:0,
  3879. retireAge:60, lifeExpectancy:90
  3880. },
  3881. v29_params: {
  3882. retireLifestyleRatio: 0.70,
  3883. incomeDiscountRate: 0.03,
  3884. ciMultiplier: 3,
  3885. affordabilityCap: 0.20,
  3886. // [v3.5 新增] NewClient 完整导入字段
  3887. surname_en: 'Li',
  3888. name_en: 'Li Ming',
  3889. family_name_en: 'The Li Family',
  3890. nationality: 'cn',
  3891. residence_city: '上海',
  3892. industry: '一线城市中产 · 互联网/金融行业 G1 双职工'
  3893. }
  3894. },
  3895. {
  3896. id: 'two_child', tier: 'std', name: '二孩·新中产',
  3897. forceHNW: false,
  3898. data: {
  3899. surname:'王', age:40, gender:'M', marriage:'married',
  3900. childCount:2, childAge1:10, childAge2:5, childAge3:'',
  3901. eduPath:'full_overseas',
  3902. salary:100, spouseSalary:50, mortgage:500, otherDebt:0, liquidAssets:300,
  3903. primaryResidence:800, investAssets:300, overseasAssets:0, // [v4.2] 中产无境外资产
  3904. existingLife:200, existingCI:50, existingMed:'1',
  3905. existingRetirement:0, existingEduInsurance:0,
  3906. retireAge:60, lifeExpectancy:90
  3907. },
  3908. v29_params: {
  3909. retireLifestyleRatio: 0.70,
  3910. incomeDiscountRate: 0.03,
  3911. ciMultiplier: 4, // 主理人 40 岁高峰 + 双子女留学
  3912. affordabilityCap: 0.20,
  3913. surname_en: 'Wang',
  3914. name_en: 'Wang Hao',
  3915. family_name_en: 'The Wang Family',
  3916. nationality: 'cn',
  3917. residence_city: '杭州',
  3918. industry: '新一线城市新中产 · 高科技/互联网 G1 双职工'
  3919. }
  3920. },
  3921. {
  3922. id: 'single_lady', tier: 'std', name: '单身贵族·一线女',
  3923. forceHNW: false,
  3924. data: {
  3925. surname:'林', age:32, gender:'F', marriage:'single',
  3926. childCount:0, childAge1:'', childAge2:'', childAge3:'',
  3927. eduPath:'domestic',
  3928. salary:80, spouseSalary:0, mortgage:250, otherDebt:0, liquidAssets:150,
  3929. primaryResidence:500, investAssets:50, overseasAssets:0, // [v4.2] 一线无境外资产
  3930. existingLife:50, existingCI:30, existingMed:'0',
  3931. existingRetirement:0, existingEduInsurance:0,
  3932. retireAge:55, lifeExpectancy:90
  3933. },
  3934. v29_params: {
  3935. retireLifestyleRatio: 0.85, // 单身靠自己,养老不降标
  3936. incomeDiscountRate: 0.03,
  3937. ciMultiplier: 4, // 单身没人兜底
  3938. affordabilityCap: 0.30, // 无子女 + 高储蓄能力
  3939. surname_en: 'Lin',
  3940. name_en: 'Lin Yixin',
  3941. family_name_en: 'The Lin Family',
  3942. nationality: 'cn',
  3943. residence_city: '上海',
  3944. industry: '单身白领 · 金融/咨询行业资深经理'
  3945. }
  3946. },
  3947. {
  3948. id: 'dink', tier: 'std', name: 'DINK·双高收入',
  3949. forceHNW: false,
  3950. data: {
  3951. surname:'张', age:38, gender:'M', marriage:'married',
  3952. childCount:0, childAge1:'', childAge2:'', childAge3:'',
  3953. eduPath:'domestic',
  3954. salary:100, spouseSalary:80, mortgage:600, otherDebt:0, liquidAssets:400,
  3955. primaryResidence:1200, investAssets:400, overseasAssets:0, // [v4.2] DINK 默认无境外
  3956. existingLife:100, existingCI:50, existingMed:'0',
  3957. existingRetirement:0, existingEduInsurance:0,
  3958. retireAge:55, lifeExpectancy:90
  3959. },
  3960. v29_params: {
  3961. retireLifestyleRatio: 1.00, // 退休后旅行医疗,高于现状
  3962. incomeDiscountRate: 0.03,
  3963. ciMultiplier: 3, // 双收入互为兜底
  3964. affordabilityCap: 0.30, // 无子女 + 双高
  3965. surname_en: 'Zhang',
  3966. name_en: 'Zhang Yang',
  3967. family_name_en: 'The Zhang Family',
  3968. nationality: 'cn_pr', // 北京双高 + 香港 PR
  3969. residence_city: '北京',
  3970. industry: '跨国企业高管 + 科技公司中层 G1 双职工'
  3971. }
  3972. },
  3973. {
  3974. id: 'single_mom', tier: 'mid', name: '离异·单亲妈妈',
  3975. forceHNW: false,
  3976. data: {
  3977. surname:'赵', age:38, gender:'F', marriage:'divorced',
  3978. childCount:1, childAge1:8, childAge2:'', childAge3:'',
  3979. eduPath:'domestic_plus',
  3980. salary:60, spouseSalary:0, mortgage:300, otherDebt:0, liquidAssets:100,
  3981. primaryResidence:400, investAssets:0, overseasAssets:0, // [v4.2] 单亲无境外
  3982. existingLife:100, existingCI:30, existingMed:'0',
  3983. existingRetirement:0, existingEduInsurance:0,
  3984. retireAge:60, lifeExpectancy:90
  3985. },
  3986. v29_params: {
  3987. retireLifestyleRatio: 0.70,
  3988. incomeDiscountRate: 0.03,
  3989. ciMultiplier: 4, // 单一收入 + 单亲,重疾击垮率最高
  3990. affordabilityCap: 0.15, // 单收入预算紧
  3991. surname_en: 'Zhao',
  3992. name_en: 'Zhao Min',
  3993. family_name_en: 'The Zhao Family',
  3994. nationality: 'cn',
  3995. residence_city: '广州',
  3996. industry: '国企/外企中层 · 单亲家庭'
  3997. }
  3998. },
  3999. {
  4000. id: 'entrepreneur', tier: 'mid', name: '创业者·民企主',
  4001. forceHNW: false,
  4002. data: {
  4003. surname:'黄', age:42, gender:'M', marriage:'married',
  4004. childCount:2, childAge1:13, childAge2:8, childAge3:'',
  4005. eduPath:'full_overseas',
  4006. salary:300, spouseSalary:0, mortgage:800, otherDebt:1000, liquidAssets:500,
  4007. primaryResidence:1500, investAssets:1500, overseasAssets:50, // [v4.4.3] 民企主豪宅 + 少量境外金融账户(50 万美金 ≈ ¥350 万)
  4008. existingLife:300, existingCI:100, existingMed:'1',
  4009. existingRetirement:50, existingEduInsurance:200,
  4010. retireAge:60, lifeExpectancy:90
  4011. },
  4012. v29_params: {
  4013. retireLifestyleRatio: 0.85, // 民企主 UHNW 标准
  4014. incomeDiscountRate: 0.03,
  4015. ciMultiplier: 5, // 经营贷 + 高峰期 + 单收入家庭核心 → 5×
  4016. affordabilityCap: 0.30,
  4017. surname_en: 'Huang',
  4018. name_en: 'Huang Jianguo',
  4019. family_name_en: 'The Huang Family',
  4020. nationality: 'cn',
  4021. residence_city: '杭州',
  4022. industry: '民企 G1 主理人 · 浙江纺织/制造业 30 年累积'
  4023. }
  4024. },
  4025. {
  4026. id: 'silver', tier: 'mid', name: '银发族·准退休',
  4027. forceHNW: false,
  4028. data: {
  4029. surname:'周', age:55, gender:'M', marriage:'married',
  4030. childCount:0, childAge1:'', childAge2:'', childAge3:'',
  4031. eduPath:'domestic',
  4032. salary:80, spouseSalary:50, mortgage:0, otherDebt:0, liquidAssets:800,
  4033. primaryResidence:1200, investAssets:600, overseasAssets:0, // [v4.2] 中段退休普通 HNW 无境外
  4034. existingLife:200, existingCI:80, existingMed:'1',
  4035. existingRetirement:200, existingEduInsurance:0,
  4036. retireAge:60, lifeExpectancy:90
  4037. },
  4038. v29_params: {
  4039. retireLifestyleRatio: 0.45, // 房贷已清+子女独立,极简
  4040. incomeDiscountRate: 0.03,
  4041. ciMultiplier: 2, // 已有 800 万流动资产+200 万养老储备
  4042. affordabilityCap: 0.10, // 准退休不再激进
  4043. surname_en: 'Zhou',
  4044. name_en: 'Zhou Senior',
  4045. family_name_en: 'The Zhou Family',
  4046. nationality: 'cn_pr', // 国企退休 + 香港 PR
  4047. residence_city: '北京',
  4048. industry: '国企退休工程师 + 高级管理 G1'
  4049. }
  4050. },
  4051. {
  4052. id: 'cross_border', tier: 'hnw', name: '跨境·二代美籍',
  4053. forceHNW: true,
  4054. data: {
  4055. surname:'陈', age:50, gender:'M', marriage:'married',
  4056. childCount:1, childAge1:22, childAge2:'', childAge3:'',
  4057. eduPath:'elite_us',
  4058. salary:300, spouseSalary:80, mortgage:0, otherDebt:0, liquidAssets:1500,
  4059. primaryResidence:2500, investAssets:4000, overseasAssets:430, // [v4.4.3] 跨境美籍 · 境外 430 万美金 ≈ ¥3010 万(海外金融账户+海外房产+股权)
  4060. existingLife:500, existingCI:100, existingMed:'1',
  4061. existingRetirement:100, existingEduInsurance:300,
  4062. retireAge:65, lifeExpectancy:95
  4063. },
  4064. v29_params: {
  4065. retireLifestyleRatio: 0.85,
  4066. incomeDiscountRate: 0.04, // HNW 用国债基准
  4067. ciMultiplier: 5, // UHNW 体面康复期
  4068. affordabilityCap: 0.20, // 映射到 AUM × 2%
  4069. aumWan: 8000, // [v2.9] 总 AUM 8000 万
  4070. surname_en: 'Chen',
  4071. name_en: 'Chen Wei',
  4072. family_name_en: 'The Chen Family',
  4073. nationality: 'multi', // 中国 + 美籍
  4074. residence_city: '香港',
  4075. industry: 'G2 跨境美籍 · 制造业转金融业'
  4076. }
  4077. },
  4078. {
  4079. id: 'uhnw_succession', tier: 'hnw', name: 'HNW 传承家族',
  4080. forceHNW: true,
  4081. data: {
  4082. surname:'郑', age:55, gender:'M', marriage:'married',
  4083. childCount:2, childAge1:25, childAge2:18, childAge3:'',
  4084. eduPath:'elite_us',
  4085. salary:500, spouseSalary:0, mortgage:0, otherDebt:0, liquidAssets:5000,
  4086. primaryResidence:15000, investAssets:30000, overseasAssets:1140, // [v4.4.3] HNW 传承 · 境外 1140 万美金 ≈ ¥7980 万(对冲基金/离岸信托)
  4087. existingLife:2000, existingCI:200, existingMed:'1',
  4088. existingRetirement:500, existingEduInsurance:1000,
  4089. retireAge:65, lifeExpectancy:95
  4090. },
  4091. v29_params: {
  4092. retireLifestyleRatio: 1.00, // 传承级,预算无忧
  4093. incomeDiscountRate: 0.04,
  4094. ciMultiplier: 5,
  4095. affordabilityCap: 0.30, // 映射到 AUM × 3%
  4096. aumWan: 50000, // [v2.9] 总 AUM 5 亿
  4097. surname_en: 'Zheng',
  4098. name_en: 'Zheng Yongheng',
  4099. family_name_en: 'The Zheng Family',
  4100. nationality: 'cn_pr', // 中国 + 新加坡 PR
  4101. residence_city: '上海',
  4102. industry: 'G2 接班传承 · 浙江制造业 30 年累积 + 跨境家办'
  4103. }
  4104. }
  4105. ];
  4106. // [v3.5] 暴露到 window,让 jumpToAssetCenter 等函数能跨闭包访问
  4107. window.CLIENT_PERSONAS = CLIENT_PERSONAS;
  4108. /* === 画像段折叠/展开切换 === */
  4109. function togglePersonaSection(btn) {
  4110. const section = document.getElementById('personaSection');
  4111. if (!section) return;
  4112. section.classList.toggle('collapsed');
  4113. const label = btn.querySelector('.toggle-label');
  4114. if (label) {
  4115. label.textContent = section.classList.contains('collapsed') ? '展开画像库' : '收起画像库';
  4116. }}
  4117. // [v4.8 · 2026-06-26 修正] 移除冗余的 togglePolicyCard / DOMContentLoaded 折叠系统
  4118. // 原 codebase 已有 .policy-card.is-collapsed 系统(line 4809+)· 不再重复
  4119. function loadPersona(id) {
  4120. const p = CLIENT_PERSONAS.find(x => x.id === id);
  4121. if (!p) return;
  4122. // 选画像时如果当前是收起状态,保持收起(因为已选好,不需要看其他)
  4123. // 这里不主动切换状态
  4124. // v3.1 · 新增字段默认重置为 0(persona.data 若有显式定义则在下方 forEach 中覆盖)
  4125. // [v4.2] 加 overseasAssets 重置 + overseasFuturePlan toggle 重置
  4126. ['existingAccident', 'existingWholeLife', 'overseasAssets'].forEach(k => {
  4127. const el = document.getElementById(k);
  4128. if (el) el.value = 0;
  4129. });
  4130. const _futurePlanEl = document.getElementById('overseasFuturePlan');
  4131. if (_futurePlanEl) _futurePlanEl.checked = false;
  4132. // 填表
  4133. Object.keys(p.data).forEach(key => {
  4134. const el = document.getElementById(key);
  4135. if (!el) return;
  4136. el.value = p.data[key];
  4137. });
  4138. updateChildAgeFields();
  4139. // [v2.9 完善] 应用 v29_params 到 4 个下拉(retireRatio / discount / ciMul / cap)
  4140. if (p.v29_params) {
  4141. const v = p.v29_params;
  4142. const setSel = (id, val) => {
  4143. const el = document.getElementById(id);
  4144. if (!el || val === undefined || val === null) return;
  4145. const targetStr = String(val);
  4146. const opt = [...el.options].find(o => o.value === targetStr ||
  4147. Math.abs(parseFloat(o.value) - parseFloat(targetStr)) < 1e-6);
  4148. if (opt) el.value = opt.value;
  4149. };
  4150. setSel('retireLifestyleRatio', v.retireLifestyleRatio);
  4151. setSel('incomeDiscountRate', v.incomeDiscountRate);
  4152. setSel('ciMultiplier', v.ciMultiplier);
  4153. setSel('affordabilityCap', v.affordabilityCap);
  4154. if (v.aumWan !== undefined && v.aumWan > 0) {
  4155. sessionStorage.setItem('cy_persona_aum_wan', String(v.aumWan));
  4156. } else {
  4157. sessionStorage.removeItem('cy_persona_aum_wan');
  4158. }
  4159. } else {
  4160. sessionStorage.removeItem('cy_persona_aum_wan');
  4161. }
  4162. // 标记当前画像 + forceHNW
  4163. sessionStorage.setItem('cy_persona_id', id);
  4164. if (p.forceHNW) {
  4165. sessionStorage.setItem('cy_persona_force_hnw', '1');
  4166. } else {
  4167. sessionStorage.removeItem('cy_persona_force_hnw');
  4168. }
  4169. // chip 高亮 (只高亮当前点击的)
  4170. document.querySelectorAll('.persona-chip').forEach(c => c.classList.remove('selected'));
  4171. const clickedChip = [...document.querySelectorAll('.persona-chip')].find(c =>
  4172. c.getAttribute('onclick') === `loadPersona('${id}')`);
  4173. if (clickedChip) clickedChip.classList.add('selected');
  4174. // toast 提示
  4175. showInlineToast('✅ 已载入【' + p.name + '】画像 · 可微调字段后点「计算」');
  4176. // 隐藏 ctx-bar(因为是 persona 不是 portrait)
  4177. const ctxBar = document.getElementById('ctxBar');
  4178. if (ctxBar) ctxBar.classList.remove('active');
  4179. // [v2026-06-12 + 2] 不自动计算 · 等用户手动点「计算保额」
  4180. // 隐藏旧结果(避免误以为是新画像的结果)
  4181. const result = document.getElementById('result');
  4182. if (result) result.style.display = 'none';
  4183. // 滚到表单顶部 · 用户先看下字段再点「计算」
  4184. setTimeout(() => {
  4185. window.scrollTo({ top: 0, behavior: 'smooth' });
  4186. }, 100);
  4187. }
  4188. function showInlineToast(msg) {
  4189. let t = document.getElementById('_inlineToast');
  4190. if (!t) {
  4191. t = document.createElement('div');
  4192. t.id = '_inlineToast';
  4193. t.style.cssText = 'position:fixed;top:84px;left:50%;transform:translateX(-50%);' +
  4194. 'background:linear-gradient(135deg,#2A1F0E,#3D2914);color:#F5E6B8;border:1px solid #C4973A;' +
  4195. 'border-radius:8px;padding:14px 28px;font-size:14px;font-weight:500;letter-spacing:.3px;' +
  4196. 'box-shadow:0 8px 32px rgba(196,151,58,.35);z-index:99999;opacity:0;' +
  4197. 'transition:opacity .3s,transform .3s;font-family:"Noto Serif SC","PingFang SC",serif;' +
  4198. 'pointer-events:none;white-space:nowrap';
  4199. document.body.appendChild(t);
  4200. }
  4201. t.textContent = msg;
  4202. t.style.opacity = '0';
  4203. t.style.transform = 'translateX(-50%) translateY(-8px)';
  4204. requestAnimationFrame(() => {
  4205. t.style.opacity = '1';
  4206. t.style.transform = 'translateX(-50%) translateY(0)';
  4207. });
  4208. clearTimeout(t._timer);
  4209. t._timer = setTimeout(() => {
  4210. t.style.opacity = '0';
  4211. t.style.transform = 'translateX(-50%) translateY(-8px)';
  4212. }, 2800);
  4213. }
  4214. /* === 保费查表 (年缴 / 万元保额) ===
  4215. 简化版: 35-65 岁,5 岁分档,线性插值 */
  4216. const PREMIUM_TABLE = {
  4217. // 重疾(终身,30 年缴)
  4218. ci: {
  4219. 35: { M: 50, F: 48 },
  4220. 40: { M: 65, F: 62 },
  4221. 45: { M: 85, F: 80 },
  4222. 50: { M: 115, F: 105 },
  4223. 55: { M: 155, F: 140 },
  4224. 60: { M: 205, F: 180 },
  4225. 65: { M: 280, F: 240 }
  4226. },
  4227. // 寿险(增额终身寿,20 年缴)
  4228. life: {
  4229. 35: { M: 40, F: 35 },
  4230. 40: { M: 48, F: 42 },
  4231. 45: { M: 58, F: 50 },
  4232. 50: { M: 72, F: 62 },
  4233. 55: { M: 90, F: 78 },
  4234. 60: { M: 115, F: 100 },
  4235. 65: { M: 150, F: 130 }
  4236. },
  4237. // 高端医疗(年缴 · 保额 800 万)
  4238. medical: {
  4239. 35: 18000, 40: 22000, 45: 28000, 50: 35000, 55: 45000, 60: 60000, 65: 80000
  4240. }
  4241. };
  4242. function lookupPremium(table, age, gender) {
  4243. const ages = Object.keys(table).map(Number).sort((a,b) => a-b);
  4244. let lo = ages[0], hi = ages[ages.length-1];
  4245. for (let i = 0; i < ages.length-1; i++) {
  4246. if (age >= ages[i] && age < ages[i+1]) { lo = ages[i]; hi = ages[i+1]; break; }
  4247. }
  4248. if (age >= hi) return table[hi][gender] || table[hi];
  4249. if (age <= lo) return table[lo][gender] || table[lo];
  4250. const tLo = table[lo][gender] || table[lo];
  4251. const tHi = table[hi][gender] || table[hi];
  4252. const ratio = (age - lo) / (hi - lo);
  4253. return tLo + (tHi - tLo) * ratio;
  4254. }
  4255. /* === 数字格式化 === */
  4256. function fmtWan(wan) {
  4257. if (!wan) return '¥0万';
  4258. if (wan >= 10000) return '¥' + (wan/10000).toFixed(2) + '亿';
  4259. if (wan >= 1) return '¥' + Math.round(wan).toLocaleString() + '万';
  4260. return '¥' + Math.round(wan*10000).toLocaleString();
  4261. }
  4262. /* === Phase 2 · Portrait 自动预填 === */
  4263. function loadPortrait() {
  4264. try {
  4265. const raw = localStorage.getItem('cy_current_portrait');
  4266. if (raw) return JSON.parse(raw);
  4267. } catch(e) {}
  4268. return null;
  4269. }
  4270. /* === v3.3.4 · 画像切换 dropdown(与 PolicySummary 同源 · 暴露 vault 全部 CY_PORTRAITS)=== */
  4271. function populatePortraitSwitcher() {
  4272. const select = document.getElementById('portraitSwitcher');
  4273. if (!select || !window.CY_PORTRAITS) return;
  4274. const keys = Object.keys(window.CY_PORTRAITS);
  4275. select.innerHTML = '<option value="">⇄ 切换画像(共 ' + keys.length + ' 个)</option>';
  4276. // 排序:strategic / uhnw / hnw / mid / std
  4277. const tierOrder = { strategic: 0, uhnw: 1, hnw: 2, mid: 3, std: 4 };
  4278. const sorted = keys.slice().sort((a, b) => {
  4279. const ta = tierOrder[((window.CY_PORTRAITS[a].family || {}).tier) || 'std'] ?? 9;
  4280. const tb = tierOrder[((window.CY_PORTRAITS[b].family || {}).tier) || 'std'] ?? 9;
  4281. return ta - tb;
  4282. });
  4283. // 当前选中
  4284. let currentKey = '';
  4285. try {
  4286. const stored = JSON.parse(localStorage.getItem('cy_current_portrait') || 'null');
  4287. const cid = stored && stored.family && stored.family.id;
  4288. if (cid) {
  4289. sorted.forEach(k => {
  4290. const p = window.CY_PORTRAITS[k];
  4291. if (p && p.family && p.family.id === cid) currentKey = k;
  4292. });
  4293. }
  4294. } catch(e) {}
  4295. sorted.forEach(key => {
  4296. const p = window.CY_PORTRAITS[key];
  4297. if (!p || !p.family) return;
  4298. const opt = document.createElement('option');
  4299. opt.value = key;
  4300. const tier = (p.family.tier || 'std').toUpperCase();
  4301. opt.textContent = '[' + tier + '] ' + (p.family.name_cn || key) + ' · ' + (p.family.portrait_label || '');
  4302. if (key === currentKey) opt.selected = true;
  4303. select.appendChild(opt);
  4304. });
  4305. }
  4306. function switchPortrait(key) {
  4307. if (!key || !window.CY_PORTRAITS || !window.CY_PORTRAITS[key]) return;
  4308. try {
  4309. const data = JSON.stringify(window.CY_PORTRAITS[key]);
  4310. // 双 key 同步双写(兼容演示端入口 + 专版 + PolicySummary)
  4311. localStorage.setItem('cy_current_portrait', data);
  4312. localStorage.setItem('cy-demo-portrait-data', data);
  4313. localStorage.setItem('cy-demo-family', key);
  4314. sessionStorage.setItem('cy_toast', '✓ 已切换到 ' + (window.CY_PORTRAITS[key].family.name_cn || key));
  4315. } catch(e) {}
  4316. location.reload();
  4317. }
  4318. function reloadFromPortrait() {
  4319. const pt = loadPortrait();
  4320. if (!pt) {
  4321. alert('未检测到客户画像 cy_current_portrait,请先从客户列表选择客户');
  4322. return;
  4323. }
  4324. // [Bug fix] 清掉 persona 标记,让 portrait 优先级生效
  4325. sessionStorage.removeItem('cy_persona_id');
  4326. sessionStorage.removeItem('cy_persona_force_hnw');
  4327. document.querySelectorAll('.persona-chip').forEach(c => c.classList.remove('selected'));
  4328. prefillFromPortrait(pt);
  4329. }
  4330. function switchToNewClient() {
  4331. if (!confirm('切换为新客户模式 · 清空所有表单 · 不影响 localStorage 客户画像')) return;
  4332. document.querySelectorAll('input[type=text],input[type=number]').forEach(i => i.value = '');
  4333. document.getElementById('childCount').value = '0';
  4334. document.getElementById('existingMed').value = '0';
  4335. document.getElementById('ctxBar').classList.remove('active');
  4336. document.getElementById('result').style.display = 'none';
  4337. // [Bug fix] 清 persona 标记
  4338. sessionStorage.removeItem('cy_persona_id');
  4339. sessionStorage.removeItem('cy_persona_force_hnw');
  4340. document.querySelectorAll('.persona-chip').forEach(c => c.classList.remove('selected'));
  4341. updateChildAgeFields();
  4342. window.scrollTo({ top:0, behavior:'smooth' });
  4343. }
  4344. function prefillFromPortrait(pt) {
  4345. if (!pt || !pt.family) return;
  4346. // === 显示 ctx-bar ===
  4347. const ctxBar = document.getElementById('ctxBar');
  4348. ctxBar.classList.add('active');
  4349. document.getElementById('ctxName').textContent = pt.family.name_cn || '--';
  4350. if (pt.family.portrait_label) {
  4351. const portEl = document.getElementById('ctxPortrait');
  4352. portEl.style.display = 'inline-block';
  4353. portEl.textContent = pt.family.portrait + ' · ' + pt.family.portrait_label;
  4354. }
  4355. // === 主理人 ===
  4356. const principal = (pt.members || []).find(m => m.role === 'principal');
  4357. if (principal) {
  4358. document.getElementById('age').value = principal.age || '';
  4359. document.getElementById('gender').value = principal.gender === 'female' ? 'F' : 'M';
  4360. }
  4361. // 姓
  4362. document.getElementById('surname').value = pt.family.surname || '';
  4363. // 婚姻 (检测有无 spouse)
  4364. const spouse = (pt.members || []).find(m => m.role === 'spouse');
  4365. document.getElementById('marriage').value = spouse ? 'married' :
  4366. (principal && principal.marital_status === 'single' ? 'single' : 'married');
  4367. // === 子女 ===
  4368. const children = (pt.members || []).filter(m => m.role === 'child');
  4369. // 排除孙辈(generation 3+)
  4370. const directChildren = children.filter(c => !c.generation || c.generation <= 2);
  4371. document.getElementById('childCount').value = String(Math.min(3, directChildren.length));
  4372. directChildren.slice(0, 3).forEach((c, idx) => {
  4373. const ageInput = document.getElementById('childAge' + (idx + 1));
  4374. if (ageInput) ageInput.value = c.age || '';
  4375. });
  4376. updateChildAgeFields();
  4377. // 教育路径 (根据子女是否海外推断)
  4378. const overseasChild = directChildren.find(c => c.residency && c.residency !== 'CN');
  4379. const usChild = directChildren.find(c => c.is_us_person);
  4380. if (usChild) {
  4381. document.getElementById('eduPath').value = 'elite_us';
  4382. } else if (overseasChild) {
  4383. document.getElementById('eduPath').value = 'full_overseas';
  4384. } else if (directChildren.length > 0) {
  4385. document.getElementById('eduPath').value = 'domestic_plus';
  4386. }
  4387. // === 财务 ===
  4388. // 年薪估算: family.annual_expense_cny / 0.5 (年支出占年薪 50%)
  4389. const annualExpenseCny = pt.family.annual_expense_cny || 0;
  4390. if (annualExpenseCny > 0) {
  4391. document.getElementById('salary').value = Math.round(annualExpenseCny / 0.5 / 10000);
  4392. }
  4393. document.getElementById('spouseSalary').value = '0';
  4394. // [v3.4 task #3] 三盘资产分流 · 流动 / 自住房产 / 其他投资
  4395. // · LIQUID:cash / 公开市场股权 / liquidity=high
  4396. // · PRIMARY_RES:real_estate 且 (subcategory=primary_residence / self_occupied / 名称含"自住"|"自用")
  4397. // · INVEST:其他所有非保险/非现金的(real_estate 投资盘 / private_equity / equity_overseas / trust / overseas_allocation 等)
  4398. const LIQUID_CATS = ['cash'];
  4399. const LIQUID_SUBCATS = ['listed_a_share','us_listed_blue_chip','us_listed_etf','us_listed_tech','hk_listed','cash_money_market','cash_overseas_usd'];
  4400. // 自住房产标识(subcategory 或名称关键词命中即归为 primaryResidence)
  4401. const PRIMARY_RES_SUBCATS = ['primary_residence','self_occupied','principal_residence','main_home'];
  4402. const PRIMARY_RES_NAME_KEYWORDS = ['自住', '自用', '主居', '住宅(自', '本人居住', 'primary residence'];
  4403. // 不计入任何盘的(纯保险类资产,已在 policies 中)
  4404. const SKIP_CATS = ['insurance', 'overseas_insurance'];
  4405. // 货币换算
  4406. function toCnyWan(asset) {
  4407. const cents = asset.value_cents || 0;
  4408. if (asset.currency === 'CNY') return cents / 100 / 10000;
  4409. if (asset.currency === 'USD') return cents / 100 * 7 / 10000;
  4410. if (asset.currency === 'HKD') return cents / 100 * 0.9 / 10000;
  4411. if (asset.currency === 'SGD') return cents / 100 * 5.2 / 10000;
  4412. return cents / 100 / 10000;
  4413. }
  4414. let liquid = 0, primaryResidence = 0, investAssets = 0;
  4415. (pt.assets || []).forEach(a => {
  4416. if (SKIP_CATS.indexOf(a.category) >= 0) return;
  4417. const cnyWan = toCnyWan(a);
  4418. if (cnyWan <= 0) return;
  4419. // 1) 流动资产
  4420. const isLiquid = LIQUID_CATS.indexOf(a.category) >= 0 ||
  4421. LIQUID_SUBCATS.indexOf(a.subcategory) >= 0 ||
  4422. (a.liquidity === 'high');
  4423. if (isLiquid) {
  4424. liquid += cnyWan;
  4425. return;
  4426. }
  4427. // 2) 自住房产(real_estate 类别 + 自住识别)
  4428. if (a.category === 'real_estate') {
  4429. const isPrimary = PRIMARY_RES_SUBCATS.indexOf(a.subcategory) >= 0 ||
  4430. PRIMARY_RES_NAME_KEYWORDS.some(kw => (a.name || '').indexOf(kw) >= 0);
  4431. if (isPrimary) {
  4432. primaryResidence += cnyWan;
  4433. } else {
  4434. // 投资性房产 → 其他投资盘
  4435. investAssets += cnyWan;
  4436. }
  4437. return;
  4438. }
  4439. // 3) 其余非现金资产(私募 / 信托 / 跨境 / 海外配置 / 商业股权 等)→ 其他投资盘
  4440. investAssets += cnyWan;
  4441. });
  4442. document.getElementById('liquidAssets').value = Math.round(liquid);
  4443. const primaryResEl = document.getElementById('primaryResidence');
  4444. if (primaryResEl) primaryResEl.value = Math.round(primaryResidence);
  4445. const investAssetsEl = document.getElementById('investAssets');
  4446. if (investAssetsEl) investAssetsEl.value = Math.round(investAssets);
  4447. // 房贷 + 其他负债 (portrait 一般没有负债字段,默认 0)
  4448. // 如果未来 portrait 加 liabilities 数组,这里读取
  4449. document.getElementById('mortgage').value = '0';
  4450. document.getElementById('otherDebt').value = '0';
  4451. // === 现有保单(v3.1 · 7 险种细分:term_life → 定期寿险 / whole_life+iul+vul+ppli → 终身寿险)===
  4452. let existingTermLife = 0, existingWholeLife = 0, existingCI = 0, hasIntlMed = 0, existingEduIns = 0, existingAccident = 0;
  4453. (pt.policies || []).forEach(p => {
  4454. const cents = p.face_amount_cents || 0;
  4455. let cnyWan = 0;
  4456. if (p.currency === 'USD') cnyWan = cents / 100 * 7 / 10000;
  4457. else if (p.currency === 'HKD') cnyWan = cents / 100 * 0.9 / 10000;
  4458. else cnyWan = cents / 100 / 10000;
  4459. const pt2 = (p.product_type || '').toLowerCase();
  4460. if (['whole_life','iul','vul','ppli'].indexOf(pt2) >= 0) {
  4461. existingWholeLife += cnyWan; // v3.1 · 终身寿险类
  4462. } else if (pt2 === 'term_life' || pt2 === 'term') {
  4463. existingTermLife += cnyWan; // v3.1 · 定期寿险类
  4464. } else if (pt2 === 'critical_illness' || pt2 === 'ci') {
  4465. existingCI += cnyWan;
  4466. } else if (pt2 === 'international_health' || pt2 === 'health' || pt2 === 'medical') {
  4467. hasIntlMed = 1;
  4468. } else if (pt2 === 'education' || pt2 === 'endowment_education') {
  4469. existingEduIns += cnyWan;
  4470. } else if (pt2 === 'accident' || pt2 === 'pa') {
  4471. existingAccident += cnyWan;
  4472. }
  4473. });
  4474. document.getElementById('existingLife').value = Math.round(existingTermLife);
  4475. document.getElementById('existingWholeLife').value = Math.round(existingWholeLife);
  4476. document.getElementById('existingAccident').value = Math.round(existingAccident);
  4477. document.getElementById('existingCI').value = Math.round(existingCI);
  4478. document.getElementById('existingMed').value = String(hasIntlMed);
  4479. document.getElementById('existingRetirement').value = '0'; // portrait 没有专项养老
  4480. // [v3.4] existingEdu 字段已删除(与流动资产重复),只保留 existingEduInsurance
  4481. document.getElementById('existingEduInsurance').value = Math.round(existingEduIns);
  4482. // [v3.4 task #3] 三盘已在上方分流过(liquid / primaryResidence / investAssets),此处无需重置
  4483. // === 退休年龄 (从 scenarios.params.retirement_age 读) ===
  4484. if (pt.scenarios && pt.scenarios.length) {
  4485. const baseline = pt.scenarios.find(s => s.is_baseline) || pt.scenarios[0];
  4486. if (baseline && baseline.params && baseline.params.retirement_age) {
  4487. document.getElementById('retireAge').value = baseline.params.retirement_age;
  4488. }
  4489. if (baseline && baseline.params && baseline.params.projection_end_age) {
  4490. document.getElementById('lifeExpectancy').value = baseline.params.projection_end_age;
  4491. }
  4492. }
  4493. // 显示 ctx-bar meta
  4494. const aumYi = liquid / 10000;
  4495. let metaParts = [];
  4496. if (annualExpenseCny > 0) metaParts.push('年薪估 ¥' + Math.round(annualExpenseCny / 0.5 / 10000) + '万');
  4497. metaParts.push('流动资产 ¥' + Math.round(liquid) + '万');
  4498. if (directChildren.length) metaParts.push(directChildren.length + ' 子女');
  4499. document.getElementById('ctxMeta').textContent = metaParts.join(' · ');
  4500. }
  4501. /* === 主计算函数 === */
  4502. function calculate() {
  4503. // 收集输入
  4504. const surname = (document.getElementById('surname').value || '').trim() || '客户';
  4505. const age = parseInt(document.getElementById('age').value);
  4506. const gender = document.getElementById('gender').value;
  4507. const childCount = parseInt(document.getElementById('childCount').value);
  4508. const childAges = [];
  4509. for (let i = 1; i <= 3; i++) {
  4510. if (i <= childCount) {
  4511. const v = parseInt(document.getElementById('childAge'+i).value);
  4512. if (!isNaN(v)) childAges.push(v);
  4513. }
  4514. }
  4515. const eduPath = document.getElementById('eduPath').value;
  4516. const salary = parseFloat(document.getElementById('salary').value) || 0;
  4517. const spouseSalary = parseFloat(document.getElementById('spouseSalary').value) || 0;
  4518. const mortgage = parseFloat(document.getElementById('mortgage').value) || 0;
  4519. const otherDebt = parseFloat(document.getElementById('otherDebt').value) || 0;
  4520. const liquid = parseFloat(document.getElementById('liquidAssets').value) || 0;
  4521. // [v3.4] 自住房产 + 其他投资资产 · 用于总财富画像 + HNW 触发,**不参与寿险 DIM A 项**
  4522. const primaryResidence = (function(){ const el = document.getElementById('primaryResidence'); return el ? (parseFloat(el.value) || 0) : 0; })();
  4523. const investAssets = (function(){ const el = document.getElementById('investAssets'); return el ? (parseFloat(el.value) || 0) : 0; })();
  4524. // [v4.2] 境外资产 · 境外寿险按实际境外资产分配 + 未来计划 toggle 估算
  4525. // [v4.4.3] 单位改为万美金 · 内部按 1 USD = 7 CNY 换算成万人民币(对齐其他资产口径)
  4526. const FX_USD_CNY = 7;
  4527. const overseasAssetsUSD = (function(){ const el = document.getElementById('overseasAssets'); return el ? (parseFloat(el.value) || 0) : 0; })();
  4528. const overseasAssetsRaw = overseasAssetsUSD * FX_USD_CNY; // 万美金 → 万人民币
  4529. const overseasFuturePlan = (function(){ const el = document.getElementById('overseasFuturePlan'); return el ? !!el.checked : false; })();
  4530. // UI 显示等价人民币
  4531. (function(){
  4532. const hint = document.getElementById('overseasAssetsCnyHint');
  4533. if (hint) {
  4534. const cny = overseasAssetsRaw;
  4535. hint.textContent = '≈ ¥' + (cny >= 10000 ? (cny/10000).toFixed(2) + '亿' : cny.toFixed(0) + '万');
  4536. }
  4537. })();
  4538. const existingLife = parseFloat(document.getElementById('existingLife').value) || 0;
  4539. const existingCI = parseFloat(document.getElementById('existingCI').value) || 0;
  4540. const existingMed = parseInt(document.getElementById('existingMed').value);
  4541. const existingRetirement = parseFloat(document.getElementById('existingRetirement').value) || 0;
  4542. // [v3.4] existingEdu 字段已删除(与 liquidAssets 重复),硬编 0
  4543. const existingEdu = 0;
  4544. const existingEduInsurance = parseFloat(document.getElementById('existingEduInsurance').value) || 0;
  4545. // v3.1 · 新增意外险 + 终身寿险输入读取
  4546. const existingAccident = parseFloat(document.getElementById('existingAccident').value) || 0;
  4547. const existingWholeLife = parseFloat(document.getElementById('existingWholeLife').value) || 0;
  4548. const retireAge = parseInt(document.getElementById('retireAge').value) || 60;
  4549. const lifeExpectancy = parseInt(document.getElementById('lifeExpectancy').value) || 90;
  4550. // [v2.8] 新增可选参数
  4551. const retireLifestyleRatio = parseFloat(document.getElementById('retireLifestyleRatio').value) || 0.70;
  4552. const incomeDiscountRate = parseFloat(document.getElementById('incomeDiscountRate').value) || 0;
  4553. const affordabilityCap = parseFloat(document.getElementById('affordabilityCap').value) || 0.20;
  4554. // [v2.9] 重疾倍数可调
  4555. const ciMultiplier = parseFloat(document.getElementById('ciMultiplier').value) || 3;
  4556. if (!age || age < 18 || age > 80) { alert('请填写主理人年龄(18-80)'); return; }
  4557. if (!salary) { alert('请填写主理人年薪'); return; }
  4558. // [v3.6] 意外险计算挪到 totalWealth 之后(在 isHNW 判定之前) — 见下方 §accidentNeed
  4559. // ===== 1. 重疾(年收入 × N · v2.9 倍数可调) =====
  4560. const ciNeed = salary * ciMultiplier; // 万
  4561. const ciGap = Math.max(0, ciNeed - existingCI);
  4562. const ciPremiumRate = lookupPremium(PREMIUM_TABLE.ci, age, gender);
  4563. // [v4.7+ 缴费年限智能化] 重疾默认 20 年缴清,准退休客户(retireAge-age < 20)需缩短并按比例放大年缴
  4564. // 公式:总成本中性假设 — 年缴 × 缴费年限 ≈ 常数,缩短缴费窗口 → 年缴反比例上升
  4565. // 反方:实际精算因短缴期"客户活到缴清概率高 + 资金沉淀快"会比线性低 5-10%,作为估算可接受
  4566. const _yearsToRetireForPremium = Math.max(0, retireAge - age);
  4567. const ciPayYears = Math.min(20, Math.max(5, _yearsToRetireForPremium > 0 ? _yearsToRetireForPremium + 5 : 20));
  4568. const ciPremium = (ciNeed * ciPremiumRate) * (20 / ciPayYears); // 元
  4569. // ===== 2. 高端医疗(800 万固定) =====
  4570. const medNeed = 800; // 万
  4571. const medGap = existingMed === 1 ? 0 : medNeed;
  4572. const medPremium = lookupPremium(PREMIUM_TABLE.medical, age); // 元
  4573. // ===== 3. 寿险(DIME + HNW 双轨) =====
  4574. // [HNW 升级 v2026-06-12] 检测高净值客户,启用双轨公式
  4575. // [v2.8 修复] (a) 教育金从 DIME 中剥离(已由独立教育金险覆盖,寿险不重复计入)
  4576. // (b) I 项加未来收入折现,把 25 年后的工资按现值折回
  4577. const D = mortgage + otherDebt; // 万
  4578. const yearsToRetire = Math.max(0, retireAge - age);
  4579. const totalFamilyIncome = salary + spouseSalary;
  4580. const principalShare = totalFamilyIncome > 0 ? salary / totalFamilyIncome : 1;
  4581. const incomeReplaceRate = Math.max(0.3, principalShare);
  4582. // [v2.8] 折现因子 PV = salary × principalShare × annuityPV(N, r)
  4583. // annuityPV = (1 - (1+r)^-N) / r · 当 r=0 时退化为 N(简单累加)
  4584. const I_undiscounted = salary * yearsToRetire * incomeReplaceRate; // 万 (旧 v2.7 算法)
  4585. let annuityPVFactor;
  4586. if (incomeDiscountRate > 0 && yearsToRetire > 0) {
  4587. annuityPVFactor = (1 - Math.pow(1 + incomeDiscountRate, -yearsToRetire)) / incomeDiscountRate;
  4588. } else {
  4589. annuityPVFactor = yearsToRetire; // 不折现退化
  4590. }
  4591. const I = salary * incomeReplaceRate * annuityPVFactor; // 万,折现后现值
  4592. const eduUnit = EDU_PATH_COST[eduPath] || 600;
  4593. // [v4.0 升级 · Jack 2026-06-15 立法] 教育金改用 PV 现值(去掉 1.05^N 通胀终值)
  4594. // 旧 v3.6:eduUnit × (1.05)^(18-子女年龄) → 子女年龄越小数字越虚高(20 年后名义金额)
  4595. // 新 v4.0:直接 eduUnit(假设教育成本通胀 = 折现率,PV 退化为今天购买力)
  4596. // 理由:客户感知"今天该准备多少钱"比"未来名义总额"更诚信,避免数字虚高
  4597. let totalEduPV = 0;
  4598. let eduCalcDetail = [];
  4599. childAges.forEach((cAge, idx) => {
  4600. const eduPV = eduUnit; // PV 现值(假设通胀 = 折现率)
  4601. totalEduPV += eduPV;
  4602. eduCalcDetail.push(`子${idx+1}(${cAge}岁) ${eduUnit}万 PV(教育通胀 = 折现率,现值)`);
  4603. });
  4604. // 兼容老变量名 totalEduWithInflation(下游引用未改)
  4605. const totalEduWithInflation = totalEduPV;
  4606. const E = Math.max(0, totalEduWithInflation - existingEduInsurance);
  4607. const A = liquid;
  4608. // [v2.8 关键修复] DIME → DIM,去掉教育金 E,避免与独立教育金险重复计入
  4609. const dimeNeed = Math.max(0, D + I - A); // 寿险纯做"债务+收入替代",教育金交给独立险种
  4610. // === HNW 触发逻辑 ===
  4611. // 检测高净值客户:AUM ≥ 5 亿(50000 万)/ 美籍 / 多子女(≥3) / 多婚 + 未成年
  4612. // 由于工具是独立填表,我们用以下信号(均可读自 portrait):
  4613. // - 流动资产 ≥ 5000 (5 亿) → HNW
  4614. // - 子女数 ≥ 3 → HNW
  4615. // 美籍/多婚由 portrait.members 判断,这里用流动资产作为代理指标
  4616. // [v3.4] HNW 触发:总财富(流动+自住+投资) ≥ 5000 万 触发,而非仅 liquid
  4617. // [v3.6] 加第 4 盘"保险现金价值"= 重疾×0.5 + 终身寿×1.0 + 教育金×1.0 + 养老储备×1.0
  4618. // 理由(Jack 2026-06-15 立法):承延高端客户重疾默认储蓄型(增额终身寿+重疾责任 / 港险储蓄型),
  4619. // 不是消费型 — 保单缴费期累积现金价值,应计入家族资产
  4620. const insuranceCashValue =
  4621. existingCI * 0.5 // 储蓄型重疾(中段缴费期约保额 50%)
  4622. + existingWholeLife * 1.0 // 终身寿险(现金价值 ≈ 保额)
  4623. + existingEduInsurance * 1.0 // 教育金险(分红/年金型)
  4624. + existingRetirement * 1.0; // 养老储备(年金型)
  4625. const totalWealth = liquid + primaryResidence + investAssets + insuranceCashValue;
  4626. const isHNW = totalWealth >= 5000 || childCount >= 3;
  4627. // [v3.6] 注:意外险/终身寿险的 need 项在下方 v3.0 段落统一算(accNeed/wlNeed),不在这里重复
  4628. // 用 portrait 完整数据计算 HNW 资产(若有)
  4629. // [Bug fix v2026-06-12 +1] 选了 persona / 用户重置(ctx-bar 隐藏) → 跳过 portrait
  4630. // 只有 ctx-bar 仍 active(真客户上下文)且没选 persona,才读 portrait
  4631. const personaActive = sessionStorage.getItem('cy_persona_id');
  4632. const ctxBarActive = document.getElementById('ctxBar') && document.getElementById('ctxBar').classList.contains('active');
  4633. let portraitTotalAum = 0;
  4634. let portraitNonCashAssets = [];
  4635. let hasUSPerson = false;
  4636. if (!personaActive && ctxBarActive) {
  4637. try {
  4638. const pt = JSON.parse(localStorage.getItem('cy_current_portrait') || 'null');
  4639. if (pt && pt.assets) {
  4640. pt.assets.forEach(a => {
  4641. const cents = a.value_cents || 0;
  4642. let cnyWan = 0;
  4643. if (a.currency === 'CNY') cnyWan = cents / 100 / 10000;
  4644. else if (a.currency === 'USD') cnyWan = cents / 100 * 7 / 10000;
  4645. else if (a.currency === 'HKD') cnyWan = cents / 100 * 0.9 / 10000;
  4646. else cnyWan = cents / 100 / 10000;
  4647. portraitTotalAum += cnyWan;
  4648. // 非现金资产(可装入 PPLI)
  4649. if (['equity_domestic','equity_overseas','real_estate','private_equity','trust'].indexOf(a.category) >= 0) {
  4650. portraitNonCashAssets.push({
  4651. name: a.name || '(未命名)',
  4652. category: a.category,
  4653. cnyWan: Math.round(cnyWan)
  4654. });
  4655. }
  4656. });
  4657. }
  4658. if (pt && pt.members) {
  4659. hasUSPerson = pt.members.some(m => m.is_us_person);
  4660. }
  4661. } catch(e) {}
  4662. }
  4663. // [v2.9 完善] 如果选了 persona 且 persona 自带 aumWan(HNW 画像),用它做 portraitTotalAum
  4664. // 这样 v2.9 的"AUM 当支付能力分母"逻辑在 demo 时能完整生效
  4665. if (sessionStorage.getItem('cy_persona_id') && portraitTotalAum === 0) {
  4666. const personaAum = parseFloat(sessionStorage.getItem('cy_persona_aum_wan') || '0');
  4667. if (personaAum > 0) portraitTotalAum = personaAum;
  4668. }
  4669. // 确定最终 HNW 状态
  4670. // [Phase 4] persona forceHNW 也触发(用于跨境美籍 / 非 AUM 触发的 HNW)
  4671. const personaForceHNW = sessionStorage.getItem('cy_persona_force_hnw') === '1';
  4672. const isHNWFinal = isHNW || portraitTotalAum >= 50000 || hasUSPerson || personaForceHNW;
  4673. // === HNW 双轨计算 ===
  4674. let domesticNeed = 0; // 境内寿险
  4675. let overseasNeed = 0; // 境外 PPLI/VUL
  4676. let lifeNeed = dimeNeed;
  4677. let ppliBreakdown = [];
  4678. if (isHNWFinal) {
  4679. // [v3.6 修订] 定期寿险公式 = HNW 流动性桥梁(不再用 AUM 大比例)
  4680. // 旧逻辑(我之前):主理人 = AUM × 50%,导致 ¥8000 万 AUM 客户配 ¥7500 万定期寿险(过高,
  4681. // 违反"定期寿险 = 收入替代 + 债务覆盖"语义)
  4682. // 新逻辑:工作期主理人 = salary × 5(过渡 5 年)+ 房贷 + 其他负债,上限 totalWealth × 30%
  4683. // 理由:HNW 客户资产已够覆盖收入替代,定期寿险只需要"主理人意外身故 5 年家庭过渡现金流"
  4684. // + 监管/核保上限保护 ¥3-5 亿/单人(64 岁以下)
  4685. const yearsToRetire = Math.max(0, retireAge - age);
  4686. const incomeReplacement = yearsToRetire > 0 ? salary * 5 : 0; // 5 年过渡(已退休则 0)
  4687. const debtCoverage = mortgage + otherDebt;
  4688. const baseLifeRaw = incomeReplacement + debtCoverage;
  4689. const aumLifeCap = Math.round(totalWealth * 0.30); // 上限 = 总财富 × 30%(HNW 流动性补充上限)
  4690. const ageCap = age < 65 ? 50000 : (age < 70 ? 30000 : 10000); // 监管 / 核保上限
  4691. const principalDomestic = Math.min(baseLifeRaw, aumLifeCap, ageCap);
  4692. // 配偶补充:主理人 50%(分散投保 / 同样限上限)
  4693. const spouseDomestic = Math.round(principalDomestic * 0.5);
  4694. domesticNeed = principalDomestic + spouseDomestic;
  4695. // 境外 PPLI: 装入非现金资产 30-50%
  4696. // 杉杉 / 陈氏等通过 portrait 实读
  4697. const aumForPPLI = portraitTotalAum > 0 ? portraitTotalAum : (liquid * 5); // fallback
  4698. const PPLI_RATIOS = {
  4699. 'cash': { ratio: 1.0, label: '流动金融(现金/股票)', priority: 1 },
  4700. 'equity_overseas': { ratio: 1.0, label: '境外股权', priority: 2 },
  4701. 'private_equity': { ratio: 0.5, label: '私募股权', priority: 3 },
  4702. 'equity_domestic': { ratio: 0.3, label: '境内股权(SPV 剥离 30%)', priority: 4 },
  4703. 'real_estate': { ratio: 0.3, label: '不动产(SPV 持有 30%)', priority: 5 },
  4704. 'trust': { ratio: 0.5, label: '现有信托资产', priority: 6 }
  4705. };
  4706. if (portraitNonCashAssets.length) {
  4707. // 用 portrait 真实数据
  4708. const grouped = {};
  4709. portraitNonCashAssets.forEach(a => {
  4710. if (!grouped[a.category]) grouped[a.category] = 0;
  4711. grouped[a.category] += a.cnyWan;
  4712. });
  4713. Object.keys(grouped).forEach(cat => {
  4714. const cfg = PPLI_RATIOS[cat] || { ratio: 0.3, label: cat, priority: 9 };
  4715. const injectWan = Math.round(grouped[cat] * cfg.ratio);
  4716. if (injectWan > 0) {
  4717. ppliBreakdown.push({
  4718. label: cfg.label,
  4719. ratio: cfg.ratio,
  4720. injectWan,
  4721. priority: cfg.priority
  4722. });
  4723. }
  4724. });
  4725. ppliBreakdown.sort((a,b) => a.priority - b.priority);
  4726. overseasNeed = ppliBreakdown.reduce((s,b) => s + b.injectWan, 0);
  4727. } else {
  4728. // [v3.6 修复] 没 portrait 时,境外 PPLI 比例从 0.3 → 0.2(更保守),并加 AUM × 0.5 上限
  4729. const overseasRaw = Math.round(liquid * 0.5 + aumForPPLI * 0.2);
  4730. overseasNeed = overseasRaw;
  4731. ppliBreakdown.push({
  4732. label: '现金 + 流动金融(估算装入,AUM × 0.2)',
  4733. ratio: 0.2,
  4734. injectWan: overseasNeed,
  4735. priority: 1
  4736. });
  4737. }
  4738. // 美籍二代:加 40% 遗产税敞口
  4739. if (hasUSPerson) {
  4740. const usExposure = Math.round(aumForPPLI * 0.5 * 0.4); // 50% 资产 × 40% 税率
  4741. if (usExposure > 0) {
  4742. ppliBreakdown.push({
  4743. label: '🚨 美籍二代遗产税隔离',
  4744. ratio: 0.4,
  4745. injectWan: usExposure,
  4746. priority: 0
  4747. });
  4748. ppliBreakdown.sort((a,b) => a.priority - b.priority);
  4749. overseasNeed += usExposure;
  4750. }
  4751. }
  4752. // [v3.6 修复] 境外 PPLI 总额上限 = AUM × 0.5(避免对小 AUM 家族算出 PPLI > AUM × 60% 不合理)
  4753. const overseasCap = Math.round(aumForPPLI * 0.5);
  4754. if (overseasNeed > overseasCap) {
  4755. // 标记被 cap 的部分
  4756. ppliBreakdown.push({
  4757. label: '⚠ 总额已被 AUM × 50% 上限截断',
  4758. ratio: 0,
  4759. injectWan: -(overseasNeed - overseasCap),
  4760. priority: 99
  4761. });
  4762. overseasNeed = overseasCap;
  4763. }
  4764. // [v3.6 修订] HNW 模式下:lifeNeed = 境内寿险(中端 · "寿险卡"展示)
  4765. // 终身寿险 wlNeed = 境外 PPLI(高端 · "终身寿险卡"展示)— 在 line ~3329 处赋值
  4766. // 这样避免 PPLI 在两个卡片重复计算,也避免 totalCoverage7 = totalCoverage + wlNeed 双重计入
  4767. lifeNeed = domesticNeed;
  4768. }
  4769. let lifeGap = Math.max(0, lifeNeed - existingLife);
  4770. const lifePremiumRate = lookupPremium(PREMIUM_TABLE.life, age, gender);
  4771. // [v4.7+ 缴费年限智能化] 定期寿险默认 30 年缴清,准退休客户缩到 max(5, yearsToRetire+5)
  4772. const lifePayYears = Math.min(30, Math.max(5, yearsToRetire > 0 ? yearsToRetire + 5 : 30));
  4773. let lifePremium = (lifeNeed * lifePremiumRate) * (30 / lifePayYears);
  4774. // ===== 4. 养老金 =====
  4775. // [v4.0 升级 · Jack 2026-06-15 立法] 改用 PV 年金现值因子(避免名义金额虚高)
  4776. // 旧 v3.6 FV factor = ((1+r)^N - 1) / r · 给出未来 N 年累积名义金额(数字大但通胀稀释)
  4777. // 新 v4.0 PV factor = (1 - (1+r)^-N) / r · 给出今天的购买力下,30 年总缺口的现值
  4778. // 通胀率 = 折现率 = 3% 时,PV factor < FV factor,数字更接近"今天该准备多少钱"
  4779. const retireMonthlyExp = salary * retireLifestyleRatio / 12; // 万/月
  4780. const socialPension = 1.2; // 万/月,默认一线
  4781. const monthlyGap = Math.max(0, retireMonthlyExp - socialPension);
  4782. const retireYears = Math.max(0, lifeExpectancy - retireAge);
  4783. const inflationRate = 0.03;
  4784. // PV 年金现值因子(v4.0 替换 FV)
  4785. const annuityFactor = retireYears > 0
  4786. ? (1 - Math.pow(1 + inflationRate, -retireYears)) / inflationRate
  4787. : 0;
  4788. const retireNeed = monthlyGap * 12 * annuityFactor; // 万 · PV 现值(at retirement t=N)
  4789. const retireGap = Math.max(0, retireNeed - existingRetirement);
  4790. const savingYears = Math.max(1, yearsToRetire);
  4791. // [v4.7+ Jack 2026-06-21 立法] 替换原 ×0.65 魔术系数 → 精算 FV 年金未来值因子
  4792. // 精算等价:X × FV_annuity_factor_N(IRR) = retireGap (退休时所需购买力)
  4793. // 其中 FV_annuity_factor = ((1+IRR)^N - 1) / IRR(年末缴费 · 复利累积)
  4794. // IRR = inflationRate = 3%(假设保险公司投资收益率与通胀对冲)
  4795. // 旧公式 0.65/N 在 N=20 时近似(误差 -13%),N=5 时严重低估 -31%(银发族痛点)
  4796. // 新公式动态联动 retireYears + inflationRate,且明确"年金险杠杆"语义
  4797. // 反方:实际产品因运营成本 + 利润 margin 比纯精算高 5-10%,本工具暂不加成,留代理人现场报价空间
  4798. const _retireFvFactor = inflationRate > 0
  4799. ? (Math.pow(1 + inflationRate, savingYears) - 1) / inflationRate
  4800. : savingYears;
  4801. const retirePremium = (retireGap / _retireFvFactor) * 10000; // 元
  4802. // ===== 5. 教育金险(独立) =====
  4803. // 教育金险需求 = 总教育金 - 已储备 - 已配教育金险(避免重复)
  4804. const eduNeed = totalEduWithInflation;
  4805. const eduCoveredByInsurance = existingEduInsurance;
  4806. const eduGap = Math.max(0, eduNeed - existingEdu - eduCoveredByInsurance);
  4807. // [v4.7+ Jack 2026-06-21 立法] 教育金精算公式
  4808. // 旧:(eduGap / 10) × 0.85 — 10 年缴清硬编码 + 0.85 魔术系数
  4809. // 新:与子女年龄联动 + FV 精算
  4810. // eduPremiumYears = max(5, min(15, 18 - 最小子女年龄))(已有同源逻辑)
  4811. // IRR = 3%(教育金险产品保守假设)· 反方:实际教育金险产品 IRR 4-5%,本工具用 3% 保守估算
  4812. const eduIRR = 0.03;
  4813. const eduPremiumYears = (function() {
  4814. if (!Array.isArray(childAges) || childAges.length === 0) return 10; // 无子女兜底(其实 eduGap=0 也不会用)
  4815. const youngest = Math.min.apply(null, childAges);
  4816. return Math.max(5, Math.min(15, 18 - youngest));
  4817. })();
  4818. const _eduFvFactor = eduIRR > 0
  4819. ? (Math.pow(1 + eduIRR, eduPremiumYears) - 1) / eduIRR
  4820. : eduPremiumYears;
  4821. const eduPremium = (eduGap / _eduFvFactor) * 10000; // 元
  4822. // ===== 总计 =====
  4823. // [v3.6 修订] totalCoverage 5 项 = 老的 5 险种合计;意外/终身寿在下方 v3.0 段独立加(accNeed/wlNeed)
  4824. // 最终对外显示是 totalCoverage7 = totalCoverage + accNeed + wlNeed (line ~3342)
  4825. const totalCoverage = ciNeed + medNeed + lifeNeed + retireNeed + eduNeed;
  4826. const totalGap = ciGap + medGap + lifeGap + retireGap + eduGap;
  4827. const totalPremium = ciPremium + medPremium + lifePremium + retirePremium + eduPremium;
  4828. const leverage = totalPremium > 0 ? (totalCoverage * 10000 / totalPremium) : 0;
  4829. // ===== [v3.6] 渲染 7 险种计算依据展开块 =====
  4830. // 把所有上下文打包传给 renderFormulaPanel
  4831. // [v3.6 修订] 用 v3.0 段定义的 accNeed/wlNeed(在 line 3315/3329),不用我之前重复定义的 accidentNeed
  4832. // 注:此处 ctx 写"占位",实际 accNeed/wlNeed 在 v3.0 段算完后,会重写 ctx + 重新调 renderFormulaPanel
  4833. const _eduPathLabels = { 'domestic':'国内本科 ¥100万','domestic_plus':'国内+海外硕士 ¥250万','full_overseas':'全程英美 ¥600万','elite_us':'美高+美本+美研 ¥1000万' };
  4834. const _aumForLifeRender = portraitTotalAum > 0 ? portraitTotalAum : (totalWealth > 0 ? totalWealth : (liquid * 5));
  4835. // [v3.6] 注:这里先不调用 renderFormulaPanel,等 v3.0 段算完 accNeed/wlNeed 再调(line ~3349)
  4836. // ===== 渲染 =====
  4837. // Cover
  4838. document.getElementById('rcTitle').textContent = surname + (gender === 'M' ? '先生' : '女士') + '(' + age + '岁) · 保险配置诊断';
  4839. document.getElementById('rcSubtitle').textContent =
  4840. `年薪 ¥${salary}万 · ${childCount} 个子女 · ${retireAge} 岁退休 · 替代率 ${(retireLifestyleRatio*100).toFixed(0)}% · 折现 ${(incomeDiscountRate*100).toFixed(0)}% · v2.8 DIM 去重 + 支付能力约束`;
  4841. document.getElementById('totalCoverage').textContent = fmtWan(totalCoverage);
  4842. document.getElementById('totalGap').textContent = fmtWan(totalGap);
  4843. document.getElementById('totalPremium').textContent = '¥' + (totalPremium/10000).toFixed(1) + '万';
  4844. document.getElementById('leverage').textContent = leverage.toFixed(1) + ' 倍';
  4845. // ===== [模块打通 Phase 1 · 2026-07-18] 写客户上下文总线 =====
  4846. // IC 算完保额缺口 → patch 到 cy_client_session,供 CRS / 信托 / 身份规划读取。
  4847. // 容错:总线未加载(独立分发/旧缓存)时静默跳过,不影响 IC 本身。
  4848. try {
  4849. if (window.CYClientContext) {
  4850. var _icPersona = '';
  4851. try { _icPersona = sessionStorage.getItem('cy_persona_id') || ''; } catch (e) {}
  4852. var _icCid = window.CYClientContext.get('clientId') || _icPersona || window.CYClientContext.get('portrait') || '';
  4853. window.CYClientContext.patch({
  4854. surname: surname,
  4855. clientId: _icCid, // 供 ActionHub 一致性校验
  4856. portrait: _icPersona || window.CYClientContext.get('portrait') || '',
  4857. insurance: {
  4858. clientId: _icCid,
  4859. gap: Math.round(totalGap * 10000), // 万 → 元
  4860. coverage: Math.round(totalCoverage * 10000),
  4861. premium: Math.round(totalPremium), // 元
  4862. tier: isHNWFinal ? 'hnw' : 'std',
  4863. totalWealthWan: Math.round(totalWealth),
  4864. summary: '保额缺口 ¥' + Math.round(totalGap) + '万',
  4865. measuredAt: Date.now(), // ActionHub 工具驱动点亮依据
  4866. source: 'InsuranceCalculator_v5.0'
  4867. }
  4868. });
  4869. }
  4870. } catch (e) { console.warn('[IC] CYClientContext patch skipped', e); }
  4871. // ════════════════════════════════════════════════════════════════
  4872. // [v4.2 重构] 终身寿险公式段提前到 UI 渲染之前(避免 ReferenceError TDZ)
  4873. // ════════════════════════════════════════════════════════════════
  4874. // v4.2 四大改动(对比 v4.0):
  4875. // A · 境内/境外按客户实际资产分布(不是整体 AUM × 比例)
  4876. // - 境内增额终身寿 = 境内资产 × 30-50%(主+配合计)
  4877. // - 境外 IUL/VUL/PPLI = 境外资产 × 30%/50%(普通/跨境美籍)
  4878. // B · 境内增额终身寿用 max(salary×10, AUM×20%) 拉下限,确保 UHNW 合计 ≥ 30% 境内
  4879. // C · PPLI 装入资产 × 1.0(去掉 ×1.05 corridor,离岸 PPLI 不受 §7702 约束)
  4880. // D · 一次性赔付 ≤ AUM 铁律 + 优先级缩减(境外→境内→定寿→基础三层永不缩减)
  4881. //
  4882. // PPLI 门槛 $2000 万美金不变(v4.0 立法保留)
  4883. const totalAumForWL = portraitTotalAum > 0 ? portraitTotalAum : (totalWealth > 0 ? totalWealth : liquid * 5);
  4884. const aumUSD = totalAumForWL / 7;
  4885. const PPLI_THRESHOLD_USD = 2000;
  4886. const enablePPLI = aumUSD >= PPLI_THRESHOLD_USD;
  4887. // [v4.2] 境内/境外资产分离(核心改动 A)
  4888. // overseasAssetsEffective = 实际境外资产 + (toggle 勾选 ? AUM × 30% : 0)
  4889. const overseasAssetsEffective = overseasAssetsRaw + (overseasFuturePlan ? Math.round(totalAumForWL * 0.30) : 0);
  4890. const domesticAssets = Math.max(0, totalAumForWL - overseasAssetsEffective);
  4891. // 杠杆倍数(Benchmark middle-funded · 国际惯例 max-funded 取下限)
  4892. const ageMultiplier =
  4893. age <= 45 ? 80 :
  4894. age <= 55 ? 40 :
  4895. age <= 65 ? 20 : 10;
  4896. let wlDomestic = 0;
  4897. let wlOverseasIUL = 0;
  4898. let wlOverseasPPLI = 0;
  4899. let ppliInjectable = 0;
  4900. let annualPremiumIULWan = 0;
  4901. let wlOverseasTier = '';
  4902. let wlOverseasMethod = '';
  4903. if (isHNWFinal) {
  4904. // === 境内增额终身寿 (主理人 + 配偶) · v4.3 优化 ===
  4905. // 主理人下限 = max(salary × 10, 境内资产 × 30%)
  4906. // 主理人上限 = ageCap(5亿/3亿/1亿,监管不可越)
  4907. // [v4.3 优化 ①] 配偶比例 = min(0.5, spouseSalary/salary),无收入则 0
  4908. // 避免"配偶无收入仍配 50%"的虚假需求
  4909. // [v4.3 优化 ②] 合计上限 = 境内资产 × 50%(防止 max 公式过激)
  4910. const ageCapWL = age < 65 ? 50000 : (age < 70 ? 30000 : 10000);
  4911. const wlPrincipal_lower = Math.max(salary * 10, Math.round(domesticAssets * 0.30));
  4912. let wlPrincipal = Math.min(wlPrincipal_lower, ageCapWL);
  4913. // 配偶比例(按收入比例,无收入则 0)
  4914. const spouseRatio = (spouseSalary > 0 && salary > 0)
  4915. ? Math.min(0.5, spouseSalary / salary)
  4916. : 0;
  4917. let wlSpouse = Math.round(wlPrincipal * spouseRatio);
  4918. wlDomestic = wlPrincipal + wlSpouse;
  4919. // 合计上限 = 境内资产 × 50%(防止过激)
  4920. const wlDomesticCap = Math.round(domesticAssets * 0.50);
  4921. if (wlDomestic > wlDomesticCap && wlDomesticCap > 0) {
  4922. const cutRatio = wlDomesticCap / wlDomestic;
  4923. wlPrincipal = Math.round(wlPrincipal * cutRatio);
  4924. wlSpouse = Math.round(wlSpouse * cutRatio);
  4925. wlDomestic = wlPrincipal + wlSpouse;
  4926. }
  4927. // === 境外 IUL/VUL · 按实际境外资产 × needRatio ===
  4928. const overseasNeedRatio = hasUSPerson ? 0.50 : 0.30;
  4929. if (overseasAssetsEffective > 0) {
  4930. // 入门档 / 中段档(IUL/VUL,默认所有 HNW 走这个,除非启用 PPLI)
  4931. wlOverseasIUL = Math.round(overseasAssetsEffective * overseasNeedRatio);
  4932. annualPremiumIULWan = Math.round(wlOverseasIUL / ageMultiplier);
  4933. }
  4934. // === PPLI(单选 · aumUSD ≥ $2000 万 + 客户实际有海外资产时启用 · 替代 IUL/VUL)===
  4935. // PPLI 装入资产合计 = liquid×100% + primaryResidence×0% + investAssets×30%
  4936. // PPLI 保额 = 装入资产合计(去掉 ×1.05 corridor,离岸 PPLI 不受 §7702 约束)
  4937. if (enablePPLI && overseasAssetsEffective > 0) {
  4938. ppliInjectable = Math.round(
  4939. liquid * 1.00 +
  4940. primaryResidence * 0.00 +
  4941. investAssets * 0.30
  4942. );
  4943. wlOverseasPPLI = ppliInjectable; // [v4.2] 装入多少 = 保多少,不再 ×1.05
  4944. // PPLI 单选模式:替代 IUL/VUL,不并行
  4945. wlOverseasIUL = 0;
  4946. annualPremiumIULWan = 0;
  4947. }
  4948. // 推荐档位(用于 UI 显示)
  4949. if (overseasAssetsEffective <= 0) {
  4950. wlOverseasTier = '无境外资产 · 境外寿险 = 0';
  4951. wlOverseasMethod = '客户境外资产为 0,境外寿险无配置需求(toggle 勾选未来计划可估算)';
  4952. } else if (aumUSD < 500) {
  4953. wlOverseasTier = 'IUL 入门';
  4954. wlOverseasMethod = `境外资产 ¥${overseasAssetsEffective}万 × ${(overseasNeedRatio*100).toFixed(0)}% = ¥${wlOverseasIUL}万 · 年保费 ¥${annualPremiumIULWan}万`;
  4955. } else if (!enablePPLI) {
  4956. wlOverseasTier = 'IUL / VUL';
  4957. wlOverseasMethod = `境外资产 ¥${overseasAssetsEffective}万 × ${(overseasNeedRatio*100).toFixed(0)}% = ¥${wlOverseasIUL}万 · AUM 未达 $2000 万 PPLI 门槛`;
  4958. } else {
  4959. wlOverseasTier = 'PPLI(替代 IUL/VUL · 单选模式)';
  4960. wlOverseasMethod = `PPLI 装入 ¥${ppliInjectable}万(流动 100% + 投资 30% + 自住 0%)= 保额 ¥${wlOverseasPPLI}万`;
  4961. }
  4962. } else {
  4963. // 普通家庭 · 仅境内增额终身寿(传承隔离基线 · 境外 = 0)
  4964. wlDomestic = Math.round(domesticAssets * 0.30);
  4965. wlOverseasIUL = 0;
  4966. wlOverseasPPLI = 0;
  4967. wlOverseasTier = '';
  4968. }
  4969. let wlOverseas = wlOverseasIUL + wlOverseasPPLI;
  4970. let wlNeed = wlDomestic + wlOverseas;
  4971. const wlExisting = existingWholeLife;
  4972. let wlGap = Math.max(0, wlNeed - wlExisting);
  4973. // [v4.7+ Jack 2026-06-21 立法] 终身寿险费率查表(替换原 0.025 × (20/N) 线性反推)
  4974. // 真实保险产品费率:短缴期客户活到缴清概率高 + 资金沉淀久 → 短缴费率不是简单 4 倍
  4975. // 行业基准(40 岁健康标体非吸烟,IUL/增额终身寿)·若客户更老/吸烟实际更高,本工具保守估算
  4976. // N=5 → 7.5%(年缴 5 年累计 ≈ 37.5% 保额)
  4977. // N=10 → 4.0%(累计 ≈ 40%)
  4978. // N=15 → 3.0%(累计 ≈ 45%)
  4979. // N=20 → 2.5%(累计 ≈ 50% · 标准档)
  4980. // N=30 → 2.0%(累计 ≈ 60%)
  4981. // 反方:不分年龄 / 性别 / 健康状况 / 产品类型(IUL vs 增额终身寿) — 仍是粗估
  4982. // 但比"线性反推 0.025×(20/N)"更接近真实(N=5 时从 10% 降到 7.5% 减少高估)
  4983. function _wlRateLookup(payYears) {
  4984. // 锚点 + 线性插值 · rate(N) = low + (N-lowN)/(highN-lowN) × (high-low)
  4985. if (payYears <= 5) return 0.075;
  4986. if (payYears <= 10) return 0.075 + (payYears - 5) / 5 * (0.040 - 0.075); // 5→10: 7.5%→4.0%
  4987. if (payYears <= 15) return 0.040 + (payYears - 10) / 5 * (0.030 - 0.040); // 10→15: 4.0%→3.0%
  4988. if (payYears <= 20) return 0.030 + (payYears - 15) / 5 * (0.025 - 0.030); // 15→20: 3.0%→2.5%
  4989. if (payYears <= 30) return 0.025 + (payYears - 20) / 10 * (0.020 - 0.025); // 20→30: 2.5%→2.0%
  4990. return 0.020;
  4991. }
  4992. const wlPayYears = Math.min(20, Math.max(5, yearsToRetire > 0 ? yearsToRetire : 20));
  4993. const _wlRate = _wlRateLookup(wlPayYears);
  4994. let wlPremium = Math.round(wlNeed * _wlRate * 10000);
  4995. // 1. 重疾
  4996. document.getElementById('ciAmount').innerHTML = fmtWan(ciNeed).replace('万', '<span class="unit">万</span>').replace('亿', '<span class="unit">亿</span>');
  4997. document.getElementById('ciExisting').textContent = fmtWan(existingCI);
  4998. document.getElementById('ciGapText').textContent = fmtWan(ciGap);
  4999. document.getElementById('ciCalc').textContent = `= ¥${salary}万 × ${ciMultiplier} = ¥${ciNeed}万`;
  5000. document.getElementById('ciPremium').textContent = '¥' + Math.round(ciPremium).toLocaleString();
  5001. setBars('ci', existingCI, ciGap, ciNeed);
  5002. renderPolicyStatus('ci', existingCI, ciGap, ciNeed);
  5003. // 2. 高端医疗
  5004. document.getElementById('medExisting').textContent = existingMed === 1 ? '¥800万级' : '无';
  5005. document.getElementById('medGapText').textContent = fmtWan(medGap);
  5006. document.getElementById('medPremium').textContent = '¥' + Math.round(medPremium).toLocaleString();
  5007. setBars('med', existingMed === 1 ? medNeed : 0, medGap, medNeed);
  5008. renderPolicyStatus('med', existingMed === 1 ? medNeed : 0, medGap, medNeed);
  5009. // 3. 寿险(DIME / HNW 双轨)
  5010. document.getElementById('lifeAmount').innerHTML = fmtWan(lifeNeed).replace('万', '<span class="unit">万</span>').replace('亿', '<span class="unit">亿</span>');
  5011. document.getElementById('lifeExisting').textContent = fmtWan(existingLife);
  5012. document.getElementById('lifeGapText').textContent = fmtWan(lifeGap);
  5013. document.getElementById('lifePremium').textContent = '¥' + Math.round(lifePremium).toLocaleString();
  5014. setBars('life', existingLife, lifeGap, lifeNeed);
  5015. renderPolicyStatus('life', existingLife, lifeGap, lifeNeed);
  5016. const lifeCard = document.getElementById('lifeCard');
  5017. const hnwBadge = document.getElementById('hnwBadge');
  5018. const dimeFormula = document.getElementById('dimeFormula');
  5019. const hnwTabsWrap = document.getElementById('hnwTabsWrap');
  5020. const wlNonHnwHint = document.getElementById('wlNonHnwHint'); // v1.2 新增
  5021. if (isHNWFinal) {
  5022. // === HNW 模式 ===
  5023. lifeCard.classList.add('hnw-mode');
  5024. hnwBadge.style.display = 'inline-block';
  5025. // v1.2 dimeFormula 始终保留(定期寿险/中端层 · 所有客户都需要主理人收入替代)
  5026. dimeFormula.style.display = 'block';
  5027. hnwTabsWrap.style.display = 'block';
  5028. if (wlNonHnwHint) wlNonHnwHint.style.display = 'none'; // 隐藏非 HNW 提示
  5029. // [v3.6] 寿险卡 = 境内,境外 PPLI 已分到终身寿险卡 → 主标修改提示
  5030. document.getElementById('lifeAmountSub').textContent =
  5031. 'HNW 双轨之中端 · 境内寿险(主理人收入替代 + 流动性补充);境外终身寿(IUL/VUL/PPLI)已迁至终身寿险卡';
  5032. // [v3.6] 境内 Tab · 增额终身寿(主理人 + 配偶分散投保)
  5033. // 公式:主理人 = min(salary × 10, 总财富 × 50%, 监管上限) / 配偶 = 主理人 × 50%
  5034. // 注:这里的 domesticAmount 显示的是 wlDomestic(终身寿,不是定期寿险)
  5035. document.getElementById('domesticAmount').innerHTML =
  5036. fmtWan(wlDomestic).replace('万', '<span class="unit">万</span>').replace('亿', '<span class="unit">亿</span>');
  5037. const _ageCapWLShow = age < 65 ? 50000 : (age < 70 ? 30000 : 10000);
  5038. const _wlPrincipalRawShow = salary * 10;
  5039. const _wlPrincipalShow = Math.min(_wlPrincipalRawShow, Math.round(totalAumForWL * 0.50), _ageCapWLShow);
  5040. const _wlSpouseShow = Math.round(_wlPrincipalShow * 0.5);
  5041. document.getElementById('domesticCalc1').textContent =
  5042. `▸ 主理人增额终身寿 = min(salary ${salary}×10=${_wlPrincipalRawShow}, 总财富${(totalAumForWL/10000).toFixed(2)}亿×50%=${Math.round(totalAumForWL*0.5)}, ${(_ageCapWLShow/10000)}亿监管) = ¥${_wlPrincipalShow}万`;
  5043. document.getElementById('domesticCalc2').textContent =
  5044. `▸ 配偶补充(主理人 50%)= ¥${_wlSpouseShow}万`;
  5045. // [v4.0] 境外 Tab · IUL/VUL/PPLI 公式按产品本质重写
  5046. // IUL/VUL: 保额 = AUM × needRatio(普通 80% / 跨境美籍 150%),反推年保费 = 保额 / 杠杆
  5047. // PPLI: 保额 = 装入资产合计(按流动性权重 · v4.2 立法去掉 ×1.05 corridor · 离岸 PPLI 不受 §7702 约束)
  5048. document.getElementById('overseasAmount').innerHTML =
  5049. fmtWan(wlOverseas).replace('万', '<span class="unit">万</span>').replace('亿', '<span class="unit">亿</span>');
  5050. const _overseasSubEl = document.getElementById('overseasAmountSub');
  5051. if (_overseasSubEl) {
  5052. _overseasSubEl.textContent = `境外终身寿 · 推荐 ${wlOverseasTier}(AUM ${(aumUSD/100).toFixed(0)} 百万美金) · 建议 3-5 张保单分批配置`;
  5053. }
  5054. const _overseasNeedRatioShow = hasUSPerson ? 1.50 : 0.80;
  5055. document.getElementById('overseasCalc1').textContent =
  5056. `▸ IUL/VUL 保额 = AUM ${(totalAumForWL/10000).toFixed(2)}亿 × ${(_overseasNeedRatioShow*100).toFixed(0)}% = ¥${wlOverseasIUL}万`;
  5057. document.getElementById('overseasCalc2').textContent =
  5058. enablePPLI
  5059. ? `▸ PPLI 保额 = 装入资产合计 ¥${ppliInjectable}万(按流动性权重:流动 100% + 自住 0% + 投资 30%) · IUL/VUL + PPLI 双壳并行`
  5060. : `▸ 反推年保费 = ¥${wlOverseasIUL}万 / 杠杆 ${ageMultiplier}x = ¥${annualPremiumIULWan}万 (占 AUM ${(annualPremiumIULWan/totalAumForWL*100).toFixed(2)}%)`;
  5061. const _calc3 = document.getElementById('overseasCalc3');
  5062. if (_calc3) {
  5063. _calc3.style.color = 'var(--accent)';
  5064. _calc3.innerHTML = enablePPLI
  5065. ? `✓ AUM ≥ $2000 万美金 · PPLI 启用 · 建议 3-5 张保单分批配置(单笔 ¥3000-5000 万)`
  5066. : `⚠ AUM &lt; $2000 万美金不启用 PPLI · 优先 IUL / VUL · 建议 3-5 张保单分批配置(单笔 ¥3000-5000 万)`;
  5067. }
  5068. // 境外装入表(PPLI 启用时显示装入资产明细;IUL/VUL 档显示杠杆反推)
  5069. const ppliBody = document.getElementById('ppliTableBody');
  5070. if (enablePPLI) {
  5071. // PPLI 装入明细(国际惯例 · 4 盘分类)
  5072. const rows = [];
  5073. if (liquid > 0) rows.push({ label: '💧 流动金融(现金/债券/基金/上市股/黄金 ETF)', ratio: 1.00, val: Math.round(liquid * 1.00) });
  5074. if (primaryResidence > 0) rows.push({ label: '🏠 自住房产(违反 investor control · 不可装入)', ratio: 0.00, val: 0 });
  5075. if (investAssets > 0) rows.push({ label: '📈 其他投资(私募/PE/REITs · 仅 30% 通过 LP 间接装)', ratio: 0.30, val: Math.round(investAssets * 0.30) });
  5076. ppliBody.innerHTML = rows.map(r => `
  5077. <tr>
  5078. <td>${r.label}</td>
  5079. <td>${Math.round(r.ratio * 100)}%</td>
  5080. <td class="num">${fmtWan(r.val)}</td>
  5081. </tr>
  5082. `).join('') + `<tr><td><strong>装入合计</strong></td><td>—</td><td class="num"><strong>${fmtWan(ppliInjectable)}</strong></td></tr>`
  5083. + `<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>`;
  5084. } else {
  5085. // IUL/VUL 档:展示 AUM × needRatio + 杠杆反推
  5086. ppliBody.innerHTML = `
  5087. <tr>
  5088. <td>📋 IUL/VUL 保额需求(AUM × ${(_overseasNeedRatioShow*100).toFixed(0)}%)</td>
  5089. <td>${(_overseasNeedRatioShow*100).toFixed(0)}%</td>
  5090. <td class="num"><strong>${fmtWan(wlOverseasIUL)}</strong></td>
  5091. </tr>
  5092. <tr>
  5093. <td>💰 反推年保费(保额 / 杠杆 ${ageMultiplier}x)</td>
  5094. <td>÷ ${ageMultiplier}</td>
  5095. <td class="num">${fmtWan(annualPremiumIULWan)} <span style="font-size:10.5px;color:var(--text-dim)">(占 AUM ${(annualPremiumIULWan/totalAumForWL*100).toFixed(2)}%)</span></td>
  5096. </tr>
  5097. <tr style="background:rgba(201,168,76,.08)">
  5098. <td><strong>⚠ 实操建议</strong></td>
  5099. <td>—</td>
  5100. <td class="num" style="font-size:10.5px;color:var(--accent);font-weight:600">3-5 张保单分批配置</td>
  5101. </tr>`;
  5102. }
  5103. // 双轨比例 · 终身寿合计 = 境内 + 境外
  5104. const _wlTotal = wlDomestic + wlOverseas;
  5105. const _domRatio = _wlTotal > 0 ? Math.round(wlDomestic / _wlTotal * 100) : 0;
  5106. const _ovRatio = 100 - _domRatio;
  5107. const _dualRatioEl = document.getElementById('dualRatio');
  5108. const _dualTotalEl = document.getElementById('dualTotal');
  5109. if (_dualRatioEl) _dualRatioEl.textContent = `境内 ${_domRatio}% : 境外 ${_ovRatio}%`;
  5110. if (_dualTotalEl) _dualTotalEl.textContent = fmtWan(_wlTotal);
  5111. } else {
  5112. // === 普通家庭 DIME 模式(P3.2 · 双轨永久展示 · 用占位符填充)===
  5113. lifeCard.classList.remove('hnw-mode');
  5114. hnwBadge.style.display = 'none';
  5115. dimeFormula.style.display = 'block';
  5116. hnwTabsWrap.style.display = 'block'; // P3.2 · 强制展示
  5117. if (wlNonHnwHint) wlNonHnwHint.style.display = 'block';
  5118. document.getElementById('lifeAmountSub').textContent =
  5119. '建议保额 · 主理人意外身故时的家庭保障';
  5120. // P3.2 · 普通家庭模式下双轨用占位符(不混淆数据)
  5121. document.getElementById('domesticAmount').innerHTML = '— <span class="unit">未达 HNW</span>';
  5122. document.getElementById('domesticCalc1').textContent = '▸ 主理人寿险:未达 HNW 标准,境内寿险按定期寿险充足';
  5123. document.getElementById('domesticCalc2').textContent = '▸ 配偶补充:同上';
  5124. document.getElementById('overseasAmount').innerHTML = '— <span class="unit">未达 HNW</span>';
  5125. const ppliBody = document.getElementById('ppliTableBody');
  5126. if (ppliBody) {
  5127. 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>';
  5128. }
  5129. const dualRatioEl = document.getElementById('dualRatio');
  5130. const dualTotalEl = document.getElementById('dualTotal');
  5131. if (dualRatioEl) dualRatioEl.textContent = '— · 待 HNW 触发';
  5132. if (dualTotalEl) dualTotalEl.textContent = '—';
  5133. document.getElementById('lifeCalcD').textContent = `D 房贷+负债 = ${mortgage} + ${otherDebt} = ¥${D}万`;
  5134. const discountLabel = incomeDiscountRate > 0
  5135. ? ` · 折现 ${(incomeDiscountRate*100).toFixed(0)}% (PV因子 ${annuityPVFactor.toFixed(2)})`
  5136. : ' · 不折现(简单累加)';
  5137. document.getElementById('lifeCalcI').textContent =
  5138. `I 收入替代 = ${salary} × ${(incomeReplaceRate*100).toFixed(0)}% (主理人占比${principalShare<0.3?',30%保底':''}) × ${yearsToRetire}年${discountLabel} = ¥${Math.round(I)}万${incomeDiscountRate>0?' (vs 简单累加 ¥'+Math.round(I_undiscounted)+'万)':''}`;
  5139. document.getElementById('lifeCalcE').textContent =
  5140. `E 教育金 = ¥0万 (v2.8 已剥离 · 由独立教育金险覆盖,避免重复计入)`;
  5141. document.getElementById('lifeCalcE').style.opacity = '0.55';
  5142. document.getElementById('lifeCalcA').textContent = `A 现有资产 = ¥${A}万 → DIM 寿险需求 = D + I - A = ¥${Math.round(lifeNeed)}万`;
  5143. }
  5144. // 4. 养老金
  5145. document.getElementById('retireAmount').innerHTML = fmtWan(retireNeed).replace('万', '<span class="unit">万</span>').replace('亿', '<span class="unit">亿</span>');
  5146. document.getElementById('retireExisting').textContent = fmtWan(existingRetirement);
  5147. document.getElementById('retireGapText').textContent = fmtWan(retireGap);
  5148. document.getElementById('retireCalc1').textContent =
  5149. `退休后月支出 = ¥${salary}万 × ${(retireLifestyleRatio*100).toFixed(0)}% (替代率) / 12 = ¥${retireMonthlyExp.toFixed(2)}万/月`;
  5150. document.getElementById('retireCalc2').textContent =
  5151. `月缺口 ¥${monthlyGap.toFixed(2)}万 × 12 × 年金现值因子 ${annuityFactor.toFixed(2)} (${retireYears}年通胀3%折现) = ¥${Math.round(retireNeed)}万 PV`;
  5152. document.getElementById('retirePremium').textContent = '¥' + Math.round(retirePremium).toLocaleString();
  5153. setBars('retire', existingRetirement, retireGap, retireNeed);
  5154. renderPolicyStatus('retire', existingRetirement, retireGap, retireNeed);
  5155. // 5. 教育金
  5156. document.getElementById('eduAmount').innerHTML = fmtWan(eduNeed).replace('万', '<span class="unit">万</span>').replace('亿', '<span class="unit">亿</span>');
  5157. document.getElementById('eduExisting').textContent = fmtWan(existingEdu + eduCoveredByInsurance);
  5158. document.getElementById('eduGapText').textContent = fmtWan(eduGap);
  5159. document.getElementById('eduCalc').innerHTML = eduCalcDetail.length
  5160. ? eduCalcDetail.map(l => '▸ ' + l).join('<br>') + '<br>合计 = ¥' + Math.round(eduNeed) + '万'
  5161. + (eduCoveredByInsurance > 0 ? '<br>已配教育金险 ¥' + eduCoveredByInsurance + '万' : '')
  5162. + (existingEdu > 0 ? '<br>现金/理财储备 ¥' + existingEdu + '万' : '')
  5163. + '<br><strong>缺口 = ¥' + Math.round(eduGap) + '万</strong>'
  5164. : '无子女,无教育金需求';
  5165. document.getElementById('eduPremium').textContent = '¥' + Math.round(eduPremium).toLocaleString();
  5166. setBars('edu', existingEdu + eduCoveredByInsurance, eduGap, eduNeed);
  5167. renderPolicyStatus('edu', existingEdu + eduCoveredByInsurance, eduGap, eduNeed);
  5168. // ════════════════════════════════════════════════════════════════
  5169. // === v3.0 新增 2 险种诊断(意外险 / 终身寿险 · v1.1 已去掉护理险/满期金)===
  5170. // ════════════════════════════════════════════════════════════════
  5171. // 年支出估算:工资 × 60%(简化版 · 后续 Phase 2 可从 portrait.family.annual_expense_cny 读)
  5172. const annualExpenseWan = Math.max(20, Math.round((salary + spouseSalary) * 0.6));
  5173. // 6. 意外险(基础风险层)· [v4.5.3] 差异化定位 · 与定期寿险互补
  5174. // 旧 v3.6:HNW = 0 / 普通 = salary × 8(身故 + 伤残合并)→ 与定寿身故场景重叠
  5175. // 新 v4.5.3 立法(Jack 2026-06-20):意外险**只定位为伤残保障**(意外身故由定寿覆盖)
  5176. // • HNW = salary × 3(伤残应急现金 3 年 · AUM 充足但需短期流动性)
  5177. // • 普通 = salary × 5(伤残期 5 年家庭过渡 · 主理人不能工作但活着)
  5178. // 定位:意外险 = 伤残保障(独有价值)/ 定期寿险 = 任何身故保障
  5179. const accNeed = isHNWFinal ? Math.round(salary * 3) : Math.round(salary * 5);
  5180. const accExisting = existingAccident;
  5181. const accGap = Math.max(0, accNeed - accExisting);
  5182. const accPremium = Math.round(accNeed * 0.0015 * 10000); // 0.15% 费率
  5183. document.getElementById('accAmount').innerHTML = fmtWan(accNeed).replace('万', '<span class="unit">万</span>').replace('亿', '<span class="unit">亿</span>');
  5184. document.getElementById('accExisting').textContent = fmtWan(accExisting);
  5185. document.getElementById('accGapText').textContent = fmtWan(accGap);
  5186. document.getElementById('accCalc').textContent = isHNWFinal
  5187. ? `= HNW 伤残应急现金 = 年薪 ¥${salary} 万 × 3 = ¥${accNeed} 万(意外身故由定寿覆盖)`
  5188. : `= 普通家庭伤残期 5 年家庭过渡 = 年薪 ¥${salary} 万 × 5 = ¥${accNeed} 万`;
  5189. document.getElementById('accPremium').textContent = '¥' + accPremium.toLocaleString();
  5190. setBars('acc', accExisting, accGap, Math.max(1, accNeed));
  5191. renderPolicyStatus('acc', accExisting, accGap, accNeed);
  5192. // ════════════════════════════════════════════════════════════════
  5193. // 7. 终身寿险 UI 渲染段(v4.0 · 公式段已移到 calculate() 早期 line ~3186 之前以避免 TDZ)
  5194. // ════════════════════════════════════════════════════════════════
  5195. // 这里只做 UI 渲染,不做计算
  5196. document.getElementById('wlAmount').innerHTML = fmtWan(wlNeed).replace('万', '<span class="unit">万</span>').replace('亿', '<span class="unit">亿</span>');
  5197. document.getElementById('wlExisting').textContent = fmtWan(wlExisting);
  5198. document.getElementById('wlGapText').textContent = fmtWan(wlGap);
  5199. document.getElementById('wlCalc').textContent = isHNWFinal
  5200. ? (enablePPLI
  5201. ? `= 境内增额终身寿 ¥${wlDomestic} 万 + 境外 ${wlOverseasTier}(IUL/VUL ¥${wlOverseasIUL} 万 + PPLI ¥${wlOverseasPPLI} 万)= ¥${wlNeed} 万`
  5202. : `= 境内增额终身寿 ¥${wlDomestic} 万 + 境外 ${wlOverseasTier} ¥${wlOverseasIUL} 万(年保费 ¥${annualPremiumIULWan} 万 × 杠杆 ${ageMultiplier}x)= ¥${wlNeed} 万`)
  5203. : `= 总财富 ¥${Math.round(totalAumForWL)} 万 × 30% = ¥${wlNeed} 万(传承隔离基线)`;
  5204. document.getElementById('wlPremium').textContent = '¥' + wlPremium.toLocaleString();
  5205. setBars('wl', wlExisting, wlGap, Math.max(1, wlNeed));
  5206. renderPolicyStatus('wl', wlExisting, wlGap, wlNeed);
  5207. // ════════════════════════════════════════════════════════════════
  5208. // [v4.3 软提示] 一次性赔付保额 vs AUM(Jack 2026-06-16 立法)
  5209. // ════════════════════════════════════════════════════════════════
  5210. // v4.2 旧:硬 100% Cap + 优先级缩减
  5211. // v4.3 新:软提示(超过 AUM 100% 仅显示警示,不强制缩减)
  5212. // 理由:
  5213. // 1. 加上 v4.3 上游优化(配偶按 salary 比例 + 境内 50% Cap)后,数字已大幅可控
  5214. // 2. 保险逻辑 ≠ 资产匹配 — 跨境美籍 / UHNW 跨境 100-150% AUM 是行业实操常态
  5215. // 3. 真实约束应在保费支付能力,不是结果端硬砍
  5216. // 4. 中产家庭一次性赔付 200%+ AUM 是合理的(基础保障 vs 资产基础)
  5217. // 适用范围:HNW 模式 + 普通家庭模式都适用(都显示警示)
  5218. let onetimeBeforeCap = ciNeed + medNeed + lifeNeed + wlDomestic + wlOverseas + accNeed;
  5219. let onetimeCapped = false; // [v4.3] 不再表示"已缩减",而是"是否超过 80-100% 区间"
  5220. let cappedDetail = '';
  5221. let cappedOriginal = onetimeBeforeCap;
  5222. let onetimeRatio = totalAumForWL > 0 ? (onetimeBeforeCap / totalAumForWL) : 0;
  5223. // [v4.3] 软提示触发 · [v4.7 + Jack 2026-06-21] 按客户档位分级阈值,数字去小数
  5224. // 行业逻辑(Jack 立法):基础保障 vs 资产基础不同,中产可超 200% AUM 合理,UHNW 30-60% 即可
  5225. // 普通家庭 (totalWealth < 2000 万) : 100-300% AUM 合理(基础保障倍数高)
  5226. // 中端档 (totalWealth ∈ [2000, 5000)) : 80-150% AUM
  5227. // HNW (totalWealth ∈ [5000, 50000)) : 50-100% AUM(PPLI 装入比例小)
  5228. // UHNW (totalWealth ≥ 50000) : 30-80% AUM(大额装入私行体系 + 多保单分批)
  5229. if (totalAumForWL > 0) {
  5230. let _tierLabel, _tierLow, _tierHigh, _tierTriggerPct;
  5231. if (isHNWFinal && totalAumForWL >= 50000) {
  5232. _tierLabel = 'UHNW(≥¥5亿 AUM)'; _tierLow = 30; _tierHigh = 80; _tierTriggerPct = 80;
  5233. } else if (isHNWFinal) {
  5234. _tierLabel = 'HNW(¥5000万-5亿 AUM)'; _tierLow = 50; _tierHigh = 100; _tierTriggerPct = 100;
  5235. } else if (totalAumForWL >= 2000) {
  5236. _tierLabel = '中端档(¥2000-5000 万)'; _tierLow = 80; _tierHigh = 150; _tierTriggerPct = 150;
  5237. } else {
  5238. _tierLabel = '普通家庭(<¥2000 万)'; _tierLow = 100; _tierHigh = 300; _tierTriggerPct = 300;
  5239. }
  5240. const _ratioPct = onetimeRatio * 100;
  5241. if (_ratioPct > _tierTriggerPct) {
  5242. onetimeCapped = true;
  5243. cappedDetail = '当前一次性赔付 ¥' + Math.round(onetimeBeforeCap) + '万 = AUM ' + Math.round(_ratioPct) +
  5244. '%,超过' + _tierLabel + '常规配置区间(' + _tierLow + '-' + _tierHigh + '% AUM)。' +
  5245. '建议:配合保费融资 + 多保单分批 + 跨境合规通道,代理人 1v1 服务做精确测算。';
  5246. }
  5247. }
  5248. // v3.0 · 7 险种总计重算(覆盖原 line 2346 的 5 险种总计)
  5249. const totalCoverage7 = totalCoverage + accNeed + wlNeed;
  5250. const totalGap7 = totalGap + accGap + wlGap;
  5251. const totalPremium7 = totalPremium + accPremium + wlPremium;
  5252. document.getElementById('totalCoverage').textContent = fmtWan(totalCoverage7);
  5253. document.getElementById('totalGap').textContent = fmtWan(totalGap7);
  5254. document.getElementById('totalPremium').textContent = '¥' + (totalPremium7 / 10000).toFixed(1) + '万';
  5255. // ════════════════════════════════════════════════════════════════
  5256. // [v4.0] 总保额三栏汇总(口径分离 · Jack 2026-06-15 立法)
  5257. // ════════════════════════════════════════════════════════════════
  5258. // 旧 v3.6:totalCoverage7 = 7 项简单累加(把"一次性赔付"+"长周期累积"混算)→ 误导大数字
  5259. // 新 v4.0:三栏分离
  5260. // A · 一次性赔付保额合计 = 重疾 + 医疗 + 定寿 + 终身寿(双轨)+ 意外
  5261. // B · 长周期累积需求合计 = 养老 + 教育(30 年 / 22 年累积名义金额)
  5262. // C · 客户实际年成本 = 7 项年缴保费合计(占 AUM 比例)
  5263. // D · 保障杠杆 = 一次性赔付 / 总投入(20 年保费)
  5264. const totalOnetimeCoverage = ciNeed + medNeed + lifeNeed + wlNeed + accNeed;
  5265. const totalLongtermNeed = retireNeed + eduNeed;
  5266. const totalAnnualPremium = totalPremium7; // 7 项年缴保费合计
  5267. const annualPremiumPctOfWealth = totalAumForWL > 0
  5268. ? (totalAnnualPremium / 10000 / totalAumForWL * 100).toFixed(2)
  5269. : '0.00';
  5270. // 三栏赋值
  5271. document.getElementById('totalOnetimeCoverage').textContent = fmtWan(totalOnetimeCoverage);
  5272. document.getElementById('totalLongtermNeed').textContent = fmtWan(totalLongtermNeed);
  5273. document.getElementById('totalAnnualPremium').textContent = '¥' + (totalAnnualPremium / 10000).toFixed(1) + '万';
  5274. document.getElementById('totalAnnualPremiumSub').textContent =
  5275. `年缴保费 · 占总财富 ${annualPremiumPctOfWealth}% · 20 年累计 ¥${(totalAnnualPremium * 20 / 10000 / 10000).toFixed(2)}亿`;
  5276. // [v4.7 + Jack 2026-06-21] 保障缺口 Hero tile · totalGap7 = 7 险种 need 累计 - existing 累计
  5277. const _totalGapHeroEl = document.getElementById('totalGapHero');
  5278. const _totalGapHeroSubEl = document.getElementById('totalGapHeroSub');
  5279. if (_totalGapHeroEl) {
  5280. _totalGapHeroEl.textContent = fmtWan(totalGap7);
  5281. // 副文案:已配多少 / 占完整需求百分比 → 帮代理人现场讲"还差 X% 没补齐"
  5282. const _coverageReady = totalCoverage7 - totalGap7; // 已有保单覆盖部分
  5283. const _gapPct = totalCoverage7 > 0 ? (totalGap7 / totalCoverage7 * 100) : 0;
  5284. if (_totalGapHeroSubEl) {
  5285. if (totalGap7 <= 0) {
  5286. _totalGapHeroSubEl.textContent = '✓ 7 险种已配齐 · 无缺口';
  5287. } else {
  5288. _totalGapHeroSubEl.textContent =
  5289. '已配 ¥' + (_coverageReady>=10000 ? (_coverageReady/10000).toFixed(2)+'亿' : Math.round(_coverageReady)+'万') +
  5290. ' · 仍缺 ' + _gapPct.toFixed(0) + '%';
  5291. }
  5292. }
  5293. }
  5294. // [v4.3] 软提示 UI · 一次性赔付超过 100% AUM 时显示警示条(不强制缩减)
  5295. const _capWarnEl = document.getElementById('capWarningV43');
  5296. if (_capWarnEl) {
  5297. if (onetimeCapped) {
  5298. _capWarnEl.style.display = 'block';
  5299. _capWarnEl.innerHTML = '⚠ <strong>v4.3 软提示</strong>:' + cappedDetail;
  5300. } else {
  5301. _capWarnEl.style.display = 'none';
  5302. }
  5303. }
  5304. // [v4.7] 保障杠杆 = 一次性赔付保额 / 20 年【纯保障型】保费(剔除养老/教育/终身寿储蓄部分)
  5305. // 旧 v4.6:把养老金 / 终身寿 / 教育金的储蓄保费也算分母,导致银发族杠杆 ≈ 0.6×(储蓄稀释了纯保障杠杆)
  5306. // 新 v4.7:分母 = acc + med + ci + life(纯保障层),银发族杠杆从 0.6× 回升到 3-15× 区间(行业本意)
  5307. const protectionAnnualPremium = (accPremium || 0) + (medPremium || 0) + (ciPremium || 0) + (lifePremium || 0);
  5308. const leverageV4 = protectionAnnualPremium > 0
  5309. ? (totalOnetimeCoverage * 10000 / (protectionAnnualPremium * 20))
  5310. : 0;
  5311. document.getElementById('leverage').textContent = leverageV4.toFixed(1) + ' 倍';
  5312. // [v4.7] 暴露给 renderPremiumTimeline 杠杆比 KPI 卡片复用同一口径
  5313. window._cyProtectionAnnualPremiumYuan = protectionAnnualPremium;
  5314. // ===== [v3.6] 渲染 7 险种计算依据展开块 · 等 v3.0 段算完 accNeed/wlNeed 后调用 =====
  5315. // 数据保证一致:lifeNeed = HNW 模式境内 / wlNeed = HNW 模式境外 PPLI(普通家庭 = 资产×30%)
  5316. renderFormulaPanel({
  5317. // 控制流
  5318. isHNWFinal, hasUSPerson,
  5319. // 家庭信息
  5320. salary, spouseSalary, age, childCount,
  5321. eduUnit, eduPathLabel: _eduPathLabels[eduPath] || eduPath,
  5322. // 7 险种 need/gap/premium · 用 v3.0 真实变量
  5323. accidentNeed: accNeed, accidentGap: accGap, accidentPremium: accPremium,
  5324. ciNeed, ciGap, ciPremium, ciMultiplier,
  5325. medNeed, medPremium, existingMed,
  5326. lifeNeed, lifeGap, lifePremium,
  5327. domesticNeed, overseasNeed,
  5328. wlNeed, wlGap, wlPremium, totalAumForWL,
  5329. // [v4.0] 终身寿双轨参数(7 险种 modal 拆解用)
  5330. wlDomestic, wlOverseas, wlOverseasIUL, wlOverseasPPLI,
  5331. wlOverseasTier, ageMultiplier, annualPremiumIULWan, ppliInjectable, enablePPLI,
  5332. aumUSD,
  5333. retireNeed, retireGap, retirePremium, retireLifestyleRatio,
  5334. retireYears: Math.max(0, lifeExpectancy - retireAge),
  5335. eduNeed, eduGap, eduPremium,
  5336. // 寿险 DIM 子项
  5337. D, I, liquid,
  5338. // [v4.4 修复] 寿险 DIM 法 I 项 ctx(明确折现率 + 主理人占比 + 工作期年数)
  5339. incomeDiscountRate, principalShare, incomeReplaceRate,
  5340. yearsToRetire, // 寿险 I 项专用 = 主理人到退休的年数(不同于 retireYears 养老金 30 年)
  5341. // [v4.7+ 缴费年限智能化] 把动态 payYears 也传给 formula panel,替换硬编码 '20 年' / '20-30 年'
  5342. ciPayYears, lifePayYears, wlPayYears, retirePayYears: Math.max(1, yearsToRetire),
  5343. // [v4.7+ Jack 2026-06-21] 教育金缴费窗口直接复用算法侧 eduPremiumYears(已与子女年龄联动)
  5344. eduPayYears: (Array.isArray(childAges) && childAges.length > 0) ? eduPremiumYears : 0,
  5345. // 寿险 AUM 比例化(只 HNW 用)
  5346. _lifeAgeMin: age < 65 ? 5000 : (age < 70 ? 3000 : 1000),
  5347. _lifeAgeCap: age < 65 ? 50000 : (age < 70 ? 30000 : 10000),
  5348. _lifeAumRatio: age < 65 ? 0.5 : (age < 70 ? 0.3 : 0.2),
  5349. _aumForLife: _aumForLifeRender,
  5350. // 总计 · 用 7 险种合计(对外显示)
  5351. totalCoverage: totalCoverage7, totalGap: totalGap7, totalPremium: totalPremium7
  5352. });
  5353. // v2026-06-13 v1.4 · P2.1 · 年缴保费 donut 渲染
  5354. renderPremiumDonut({
  5355. acc: accPremium, med: medPremium, ci: ciPremium,
  5356. edu: eduPremium, retire: retirePremium, life: lifePremium,
  5357. wl: wlPremium, total: totalPremium7
  5358. });
  5359. // 高净值建议(画像驱动 + 数字驱动双层)
  5360. const marriage = document.getElementById('marriage').value;
  5361. renderUhnwSuggestions({
  5362. age, salary, spouseSalary, lifeNeed, ciNeed, retireGap, eduGap,
  5363. mortgage, otherDebt, childCount, gender, marriage,
  5364. hasUS: hasUSPerson, isHNW: isHNWFinal
  5365. });
  5366. // [v4.8 · 2026-06-26] 客户家庭报告 · 一页总结(报告尾部"客户带走"卡)
  5367. renderClientSummary({
  5368. gaps: { acc: accGap, med: medGap, ci: ciGap, life: lifeGap,
  5369. edu: eduGap, retire: retireGap, wl: wlGap },
  5370. needs: { acc: accNeed, med: medNeed, ci: ciNeed, life: lifeNeed,
  5371. edu: eduNeed, retire: retireNeed, wl: wlNeed },
  5372. exists: { acc: existingAccident,
  5373. med: existingMed === 1 ? medNeed : 0,
  5374. ci: existingCI,
  5375. life: existingLife,
  5376. edu: existingEdu + existingEduInsurance,
  5377. retire: existingRetirement,
  5378. wl: existingWholeLife },
  5379. salary, spouseSalary, totalPremium: totalPremium7
  5380. });
  5381. // 配置优先级 Timeline(v3.0 · 7 险种 · 按金字塔层 + 缺口规模排序)
  5382. renderPriorityTimeline({
  5383. lifeGap, lifeNeed, medGap, medNeed,
  5384. ciGap, ciNeed, eduGap, eduNeed,
  5385. retireGap, retireNeed,
  5386. accGap, accNeed, wlGap, wlNeed,
  5387. isHNW: isHNWFinal
  5388. });
  5389. // === Phase 3 · 7 险种缺口对比柱状图(v1.3 已移除 · 由金字塔体检卡取代)===
  5390. // renderGapChart({ ... });
  5391. // === v3.2 · 金字塔体检卡渲染(7 险种水位动画驱动)===
  5392. renderCalcPyramidCheck({
  5393. acc: { need: accNeed, existing: existingAccident },
  5394. med: { need: medNeed, existing: existingMed === 1 ? medNeed : 0 },
  5395. ci: { need: ciNeed, existing: existingCI },
  5396. life: { need: lifeNeed, existing: existingLife },
  5397. edu: { need: eduNeed, existing: existingEdu + existingEduInsurance },
  5398. retire: { need: retireNeed, existing: existingRetirement },
  5399. wl: { need: wlNeed, existing: existingWholeLife }
  5400. });
  5401. // === v3.4 · 家庭总财富画像(三盘合并视角)===
  5402. // [v3.6] 加 insuranceCashValue 作为第 4 盘
  5403. renderWealthPicture({
  5404. liquid, primaryResidence, investAssets, insuranceCashValue, totalWealth,
  5405. salary, spouseSalary, isHNW: isHNWFinal,
  5406. portraitAum: portraitTotalAum
  5407. });
  5408. // === v2.8 · 支付能力健康度 + 行业基准对比 ===
  5409. // [v4.4.5] 调用顺序:必须在 renderPremiumTimeline 之前 — 它会暴露 window._cyAffordableTotalYuan
  5410. // [v4.4 修复 #7] 改用 totalPremium7(7 项合计,含意外+终身寿)统一口径
  5411. renderAffordabilityCheck({
  5412. salary, spouseSalary, totalCoverage: totalCoverage7, totalPremium: totalPremium7,
  5413. affordabilityCap,
  5414. isHNW: isHNWFinal,
  5415. portraitAum: portraitTotalAum, // 万,从 portrait 读到的总 AUM
  5416. liquidAssets: liquid, // 万,fallback 流动资产
  5417. totalWealth: totalWealth, // [v3.4] 流动 + 自住 + 投资,优先于 liquid×5 fallback
  5418. primaryResidence, investAssets, // [v3.4] 单独传给画像段使用
  5419. eduPath, childAges, // [v2.9] 教育金分级缩减需要
  5420. age, retireAge, // [v4.7] yearsToRetire ≤ 10 智能护栏需要
  5421. premiums: {
  5422. acc: accPremium, med: medPremium, ci: ciPremium,
  5423. life: lifePremium, edu: eduPremium, retire: retirePremium,
  5424. wl: wlPremium
  5425. }
  5426. });
  5427. // === [v4.4] 现金流规划 · LDI 视角(年保费支出趋势图) ===
  5428. // 数据驱动:每次 calculate() 触发时同步重绘 Canvas,实现"数据 → 趋势图"自动跟随
  5429. // [v4.4.5] Canvas 红线 = affordableTotal(双轨 B 列实际可负担,与已有 UI 完全一致)
  5430. // 而非 salary × cap% 的理论上限(避免 17.7 vs 16 万的认知冲突)
  5431. // [v4.4.6] renderAffordabilityCheck 已在上方调用,window._cyAffordableTotalYuan 已就绪
  5432. const _denomYuan = isHNWFinal
  5433. ? (totalAumForWL > 0 ? totalAumForWL * 10000 : liquid * 5 * 10000)
  5434. : (salary + spouseSalary) * 10000;
  5435. const _HNW_CAP_MAP = {0.10:0.01, 0.15:0.015, 0.20:0.02, 0.30:0.03};
  5436. const _capRatio = isHNWFinal
  5437. ? (_HNW_CAP_MAP[affordabilityCap] !== undefined ? _HNW_CAP_MAP[affordabilityCap] : affordabilityCap*0.1)
  5438. : affordabilityCap;
  5439. // 优先使用 renderAffordabilityCheck 暴露的 affordableTotal(已运行过)
  5440. const _affordableTotalYuan = (typeof window._cyAffordableTotalYuan === 'number')
  5441. ? window._cyAffordableTotalYuan
  5442. : (_capRatio * _denomYuan);
  5443. const _isOverflow = !!window._cyIsOverflow;
  5444. // [v4.4.6] 调试日志:每次重算时输出关键变量,便于 Jack 验证可负担上限红线动态变化
  5445. if (window.console && console.log) {
  5446. console.log('[v4.4.6 LDI 趋势图] isHNW:', isHNWFinal, '| affordabilityCap:', affordabilityCap,
  5447. '| 理论上限 ¥', (_capRatio * _denomYuan / 10000).toFixed(1), '万 (salary/AUM × cap%)',
  5448. '| 双轨B列 ¥', (_affordableTotalYuan/10000).toFixed(1), '万 (可负担方案,Canvas 红线用此值)',
  5449. '| isOverflow:', _isOverflow);
  5450. }
  5451. renderPremiumTimeline({
  5452. accidentPremium: accPremium,
  5453. medPremium,
  5454. ciPremium,
  5455. lifePremium,
  5456. retirePremium,
  5457. eduPremium,
  5458. wlPremium,
  5459. // [v4.7+ Jack 2026-06-21] 教育金缴费窗口复用算法侧 eduPremiumYears(已与子女年龄联动)· 无子女兜底 15
  5460. eduPayYears: (Array.isArray(childAges) && childAges.length > 0) ? eduPremiumYears : 15,
  5461. // [v4.7+ 缴费年限智能化 v2] 把 PAY_CYCLES 用的智能 payYears 也透传给 Canvas 渲染端
  5462. ciPayYears, lifePayYears, wlPayYears, retirePayYears: Math.max(1, yearsToRetire),
  5463. totalAumForWL,
  5464. isHNW: isHNWFinal,
  5465. age, // [v4.4] 横轴投保人年龄起点
  5466. salary, // [v4.4] 用于"建议 vs 可负担"对比
  5467. affordableCap: _capRatio,
  5468. denominatorYuan: _denomYuan,
  5469. affordableTotalYuan: _affordableTotalYuan,
  5470. isOverflow: _isOverflow,
  5471. // [v4.5] 领取期参数
  5472. retireAge, // 退休年龄(form 读)
  5473. retireNeed, // 万,养老金需求总额(/30 年 = 月领化)
  5474. childAges, // 子女年龄数组(教育金返还 Y(18-cAge) 起 4 年)
  5475. eduUnit, // 万,单子女单年教育金(eduUnit/4 = 大学每年返还)
  5476. // [v4.5.1] 风险对冲覆盖(一次性赔付保额合计 = 重疾+医疗+定寿+终身寿+意外)
  5477. totalOnetimeCoverage // 万,KPI 卡片大数字
  5478. });
  5479. // === v2.8 · 支付能力健康度 + 行业基准对比 ===
  5480. // [v4.4.6] 已在 renderPremiumTimeline 之前调用(line ~3946),此处不再重复
  5481. // === Phase 3 · 推荐产品(从 products-bundle.js 匹配)===
  5482. renderProductRecommendations({
  5483. age, gender, salary, lifeNeed, isHNW: isHNWFinal,
  5484. domesticNeed, overseasNeed, retireNeed, eduGap
  5485. });
  5486. // [2026-07-12 移植] 更新客户家庭档案卡(替代原保险配置诊断展示位)
  5487. try { v01UpdateFamilyCard(); } catch (e) { console.warn('[v01FamilyCard] render skipped:', e); }
  5488. // [2026-07-12 移植] 更新体检报告 Hero(第5 Tab · 三环/3KPI/4mini 可视化)
  5489. try { v01UpdateHero(); } catch (e) { console.warn('[v01Hero] render skipped:', e); }
  5490. // [2026-07-12 移植自 FAV] 家族保单(第6 Tab) + 生命周期(Tab A) + 水位金字塔(Tab C)
  5491. try { if (window.favUpdateAll) window.favUpdateAll(); } catch (e) { console.warn('[favModule] render skipped:', e); }
  5492. // 显示 + 滚动(静默重算时跳过滚动)
  5493. document.getElementById('result').style.display = 'block';
  5494. if (!window._cySilentRecalc) {
  5495. setTimeout(() => {
  5496. document.getElementById('result').scrollIntoView({ behavior:'smooth', block:'start' });
  5497. }, 50);
  5498. }
  5499. // [v4.4.4] 启用 form 字段实时监听 — 用户改 salary/spouseSalary/资产/cap 等 → 自动节流重算 + 重绘 Canvas
  5500. // 只在首次"计算保额"后绑定一次,避免重复绑定
  5501. if (!window._cyLiveListenerBound) {
  5502. window._cyLiveListenerBound = true;
  5503. let _liveDebounce = null;
  5504. const _liveHandler = function(e) {
  5505. const t = e.target;
  5506. if (!t || (t.tagName !== 'INPUT' && t.tagName !== 'SELECT')) return;
  5507. // 排除非影响计算的元素
  5508. if (t.id === 'portraitSwitcher') return; // 切换画像走 switchPortrait
  5509. if (t.closest && t.closest('#result')) return; // 排除 result 区内部的 input
  5510. // 节流 250ms
  5511. clearTimeout(_liveDebounce);
  5512. _liveDebounce = setTimeout(() => {
  5513. const resultEl = document.getElementById('result');
  5514. if (resultEl && resultEl.style.display !== 'none') {
  5515. // 静默重算 — 不滚动,不弹 toast
  5516. window._cySilentRecalc = true;
  5517. try { calculate(); } finally { window._cySilentRecalc = false; }
  5518. }
  5519. }, 250);
  5520. };
  5521. // 直接绑到 document,覆盖所有 form 元素(form-grid 有多个,绑 body 最稳)
  5522. document.addEventListener('input', _liveHandler);
  5523. document.addEventListener('change', _liveHandler);
  5524. console.log('[v4.4.4] 实时监听已绑定 — 修改 form 字段会自动重算 Canvas + 所有数字');
  5525. }
  5526. }
  5527. // [2026-07-12 移植自「家庭保障体检报告 v0.1」] 客户家庭档案卡渲染器 · 客户身份护照 one-pager
  5528. // 自包含:只读 form 输入字段 + 写自身 v01Fc* 节点,不依赖体检报告的 rings/hero 引擎
  5529. function v01UpdateFamilyCard() {
  5530. const card = document.getElementById('v01FamilyCard');
  5531. if (!card) return;
  5532. function _v(id, def) {
  5533. const el = document.getElementById(id);
  5534. if (!el) return def || '';
  5535. return el.value !== undefined ? el.value : (el.textContent || '').trim();
  5536. }
  5537. function _num(id) { const v = _v(id); return parseFloat(v) || 0; }
  5538. function _fmtWan(wan) {
  5539. if (!wan || wan === 0) return '¥0';
  5540. if (wan >= 10000) return '¥' + (wan / 10000).toFixed(2).replace(/\.?0+$/, '') + '亿';
  5541. return '¥' + (wan >= 100 ? Math.round(wan) : wan.toFixed(1).replace(/\.?0+$/, '')) + '万';
  5542. }
  5543. // ─── 数据收集 ───
  5544. const surname = _v('surname') || '客户';
  5545. const age = _num('age');
  5546. const gender = _v('gender');
  5547. const genderLabel = gender === 'F' ? '女' : gender === 'M' ? '男' : '';
  5548. const marriage = _v('marriage');
  5549. const marriageLabel = marriage === 'married' ? '已婚' : marriage === 'single' ? '未婚' : '';
  5550. const childCount = _num('childCount');
  5551. const childAges = [_num('childAge1'), _num('childAge2'), _num('childAge3')].filter(function(a){return a > 0});
  5552. const eduPath = _v('eduPath');
  5553. const eduLabel = ({
  5554. domestic: '国内路径',
  5555. domestic_plus: '混合(部分海外)',
  5556. elite_us: '精英留学',
  5557. full_overseas: '全程海外'
  5558. })[eduPath] || '';
  5559. const salary = _num('salary');
  5560. const spouseSalary = _num('spouseSalary');
  5561. const totalIncome = salary + spouseSalary;
  5562. const liquid = _num('liquidAssets');
  5563. const house = _num('primaryResidence');
  5564. const invest = _num('investAssets');
  5565. const overseasUSD = _num('overseasAssets');
  5566. const overseasWan = overseasUSD * 7;
  5567. const totalWealth = liquid + house + invest + overseasWan;
  5568. const retireAge = _num('retireAge');
  5569. const yearsToRetire = Math.max(0, retireAge - age);
  5570. const lifeExp = _num('lifeExpectancy');
  5571. const annualSpend = totalIncome * 0.6; // 假设支出 60% 收入
  5572. const monthlySpend = annualSpend / 12;
  5573. // ─── 渲染头部 Title 区 ───
  5574. let titleStr = '';
  5575. if (surname) titleStr += surname;
  5576. if (totalIncome >= 1000 || totalWealth >= 100000) {
  5577. titleStr += '氏 · UHNW 家族';
  5578. } else if (childCount >= 2) {
  5579. titleStr += '氏 · 多子女家庭';
  5580. } else if (childCount === 1) {
  5581. titleStr += '氏 · 三口之家';
  5582. } else if (marriage === 'married') {
  5583. titleStr += '氏 · DINK 家庭';
  5584. } else {
  5585. titleStr += '客户';
  5586. }
  5587. document.getElementById('v01FcTitle').textContent = titleStr;
  5588. const subParts = [];
  5589. if (age > 0) subParts.push(age + ' 岁');
  5590. if (genderLabel) subParts.push(genderLabel);
  5591. if (marriageLabel) subParts.push(marriageLabel);
  5592. if (childCount > 0) {
  5593. let cs = childCount + ' 子';
  5594. if (childAges.length > 0) cs += '(' + childAges.map(function(a){return a+'岁'}).join('/') + ')';
  5595. subParts.push(cs);
  5596. } else if (childCount === 0 && marriage === 'married') {
  5597. subParts.push('无子女');
  5598. }
  5599. if (eduLabel) subParts.push(eduLabel);
  5600. document.getElementById('v01FcSubtitle').textContent = subParts.length ? subParts.join(' · ') : '请选择画像或从计算器跳转';
  5601. // ─── 三柱核心指标 ───
  5602. document.getElementById('v01FcIncome').textContent = _fmtWan(totalIncome);
  5603. document.getElementById('v01FcIncomeSub').textContent = spouseSalary > 0
  5604. ? '主 ' + _fmtWan(salary) + ' + 配偶 ' + _fmtWan(spouseSalary)
  5605. : '主理人 ' + _fmtWan(salary);
  5606. document.getElementById('v01FcWealth').textContent = _fmtWan(totalWealth);
  5607. const wealthPieces = [];
  5608. if (liquid > 0) wealthPieces.push('流动');
  5609. if (house > 0) wealthPieces.push('自住');
  5610. if (invest > 0) wealthPieces.push('投资');
  5611. if (overseasWan > 0) wealthPieces.push('境外');
  5612. document.getElementById('v01FcWealthSub').textContent = wealthPieces.length
  5613. ? wealthPieces.join(' / ') + ' 共 ' + wealthPieces.length + ' 盘'
  5614. : '4 盘合计';
  5615. // ─── [2026-07-12 提案① 对齐 FAV] 已配置保额 · 7 险种现有保单合计(万) ───
  5616. // 自读表单(不依赖后文才定义的 exAcc 等 const · 避免时间死区 ReferenceError · IC 模块调用顺序坑)
  5617. const _exAcc = _num('existingAccident'), _exCI = _num('existingCI'), _exLife = _num('existingLife');
  5618. const _exEdu = _num('existingEduInsurance'), _exRet = _num('existingRetirement'), _exWl = _num('existingWholeLife');
  5619. const _hasMed = _v('existingMed') === '1';
  5620. // 意外/重疾/定寿/教育/养老/终身寿为保额(万);医疗为固定 800 万 cover(勾选即计)
  5621. const insuredWan = _exAcc + _exCI + _exLife + _exEdu + _exRet + _exWl + (_hasMed ? 800 : 0);
  5622. const insuredEl = document.getElementById('v01FcInsured');
  5623. const insuredSubEl = document.getElementById('v01FcInsuredSub');
  5624. if (insuredEl) insuredEl.textContent = insuredWan > 0 ? _fmtWan(insuredWan) : '¥0';
  5625. if (insuredSubEl) {
  5626. const covered = [
  5627. _exAcc>0?'意外':null, _hasMed?'医疗':null, _exCI>0?'重疾':null, _exLife>0?'定寿':null,
  5628. _exEdu>0?'教育':null, _exRet>0?'养老':null, _exWl>0?'终身寿':null
  5629. ].filter(Boolean);
  5630. insuredSubEl.textContent = covered.length ? covered.join('/') + ' 共 ' + covered.length + ' 项' : '尚未配置';
  5631. }
  5632. // ─── [2026-07-12 提案① 对齐 FAV] 保障缺口 · 镜像计算器 totalGapHero(单源·错题#9) ───
  5633. const gapSrc = document.getElementById('totalGapHero');
  5634. const gapEl = document.getElementById('v01FcGap');
  5635. const gapSubEl = document.getElementById('v01FcGapSub');
  5636. if (gapEl) gapEl.textContent = (gapSrc && gapSrc.textContent.trim() && gapSrc.textContent.indexOf('-') !== 0)
  5637. ? gapSrc.textContent.trim() : '¥ —';
  5638. if (gapSubEl) {
  5639. // 缺口占需求比(需求 = 已配 + 缺口 的粗口径提示)
  5640. const gapNum = gapSrc ? parseFloat(gapSrc.textContent.replace(/[^0-9.]/g,'')) || 0 : 0;
  5641. gapSubEl.textContent = gapNum > 0 ? '7 险种 · 需补足' : (insuredWan > 0 ? '已基本配齐' : '需求 − 现有');
  5642. }
  5643. document.getElementById('v01FcRetire').textContent = retireAge > 0
  5644. ? retireAge + ' 岁(还 ' + yearsToRetire + ' 年)'
  5645. : '—';
  5646. document.getElementById('v01FcRetireSub').textContent = monthlySpend > 0
  5647. ? '月支出 ¥' + (monthlySpend >= 10 ? Math.round(monthlySpend) : monthlySpend.toFixed(1)) + '万 · ' + (lifeExp || 95) + ' 岁寿期'
  5648. : '寿期 ' + (lifeExp || 95) + ' 岁';
  5649. // ─── 资产 4 盘 chip 行 ───
  5650. const assetChips = [];
  5651. if (liquid > 0) assetChips.push({icon:'💧', label:'流动资产', val:_fmtWan(liquid)});
  5652. if (house > 0) assetChips.push({icon:'🏠', label:'自住房产', val:_fmtWan(house)});
  5653. if (invest > 0) assetChips.push({icon:'🏛', label:'其他投资', val:_fmtWan(invest)});
  5654. if (overseasWan > 0) assetChips.push({icon:'🌏', label:'境外资产', val:_fmtWan(overseasWan)});
  5655. document.getElementById('v01FcAssets').innerHTML = assetChips.map(function(c){
  5656. return '<div class="v01-fc-asset-chip">' +
  5657. '<span class="v01-fc-asset-chip-icon">' + c.icon + '</span>' +
  5658. '<span>' + c.label + '</span>' +
  5659. '<span class="v01-fc-asset-chip-val">' + c.val + '</span>' +
  5660. '</div>';
  5661. }).join('');
  5662. // ─── 7 险种保单网格 ───
  5663. const exAcc = _num('existingAccident');
  5664. const hasMed = _v('existingMed') === '1';
  5665. const exCI = _num('existingCI');
  5666. const exLife= _num('existingLife');
  5667. const exEdu = _num('existingEduInsurance');
  5668. const exRet = _num('existingRetirement');
  5669. const exWl = _num('existingWholeLife');
  5670. const policies = [
  5671. {icon:'⚡', name:'意外险', val: exAcc > 0 ? _fmtWan(exAcc) : '未配置', has: exAcc > 0},
  5672. {icon:'🏥', name:'医疗险', val: hasMed ? '✓ ¥800万' : '未配置', has: hasMed},
  5673. {icon:'🩺', name:'重疾险', val: exCI > 0 ? _fmtWan(exCI) : '未配置', has: exCI > 0},
  5674. {icon:'🛡', name:'定期寿险', val: exLife > 0 ? _fmtWan(exLife) : '未配置', has: exLife > 0},
  5675. {icon:'🎓', name:'教育金', val: exEdu > 0 ? _fmtWan(exEdu) : '未配置', has: exEdu > 0},
  5676. {icon:'💰', name:'养老金', val: exRet > 0 ? _fmtWan(exRet) : '未配置', has: exRet > 0},
  5677. {icon:'💎', name:'终身寿险', val: exWl > 0 ? _fmtWan(exWl) : '未配置', has: exWl > 0}
  5678. ];
  5679. document.getElementById('v01FcPolicies').innerHTML = policies.map(function(p){
  5680. const cls = p.has ? 'v01-fc-policy is-covered' : 'v01-fc-policy is-empty';
  5681. return '<div class="' + cls + '">' +
  5682. '<div class="v01-fc-policy-icon">' + p.icon + '</div>' +
  5683. '<div class="v01-fc-policy-name">' + p.name + '</div>' +
  5684. '<div class="v01-fc-policy-val">' + p.val + '</div>' +
  5685. '</div>';
  5686. }).join('');
  5687. // ─── CFPI 保障完整度金环仪表盘 ───
  5688. // [2026-07-12] 得分已由 renderClientSummary() 先算好写入 csMetricScore/csMetricScoreLabel
  5689. // (调用顺序:calculate() 内 renderClientSummary 在 v01UpdateFamilyCard 之前),此处读取渲染
  5690. (function renderCfpiGauge() {
  5691. const scoreEl = document.getElementById('csMetricScore');
  5692. const labelEl = document.getElementById('csMetricScoreLabel');
  5693. const numEl = document.getElementById('v01CfpiNum');
  5694. const ringEl = document.getElementById('v01CfpiRingFill');
  5695. const badgeEl = document.getElementById('v01CfpiBadge');
  5696. const descEl = document.getElementById('v01CfpiDesc');
  5697. if (!numEl || !ringEl || !badgeEl) return;
  5698. // 从已渲染节点解析 0-10 得分(csMetricScore innerHTML 形如 "7.8 <span>/ 10</span>")
  5699. let score = 0;
  5700. if (scoreEl) {
  5701. const m = (scoreEl.textContent || '').match(/[\d.]+/);
  5702. if (m) score = parseFloat(m[0]) || 0;
  5703. }
  5704. const scoreLabel = labelEl ? (labelEl.textContent || '').trim() : '';
  5705. // 数字 + 环填充(周长 2π×44 ≈ 276.46)
  5706. numEl.textContent = score.toFixed(1);
  5707. const CIRC = 276.46;
  5708. ringEl.setAttribute('stroke-dasharray', CIRC.toFixed(1));
  5709. ringEl.setAttribute('stroke-dashoffset', (CIRC * (1 - Math.min(1, score / 10))).toFixed(1));
  5710. // 徽章文案 + 配色档(优秀/良好=绿 · 及格/待补齐=琥珀 · 待启动=红)
  5711. badgeEl.textContent = scoreLabel || '— 待评';
  5712. badgeEl.classList.remove('is-warn', 'is-bad');
  5713. if (score < 4.0) badgeEl.classList.add('is-bad');
  5714. else if (score < 7.0) badgeEl.classList.add('is-warn');
  5715. // 一句话描述(复用最大缺口险种,若已配齐则鼓励)
  5716. if (descEl) {
  5717. const maxGapEl = document.getElementById('csMetricMaxGap');
  5718. const maxGapName = maxGapEl ? (maxGapEl.textContent || '').trim() : '';
  5719. if (maxGapName && maxGapName !== '已配齐' && maxGapName !== '—') {
  5720. descEl.textContent = '最大风险敞口:' + maxGapName;
  5721. } else if (score > 0) {
  5722. descEl.textContent = '7 险种基本配齐 · 定期复盘即可';
  5723. }
  5724. }
  5725. })();
  5726. // 显示卡片(默认 display:none · 只有数据填充后才显示)
  5727. if (totalIncome > 0 || totalWealth > 0 || age > 0) {
  5728. card.style.display = 'block';
  5729. }
  5730. }
  5731. function setBars(prefix, existing, gap, total) {
  5732. if (!total) total = 1;
  5733. const eP = Math.min(100, (existing / total) * 100);
  5734. const gP = Math.min(100 - eP, (gap / total) * 100);
  5735. document.getElementById(prefix + 'BarExist').style.width = eP + '%';
  5736. document.getElementById(prefix + 'BarGap').style.width = gP + '%';
  5737. }
  5738. /* === 缺口状态图标渲染(v2026-06-13) ===
  5739. 逻辑:
  5740. - 总额 ≤ 0(无需求):自动 covered ✓
  5741. - 缺口 = 0(已配齐):covered ✓
  5742. - 缺口 ≤ 30% 总额(部分缺口):gap-partial ⚠
  5743. - 缺口 > 30% 总额(大缺口):gap-large ❗ + 脉冲动画
  5744. */
  5745. function renderPolicyStatus(prefix, existing, gap, total) {
  5746. const el = document.getElementById(prefix + 'Status');
  5747. if (!el) return;
  5748. let status, label, title;
  5749. if (!total || total <= 0) {
  5750. status = 'na'; label = '— 不需要'; title = '该成员当前无配置需求';
  5751. } else if (gap <= 0 || existing >= total * 0.95) {
  5752. status = 'covered'; label = '✓ 已配齐'; title = '配置充足(覆盖率 ≥ 95%)';
  5753. } else if (existing >= total * 0.5) {
  5754. const pct = Math.round((1 - existing / total) * 100);
  5755. status = 'gap-partial'; label = '⚡ 缺 ' + pct + '%'; title = '部分缺口 · 建议补足';
  5756. } else {
  5757. const pct = Math.round((1 - existing / total) * 100);
  5758. status = 'gap-large'; label = '⚠ 缺 ' + pct + '%'; title = '大缺口 · 优先配置';
  5759. }
  5760. el.className = 'pc-status ' + status;
  5761. el.textContent = label;
  5762. el.title = title;
  5763. // P3.1 · 100% 覆盖卡片默认折叠 + 点击切换展开
  5764. // [v4.8 · 2026-06-26 修正] 改为"所有 7 张卡片默认折叠",而非仅 covered 卡片
  5765. // 客户点击 card → 展开;再次点击 → 折叠;userExpanded 标记防止重渲染重置
  5766. const card = el.closest('.policy-card');
  5767. if (card) {
  5768. // 默认全部折叠(除非用户已手动展开)
  5769. if (card.dataset.userExpanded !== '1') {
  5770. card.classList.add('is-collapsed');
  5771. }
  5772. // 一次性绑定 click 切换(每张卡片只绑一次)
  5773. if (!card.dataset.toggleBound) {
  5774. card.dataset.toggleBound = '1';
  5775. card.addEventListener('click', (ev) => {
  5776. // 排除内部 Tab / 按钮 / 链接 等可交互元素的冒泡触发
  5777. if (ev.target.closest('.life-track-tab,.cell-gap-cta,.hnw-toggle,.hnw-detail-body,a,button,input,select,textarea')) return;
  5778. const wasCollapsed = card.classList.contains('is-collapsed');
  5779. card.classList.toggle('is-collapsed');
  5780. // 用户主动展开 → 标记,避免下次重渲染又被折叠
  5781. card.dataset.userExpanded = wasCollapsed ? '1' : '';
  5782. });
  5783. }
  5784. }
  5785. }
  5786. /* === v2026-06-13 v1.4 · P2.1 · 年缴保费 donut 圆环图 === */
  5787. function renderPremiumDonut(p) {
  5788. const card = document.getElementById('premiumAllocCard');
  5789. if (!card) return;
  5790. // [v4.8 · 2026-06-26] show/hide 由 wrap(全宽白带容器)接管,避免空白带
  5791. const wrap = document.getElementById('premiumAllocWrap') || card;
  5792. const total = p.total || 0;
  5793. if (total <= 0) { wrap.style.display = 'none'; return; }
  5794. wrap.style.display = 'block';
  5795. card.style.display = 'grid';
  5796. // 7 险种 + 颜色映射(对齐金字塔 5 色调色板:基础红 / 中端金&橙&绿 / 高端紫)
  5797. const items = [
  5798. { key: 'acc', name: '⚡ 意外险', val: p.acc || 0, tier: 'base', color: '#D54E42' },
  5799. { key: 'med', name: '🏥 医疗险', val: p.med || 0, tier: 'base', color: '#E07A3B' },
  5800. { key: 'ci', name: '⚕ 重疾险', val: p.ci || 0, tier: 'base', color: '#A6121C' },
  5801. { key: 'retire', name: '💰 养老年金', val: p.retire || 0, tier: 'mid', color: '#4FA672' },
  5802. { key: 'edu', name: '🎓 教育年金', val: p.edu || 0, tier: 'mid', color: '#E5BB3D' },
  5803. { key: 'life', name: '🛡 定期寿险', val: p.life || 0, tier: 'mid', color: '#E48A35' },
  5804. { key: 'wl', name: '💎 终身寿险', val: p.wl || 0, tier: 'high', color: '#7A3FA0' }
  5805. ];
  5806. // 中心数字
  5807. document.getElementById('paCenterNum').textContent = '¥' + (total / 10000).toFixed(1) + '万';
  5808. document.getElementById('paCenterSub').textContent = '7 险种合计 · 年缴';
  5809. // SVG donut(viewBox 220x220, 圆心 110, 外径 90, 内径 60)
  5810. const svg = document.getElementById('premiumDonutSvg');
  5811. const cx = 110, cy = 110, R = 90, r = 60;
  5812. let startAngle = -Math.PI / 2; // 从 12 点钟方向起
  5813. const slices = items.map(it => {
  5814. if (it.val <= 0) return null;
  5815. const frac = it.val / total;
  5816. const endAngle = startAngle + frac * Math.PI * 2;
  5817. // donut 切片:外圆弧(R) + 内圆弧(r 反向)
  5818. const x1o = cx + R * Math.cos(startAngle), y1o = cy + R * Math.sin(startAngle);
  5819. const x2o = cx + R * Math.cos(endAngle), y2o = cy + R * Math.sin(endAngle);
  5820. const x1i = cx + r * Math.cos(endAngle), y1i = cy + r * Math.sin(endAngle);
  5821. const x2i = cx + r * Math.cos(startAngle), y2i = cy + r * Math.sin(startAngle);
  5822. const largeArc = frac > 0.5 ? 1 : 0;
  5823. 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`;
  5824. const pct = Math.round(frac * 100);
  5825. const result = { path, color: it.color, pct, ...it };
  5826. startAngle = endAngle;
  5827. return result;
  5828. }).filter(Boolean);
  5829. svg.innerHTML = `
  5830. <defs>
  5831. <filter id="paShadow" x="-10%" y="-10%" width="120%" height="120%">
  5832. <feGaussianBlur in="SourceAlpha" stdDeviation="2"/>
  5833. <feOffset dx="0" dy="2"/>
  5834. <feComponentTransfer><feFuncA type="linear" slope="0.18"/></feComponentTransfer>
  5835. <feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge>
  5836. </filter>
  5837. </defs>
  5838. <g filter="url(#paShadow)">
  5839. ${slices.map(s => `<path d="${s.path}" fill="${s.color}" stroke="#fff" stroke-width="1.5"/>`).join('')}
  5840. </g>
  5841. `;
  5842. // 三层 tier 占比
  5843. const tierSum = { base: 0, mid: 0, high: 0 };
  5844. items.forEach(it => { tierSum[it.tier] += it.val; });
  5845. const tierPills = [
  5846. { id: 'base', emoji: '🟧', name: '基础', val: tierSum.base },
  5847. { id: 'mid', emoji: '🟨', name: '中端', val: tierSum.mid },
  5848. { id: 'high', emoji: '🟡', name: '高端', val: tierSum.high }
  5849. ];
  5850. document.getElementById('paTierSummary').innerHTML = tierPills.map(t => {
  5851. const pct = Math.round((t.val / total) * 100);
  5852. return `<span class="pa-tier-pill ptp-${t.id}">
  5853. <span class="ptp-emoji">${t.emoji}</span>
  5854. <span>${t.name}</span>
  5855. <span class="ptp-pct">${pct}%</span>
  5856. </span>`;
  5857. }).join('');
  5858. // 7 险种图例(按金额降序)
  5859. const legendItems = items.slice().sort((a, b) => b.val - a.val);
  5860. document.getElementById('paLegend').innerHTML = legendItems.map(it => {
  5861. const pct = Math.round((it.val / total) * 100);
  5862. return `<div class="pa-legend-item">
  5863. <span class="pa-legend-dot" style="background:${it.color}"></span>
  5864. <span class="pa-legend-name">${it.name}</span>
  5865. <span class="pa-legend-pct">${pct}%</span>
  5866. </div>`;
  5867. }).join('');
  5868. }
  5869. /* === 配置优先级渲染(v3.0 · 7 险种 · v1.1 去掉护理险/满期金)·按金字塔层 + 缺口规模排序 === */
  5870. function renderPriorityTimeline(d) {
  5871. const list = document.getElementById('priorityList');
  5872. if (!list) return;
  5873. // v3.0 · 7 险种数据汇总(标 tier · 基础层优先 P0,中端 P1,高端 P2)
  5874. const policies = [
  5875. // 🟧 基础风险层(进/防 · 没钱)
  5876. {
  5877. key: 'acc', icon: '⚡', name: '意外险', tier: 'base',
  5878. gap: d.accGap, total: d.accNeed,
  5879. action: '<strong>百万意外险</strong> · 高保额低保费(年支出 × 5)· 综合意外身故/伤残 · 1500-3000 元/年 · 30 天内激活'
  5880. },
  5881. {
  5882. key: 'med', icon: '🏥', name: '医疗险', tier: 'base',
  5883. gap: d.medGap, total: d.medNeed,
  5884. action: '<strong>国际医疗险</strong> · 覆盖境内顶级私立 + 海外医疗 · 800 万保额年缴 ¥1.8-3.5 万 · 30 天内激活'
  5885. },
  5886. {
  5887. key: 'ci', icon: '⚕', name: '重疾险', tier: 'base',
  5888. gap: d.ciGap, total: d.ciNeed,
  5889. action: '<strong>5 年康复期收入替代</strong> · 终身重疾险 ¥' + Math.round(d.ciNeed || 0) + '万(年龄锁定 30 年缴期)· 黄金窗口期(年龄 < 45)· 90 天内完成核保'
  5890. },
  5891. // 🟨 中端风险层(出/增 · 花钱)
  5892. {
  5893. key: 'life', icon: '🛡', name: '定期寿险', tier: 'mid',
  5894. gap: d.lifeGap, total: d.lifeNeed,
  5895. action: d.isHNW
  5896. ? '<strong>HNW 双轨配置</strong> · 境内增额终身寿 ¥3-5 亿(64 岁前为最后投保窗口)+ 境外 PPLI ¥XX 亿装入股权(持牌跨境通道)· 90 天内启动'
  5897. : '<strong>定期寿险</strong> · ¥' + Math.round(d.lifeNeed || 0) + '万(主理人收入替代 · 30 年缴期)· 受益人单一指定 · 6 个月内完成投保'
  5898. },
  5899. {
  5900. key: 'edu', icon: '🎓', name: '教育年金', tier: 'mid',
  5901. gap: d.eduGap, total: d.eduNeed,
  5902. action: '<strong>美元教育金分红险</strong> · 香港分红型(5/15/25/35 阶梯领取)· 子女 < 10 岁是最佳起点 · 12 月内启动'
  5903. },
  5904. {
  5905. key: 'retire', icon: '🌅', name: '养老年金', tier: 'mid',
  5906. gap: d.retireGap, total: d.retireNeed,
  5907. action: '<strong>美元增额年金险</strong> · 香港分红型养老 · 退休前 5-10 年是黄金缴费期 · 通胀对冲 + 终身现金流 · 12-24 月内启动'
  5908. },
  5909. // 🟡 高端风险层(保/传 · 留钱)
  5910. {
  5911. key: 'wl', icon: '💎', name: '终身寿险', tier: 'high',
  5912. gap: d.wlGap, total: d.wlNeed,
  5913. action: '<strong>增额终身寿 / PPLI / IUL / VUL</strong> · 总资产 × 30% 传承隔离 · 装入家族信托 · 跨代受益 · 24-36 月内规划'
  5914. }
  5915. ];
  5916. // 按 tier 优先级 + 缺口规模排序
  5917. const tierWeight = { base: 0, mid: 1, high: 2 };
  5918. const sorted = policies.sort((a, b) => {
  5919. if (a.gap <= 0 && b.gap > 0) return 1;
  5920. if (b.gap <= 0 && a.gap > 0) return -1;
  5921. if (a.gap > 0 && b.gap > 0) {
  5922. // 都有缺口:基础层 > 中端层 > 高端层
  5923. if (tierWeight[a.tier] !== tierWeight[b.tier]) return tierWeight[a.tier] - tierWeight[b.tier];
  5924. return b.gap - a.gap;
  5925. }
  5926. return 0;
  5927. });
  5928. // 自动分档:P0(缺口最大 1-2 项) / P1(中等 2 项) / P2(小缺口) / 已完成
  5929. function fmtAmount(wan) {
  5930. if (wan <= 0) return '已配齐';
  5931. if (wan >= 10000) return '¥' + parseFloat((wan/10000).toFixed(2)) + '亿';
  5932. return '¥' + Math.round(wan) + '万';
  5933. }
  5934. const totalGap = sorted.reduce((s, p) => s + Math.max(0, p.gap), 0);
  5935. let cumulative = 0;
  5936. let rank = 1;
  5937. list.innerHTML = sorted.map((p) => {
  5938. let tier, tierLabel;
  5939. if (p.gap <= 0) {
  5940. tier = 'done'; tierLabel = '已完成';
  5941. } else {
  5942. // 取缺口前 50% 总缺口的 = P0,前 80% 的 = P1,其余 = P2
  5943. cumulative += p.gap;
  5944. const ratio = cumulative / totalGap;
  5945. if (rank <= 2 && ratio <= 0.7) tier = 'p0';
  5946. else if (ratio <= 0.95) tier = 'p1';
  5947. else tier = 'p2';
  5948. }
  5949. const rankDisplay = p.gap <= 0 ? '✓' : rank;
  5950. if (p.gap > 0) rank++;
  5951. const tierLabelMap = { p0: 'P0 紧急', p1: 'P1 重要', p2: 'P2 常规', done: '已完成' };
  5952. const action = p.gap <= 0
  5953. ? '<strong>已配齐</strong> · 建议每年保单复盘 1 次 · 跟家庭资产再平衡同步'
  5954. : p.action;
  5955. const amountClass = p.gap <= 0 ? 'pi-amount done' : 'pi-amount';
  5956. return `<div class="priority-item ${tier}">
  5957. <div class="pi-rank ${tier}">
  5958. <span class="pi-rank-num">${rankDisplay}</span>
  5959. ${tierLabelMap[tier]}
  5960. </div>
  5961. <div class="pi-icon-wrap">${p.icon}</div>
  5962. <div class="pi-content">
  5963. <div class="pi-name">${p.name}缺口 <span class="${amountClass}">${fmtAmount(p.gap)}</span></div>
  5964. <div class="pi-action">${action}</div>
  5965. </div>
  5966. </div>`;
  5967. }).join('');
  5968. }
  5969. /* === HNW 寿险卡境内/境外 Tab 切换 === */
  5970. function switchLifeTrack(track, el) {
  5971. document.querySelectorAll('.life-track-tab').forEach(t => t.classList.remove('active'));
  5972. document.querySelectorAll('.life-track-pane').forEach(p => p.classList.remove('active'));
  5973. if (el) el.classList.add('active');
  5974. document.getElementById(track === 'domestic' ? 'lifeTrackDomestic' : 'lifeTrackOverseas').classList.add('active');
  5975. }
  5976. /* === v3.1 · 终身寿险卡境内/境外双轨详情折叠开关 === */
  5977. function toggleHnwTabs(headerEl) {
  5978. // event 冒泡阻止 — 避免触发外层 P3.1 卡片折叠
  5979. if (window.event) window.event.stopPropagation();
  5980. const wrap = document.getElementById('hnwTabsWrap');
  5981. if (!wrap) return;
  5982. const collapsed = wrap.getAttribute('data-collapsed') === '1';
  5983. const arrow = headerEl ? headerEl.querySelector('.hnw-toggle-arrow') : null;
  5984. const hint = headerEl ? headerEl.querySelector('.hnw-toggle-hint') : null;
  5985. const body = wrap.querySelector('.hnw-detail-body');
  5986. if (collapsed) {
  5987. wrap.setAttribute('data-collapsed', '0');
  5988. if (body) body.style.display = 'block';
  5989. if (arrow) arrow.style.transform = 'rotate(90deg)';
  5990. if (hint) hint.textContent = '点击收起';
  5991. } else {
  5992. wrap.setAttribute('data-collapsed', '1');
  5993. if (body) body.style.display = 'none';
  5994. if (arrow) arrow.style.transform = 'rotate(0deg)';
  5995. if (hint) hint.textContent = '点击展开';
  5996. }
  5997. }
  5998. /* === v3.2 · 金字塔体检卡渲染(7 险种水位动画驱动)=== */
  5999. function renderCalcPyramidCheck(d) {
  6000. // v3.2 · 接受 7 险种 each {need, existing}, 派生 7 险种 coverage + 三层平均
  6001. const cov = (n, e) => n > 0 ? Math.min(1, (e || 0) / n) : 0;
  6002. const c = {
  6003. acc: cov(d.acc.need, d.acc.existing),
  6004. med: cov(d.med.need, d.med.existing),
  6005. ci: cov(d.ci.need, d.ci.existing),
  6006. life: cov(d.life.need, d.life.existing),
  6007. edu: cov(d.edu.need, d.edu.existing),
  6008. retire: cov(d.retire.need, d.retire.existing),
  6009. wl: cov(d.wl.need, d.wl.existing)
  6010. };
  6011. // 派生三层平均覆盖率(用于诊断阈值 + score · 加权聚合各层险种)
  6012. const sumNeed = (...arr) => arr.reduce((s,x) => s + (x.need || 0), 0);
  6013. const sumExist = (...arr) => arr.reduce((s,x) => s + (x.existing || 0), 0);
  6014. const baseNeed = sumNeed(d.acc, d.med, d.ci);
  6015. const baseExist = sumExist(d.acc, d.med, d.ci);
  6016. const midNeed = sumNeed(d.life, d.edu, d.retire);
  6017. const midExist = sumExist(d.life, d.edu, d.retire);
  6018. const highNeed = sumNeed(d.wl);
  6019. const highExist = sumExist(d.wl);
  6020. const baseCov = baseNeed > 0 ? Math.min(1, baseExist / baseNeed) : 0;
  6021. const midCov = midNeed > 0 ? Math.min(1, midExist / midNeed) : 0;
  6022. const highCov = highNeed > 0 ? Math.min(1, highExist / highNeed) : 0;
  6023. // v1.4 · 同步三层 banner 进度条(P1.2 · 与右侧 tier-rows 数据同源)
  6024. ['base', 'mid', 'high'].forEach(tier => {
  6025. const layerCov = tier === 'base' ? baseCov : tier === 'mid' ? midCov : highCov;
  6026. const pct = Math.round(layerCov * 100);
  6027. const cap = tier.charAt(0).toUpperCase() + tier.slice(1);
  6028. const fillEl = document.getElementById('tb' + cap + 'Fill');
  6029. const pctEl = document.getElementById('tb' + cap + 'Pct');
  6030. const iconEl = document.getElementById('tb' + cap + 'Icon');
  6031. if (fillEl) fillEl.style.width = pct + '%';
  6032. if (pctEl) pctEl.textContent = pct + '%';
  6033. if (iconEl) {
  6034. const icon = pct >= 60 ? '✓' : pct >= 30 ? '⚡' : '⚠';
  6035. const color = pct >= 60 ? '#2D6A4F' : pct >= 30 ? '#8B6F1A' : '#A6121C';
  6036. iconEl.textContent = icon;
  6037. iconEl.style.color = color;
  6038. }
  6039. });
  6040. // 倒金字塔四档诊断(与 cy-policy-meta.js 阈值一致)
  6041. let level, color, bg, icon, message, diagnosis;
  6042. if (baseCov < 0.10 && highCov > 0.80) {
  6043. level='severe'; color='#8B0000'; bg='#FBE3E3'; icon='🚨';
  6044. message='严重倒金字塔'; diagnosis='底层完全空虚 + 顶层重金投入 · 极不平衡 · 建议立即补充基础层';
  6045. } else if (baseCov < 0.30 && highCov > 0.50) {
  6046. level='warning'; color='#D32F2F'; bg='#FCE4E4'; icon='⚠️';
  6047. message='倒金字塔风险'; diagnosis='底层薄弱 + 顶层偏重 · 结构倒置 · 建议先夯实基础';
  6048. } else if (baseCov < 0.50) {
  6049. level='caution'; color='#F9A825'; bg='#FFF8E1'; icon='⚡';
  6050. message='底层偏弱'; diagnosis='基础层未达健康线(50%)· 建议优先补充意外/医疗/重疾';
  6051. } else if (baseCov >= 0.60 && midCov >= 0.30) {
  6052. level='healthy'; color='#2E7D32'; bg='#E8F5E9'; icon='✅';
  6053. message='结构合理'; diagnosis='金字塔结构合理 · 各层覆盖均衡';
  6054. } else {
  6055. level='neutral'; color='#9E9E9E'; bg='#F5F5F5'; icon='○';
  6056. message='中性'; diagnosis='覆盖度数据已收集 · 等待诊断';
  6057. }
  6058. // v3.2 · SVG 三角形渲染(传 7 险种 coverage 驱动水位动画)
  6059. renderCalcPyramidSvg(c);
  6060. // 标题徽章
  6061. const badge = document.getElementById('pccLabelBadge');
  6062. badge.textContent = icon + ' ' + message;
  6063. badge.style.background = bg;
  6064. badge.style.color = color;
  6065. badge.style.border = '1px solid ' + color;
  6066. // 三层覆盖率行(v2.1 倒序:high → mid → base · 与左侧金字塔层级对齐)
  6067. // [2026-07-16] 上方金字塔右侧改用下方 FAV 同款 rtier-group 胶囊卡风格(彩色边框块 + 药丸标签 + 内嵌 gap 明细常显)
  6068. const RTIER_CAP = {
  6069. high: { short:'高端', desc:'传承 · 终身寿', cov:highCov, c:'#7A3FA0', bg:'rgba(122,63,160,.09)', bd:'rgba(122,63,160,.35)' },
  6070. mid: { short:'中端', desc:'保钱 · 定寿/教育/养老', cov:midCov, c:'#C48A1E', bg:'rgba(196,138,30,.10)', bd:'rgba(196,138,30,.38)' },
  6071. base: { short:'基础', desc:'保命 · 意外/医疗/重疾', cov:baseCov, c:'#D54E42', bg:'rgba(213,78,66,.08)', bd:'rgba(213,78,66,.35)' }
  6072. };
  6073. document.getElementById('pccTierRows').innerHTML = ['high','mid','base'].map(rt => {
  6074. const t = RTIER_CAP[rt];
  6075. const pct = Math.round((t.cov || 0) * 100);
  6076. const inner = (window.favTierDetailHTML ? window.favTierDetailHTML(rt) : '');
  6077. // [2026-07-16] 头部常显该层覆盖率进度条;点击展开各险种明细(.rtier-body 默认折叠)
  6078. 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>`;
  6079. }).join('');
  6080. // 头部覆盖率进度条涨条动画(明细内的 gap-fill 在展开时才动画)
  6081. requestAnimationFrame(() => setTimeout(() => {
  6082. document.querySelectorAll('#pccTierRows .rtier-cov-fill').forEach(el => { el.style.width = el.dataset.w + '%'; });
  6083. }, 60));
  6084. // 诊断框
  6085. const diagBox = document.getElementById('pccDiagnosis');
  6086. diagBox.style.background = bg;
  6087. diagBox.style.borderLeftColor = color;
  6088. diagBox.style.color = color;
  6089. document.getElementById('pccDiagMsg').textContent = icon + ' ' + message;
  6090. document.getElementById('pccDiagText').textContent = diagnosis;
  6091. document.getElementById('pccDiagText').style.color = 'var(--text)';
  6092. // 评分(0-10 加权 · 高若楠 6-24 反馈重构 · 60 分基线 + 加分项)
  6093. // [v4.8 · 2026-06-26] 旧算法:加权平均 × 10 → 客户买了 50 万重疾被评 0.4 / 10,打击客户
  6094. // 新算法:hasAnyExisting → 6.0 起评(对齐"已买保险都 60+"业务直觉)
  6095. // + 各层覆盖率 bonus(基础 1.5 / 中端 1.0 / 高端 0.8)
  6096. // + 险种均衡度 bonus(配齐 > 3 险种,每多 1 项加 0.1)
  6097. const hasAnyExisting = (baseCov + midCov + highCov) > 0;
  6098. const baseline = hasAnyExisting ? 6.0 : 2.0;
  6099. const baseBonus = baseCov * 1.5;
  6100. const midBonus = midCov * 1.0;
  6101. const highBonus = highCov * 0.8;
  6102. // 险种均衡度:统计已配置险种数(existing > 0)
  6103. const existingPolicyCount = [d.acc, d.med, d.ci, d.life, d.edu, d.retire, d.wl]
  6104. .filter(p => p && p.existing > 0).length;
  6105. const balancedBonus = Math.max(0, Math.min(0.4, (existingPolicyCount - 3) * 0.1));
  6106. const rawScore = baseline + baseBonus + midBonus + highBonus + balancedBonus;
  6107. const score = Math.min(10, Math.round(rawScore * 10) / 10);
  6108. document.getElementById('pccScoreNum').innerHTML = score + '<span class="pcc-ss-suffix">/ 10</span>';
  6109. }
  6110. /* === v3.2.1 · 金字塔工具开关持久化 + 缓存最近数据 === */
  6111. let _lastCalcCoverages = null;
  6112. // [2026-07-16] 上方金字塔 rtier-group 胶囊卡:点击头部折叠/展开该层险种明细(默认隐藏)
  6113. function toggleRtierGroup(capEl) {
  6114. const group = capEl.closest('.rtier-group');
  6115. if (!group) return;
  6116. const open = group.classList.toggle('is-open');
  6117. if (open) {
  6118. // 展开后触发缺口条涨条动画
  6119. requestAnimationFrame(() => setTimeout(() => {
  6120. group.querySelectorAll('.gap-fill').forEach(el => { el.style.width = el.dataset.w + '%'; });
  6121. }, 40));
  6122. }
  6123. }
  6124. // [2026-07-12] 金字塔三层行点击展开:懒加载该层各险种明细缺口条(调 fav 模块 favTierDetailHTML)
  6125. function togglePccTierDetail(rtier, rowEl) {
  6126. const detail = document.getElementById('pccTierDetail-' + rtier);
  6127. if (!detail) return;
  6128. const open = detail.classList.contains('is-open');
  6129. if (open) {
  6130. detail.classList.remove('is-open');
  6131. rowEl.classList.remove('is-expanded');
  6132. return;
  6133. }
  6134. // 懒加载明细(每次展开都重新取,保证跟随最新计算)
  6135. if (window.favTierDetailHTML) {
  6136. try { detail.innerHTML = window.favTierDetailHTML(rtier); }
  6137. catch (e) { detail.innerHTML = '<div class="fav-note">明细加载失败</div>'; }
  6138. } else {
  6139. detail.innerHTML = '<div class="fav-note">明细模块未就绪,请重新计算</div>';
  6140. }
  6141. detail.classList.add('is-open');
  6142. rowEl.classList.add('is-expanded');
  6143. // 展开后触发缺口条动画
  6144. requestAnimationFrame(() => setTimeout(() => {
  6145. detail.querySelectorAll('.gap-fill').forEach(el => { el.style.width = el.dataset.w + '%'; });
  6146. }, 40));
  6147. }
  6148. function _calcPyramidPref(key, def) {
  6149. const v = localStorage.getItem('cy_calc_pyramid_' + key);
  6150. if (v === null) return def;
  6151. return v === '1';
  6152. }
  6153. function initCalcPyramidToggles() {
  6154. const root = document.querySelector('.pyramid-controls[data-card="cy_calc"]');
  6155. if (!root) return;
  6156. // v3.3.2 · 简化 label · 仅保留 emoji + 状态(节省横向空间)
  6157. const LBL = {
  6158. anim: { on: '💧 实际', off: '💧 满覆盖' },
  6159. stereo: { on: '🎨 3D', off: '🎨 平面' }
  6160. };
  6161. const setLabel = (btn, key, on) => {
  6162. const el = btn.querySelector('.tg-label');
  6163. if (el && LBL[key]) el.textContent = on ? LBL[key].on : LBL[key].off;
  6164. };
  6165. root.querySelectorAll('.pc-toggle').forEach(btn => {
  6166. const key = btn.getAttribute('data-key');
  6167. const on = _calcPyramidPref(key, true);
  6168. btn.setAttribute('data-on', on ? '1' : '0');
  6169. setLabel(btn, key, on);
  6170. if (btn.dataset.bound) return;
  6171. btn.dataset.bound = '1';
  6172. btn.addEventListener('click', () => {
  6173. const newOn = btn.getAttribute('data-on') === '1' ? '0' : '1';
  6174. btn.setAttribute('data-on', newOn);
  6175. setLabel(btn, key, newOn === '1');
  6176. localStorage.setItem('cy_calc_pyramid_' + key, newOn);
  6177. // v3.3.1 · 立刻重渲染 · 即使 _lastCalcCoverages 为空也用默认值演示一遍
  6178. const cov = _lastCalcCoverages || { wl:0.55, retire:0.40, edu:0.35, life:0.65, acc:0.85, med:0.75, ci:0.55 };
  6179. renderCalcPyramidSvg(cov);
  6180. });
  6181. });
  6182. }
  6183. function renderCalcPyramidSvg(coverages) {
  6184. const svg = document.getElementById('calcPyramidSvg');
  6185. if (!svg) return;
  6186. _lastCalcCoverages = coverages;
  6187. // v3.3 · 读取用户偏好(动画 / 立体感)
  6188. const animOn = _calcPyramidPref('anim', true);
  6189. const stereoOn = _calcPyramidPref('stereo', true);
  6190. // 确保 toggle 状态条已绑定
  6191. initCalcPyramidToggles();
  6192. // viewBox 480×450 · 顶部标题 y=10-60 · 金字塔 y=70-420
  6193. svg.setAttribute('viewBox', '0 0 480 450');
  6194. const cl = (v) => Math.min(1, Math.max(0, v || 0));
  6195. // ═══════════════════════════════════════════════════════════════
  6196. // v3.3.2 · 单套居中几何 · 立体感通过装饰层(金色 rim + 阴影线 + 烟雾粒子) 营造
  6197. // apex (240,70), 主面底 40-440 等腰三角形居中
  6198. // 立体 ON: 在层间绘制金色高光线 + 阴影线模拟"大理石阶梯"厚度感 + 烟雾氛围
  6199. // ═══════════════════════════════════════════════════════════════
  6200. let sideSegments = []; // v3.3.2 · 不再使用侧面
  6201. let edgePts = []; // v3.3.2 · 不再使用棱线
  6202. let segments = [
  6203. { key:'wl', label:'终身寿险', cov:cl(coverages.wl),
  6204. yT:70, yB:205, polygon:'240,70 317,205 163,205',
  6205. grad:'L1G', labelX:240, labelY:178, pctY:196, cx:240, cy:160 },
  6206. { key:'retire', label:'养老年金', cov:cl(coverages.retire),
  6207. yT:205, yB:260, polygon:'163,205 317,205 349,260 131,260',
  6208. grad:'L2G', labelX:240, labelY:228, pctY:248, cx:240, cy:232 },
  6209. { key:'edu', label:'教育年金', cov:cl(coverages.edu),
  6210. yT:260, yB:315, polygon:'131,260 349,260 380,315 100,315',
  6211. grad:'L3G', labelX:240, labelY:283, pctY:303, cx:240, cy:287 },
  6212. { key:'life', label:'定期寿险', cov:cl(coverages.life),
  6213. yT:315, yB:370, polygon:'100,315 380,315 411,370 69,370',
  6214. grad:'L4G', labelX:240, labelY:338, pctY:358, cx:240, cy:342 },
  6215. { key:'acc', label:'意外险', cov:cl(coverages.acc),
  6216. yT:370, yB:420, polygon:'69,370 183,370 173,420 40,420',
  6217. grad:'L5G', labelX:116, labelY:392, pctY:411, cx:116, cy:395 },
  6218. { key:'med', label:'医疗险', cov:cl(coverages.med),
  6219. yT:370, yB:420, polygon:'183,370 297,370 307,420 173,420',
  6220. grad:'L5G', labelX:240, labelY:392, pctY:411, cx:240, cy:395 },
  6221. { key:'ci', label:'重疾险', cov:cl(coverages.ci),
  6222. yT:370, yB:420, polygon:'297,370 411,370 440,420 307,420',
  6223. grad:'L5G', labelX:364, labelY:392, pctY:411, cx:364, cy:395 }
  6224. ];
  6225. const grads = [
  6226. { id:'L1G', light:'#9B61C2', main:'#7A3FA0', dark:'#4A1F70' },
  6227. { id:'L2G', light:'#6FC192', main:'#4FA672', dark:'#2D7044' },
  6228. { id:'L3G', light:'#F2D366', main:'#E5BB3D', dark:'#B58A21' },
  6229. { id:'L4G', light:'#F0A55B', main:'#E48A35', dark:'#B26420' },
  6230. { id:'L5G', light:'#E5746A', main:'#D54E42', dark:'#962C24' }
  6231. ];
  6232. // ════════ defs ════════
  6233. let defs = '';
  6234. grads.forEach(g => {
  6235. // 主面渐变(亮 · 顶光打亮)
  6236. defs += `<linearGradient id="${g.id}" x1="0" y1="0" x2="0" y2="1">
  6237. <stop offset="0%" stop-color="${g.light}"/>
  6238. <stop offset="6%" stop-color="${g.main}"/>
  6239. <stop offset="100%" stop-color="${g.dark}"/>
  6240. </linearGradient>`;
  6241. // 主面背景(超淡 · 空容器底)
  6242. defs += `<linearGradient id="${g.id}_bg" x1="0" y1="0" x2="0" y2="1">
  6243. <stop offset="0%" stop-color="${g.main}" stop-opacity="0.10"/>
  6244. <stop offset="100%" stop-color="${g.dark}" stop-opacity="0.20"/>
  6245. </linearGradient>`;
  6246. // 侧面渐变(v3.3.1 · 用 main 色但更暗一档,模拟 3D 阴影面 · 不再黑得过头)
  6247. defs += `<linearGradient id="${g.id}_side" x1="0" y1="0" x2="0" y2="1">
  6248. <stop offset="0%" stop-color="${g.main}" stop-opacity="0.78"/>
  6249. <stop offset="100%" stop-color="${g.dark}" stop-opacity="0.92"/>
  6250. </linearGradient>`;
  6251. // 侧面背景(v3.3.1 · 与主面 bg 同色系 · 但深一档 · 让侧面与主面在视觉上是"同一座山的两面")
  6252. defs += `<linearGradient id="${g.id}_sideBg" x1="0" y1="0" x2="0" y2="1">
  6253. <stop offset="0%" stop-color="${g.main}" stop-opacity="0.18"/>
  6254. <stop offset="100%" stop-color="${g.dark}" stop-opacity="0.32"/>
  6255. </linearGradient>`;
  6256. });
  6257. segments.forEach(s => {
  6258. defs += `<clipPath id="clip_${s.key}"><polygon points="${s.polygon}"/></clipPath>`;
  6259. });
  6260. sideSegments.forEach(s => {
  6261. defs += `<clipPath id="clip_${s.key}"><polygon points="${s.polygon}"/></clipPath>`;
  6262. });
  6263. // 立体阴影 / 平面阴影
  6264. if (stereoOn) {
  6265. defs += `<filter id="cpDS3D" x="-15%" y="-15%" width="130%" height="130%">
  6266. <feGaussianBlur in="SourceAlpha" stdDeviation="7"/>
  6267. <feOffset dx="3" dy="9"/>
  6268. <feComponentTransfer><feFuncA type="linear" slope="0.45"/></feComponentTransfer>
  6269. <feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge>
  6270. </filter>`;
  6271. defs += `<filter id="cpGoldGlow" x="-50%" y="-50%" width="200%" height="200%">
  6272. <feGaussianBlur in="SourceAlpha" stdDeviation="2"/>
  6273. <feFlood flood-color="#C9A84C" flood-opacity="0.55"/>
  6274. <feComposite in2="SourceAlpha" operator="in"/>
  6275. <feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge>
  6276. </filter>`;
  6277. } else {
  6278. defs += `<filter id="cpDS3D" x="-10%" y="-10%" width="120%" height="120%">
  6279. <feGaussianBlur in="SourceAlpha" stdDeviation="4"/>
  6280. <feOffset dx="0" dy="5"/>
  6281. <feComponentTransfer><feFuncA type="linear" slope="0.28"/></feComponentTransfer>
  6282. <feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge>
  6283. </filter>`;
  6284. }
  6285. defs += `<filter id="cpTextShadow" x="-20%" y="-20%" width="140%" height="140%">
  6286. <feGaussianBlur in="SourceAlpha" stdDeviation="0.6"/>
  6287. <feOffset dx="0" dy="1"/>
  6288. <feComponentTransfer><feFuncA type="linear" slope="0.55"/></feComponentTransfer>
  6289. <feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge>
  6290. </filter>`;
  6291. // v3.3.2 · 烟雾立体氛围(仅立体 ON 时启用) · vignette + ground mist + 金色阶梯 rim 渐变
  6292. if (stereoOn) {
  6293. defs += `<radialGradient id="cpStereoVignette" cx="50%" cy="55%" r="68%">
  6294. <stop offset="0%" stop-color="rgba(255,250,235,0)"/>
  6295. <stop offset="65%" stop-color="rgba(60,40,15,0.05)"/>
  6296. <stop offset="100%" stop-color="rgba(40,25,10,0.14)"/>
  6297. </radialGradient>`;
  6298. defs += `<radialGradient id="cpMistGround" cx="50%" cy="50%" r="50%">
  6299. <stop offset="0%" stop-color="rgba(201,168,76,0.42)"/>
  6300. <stop offset="60%" stop-color="rgba(201,168,76,0.10)"/>
  6301. <stop offset="100%" stop-color="rgba(201,168,76,0)"/>
  6302. </radialGradient>`;
  6303. defs += `<linearGradient id="cpRimGold" x1="0" y1="0" x2="1" y2="0">
  6304. <stop offset="0%" stop-color="rgba(201,168,76,0.30)"/>
  6305. <stop offset="20%" stop-color="rgba(245,222,140,0.95)"/>
  6306. <stop offset="50%" stop-color="rgba(255,238,180,1)"/>
  6307. <stop offset="80%" stop-color="rgba(245,222,140,0.95)"/>
  6308. <stop offset="100%" stop-color="rgba(201,168,76,0.30)"/>
  6309. </linearGradient>`;
  6310. defs += `<radialGradient id="cpApexHalo" cx="50%" cy="50%" r="50%">
  6311. <stop offset="0%" stop-color="rgba(255,250,220,0.95)"/>
  6312. <stop offset="40%" stop-color="rgba(245,222,140,0.55)"/>
  6313. <stop offset="100%" stop-color="rgba(245,222,140,0)"/>
  6314. </radialGradient>`;
  6315. // v3.3.3 · 金色 rim 柔光滤镜(补偿去掉阴影后的对比度 · 金线自带光晕看起来更"印刷品质感")
  6316. defs += `<filter id="cpRimGlow" x="-30%" y="-30%" width="160%" height="160%">
  6317. <feGaussianBlur in="SourceGraphic" stdDeviation="0.8" result="blur"/>
  6318. <feMerge><feMergeNode in="blur"/><feMergeNode in="SourceGraphic"/></feMerge>
  6319. </filter>`;
  6320. }
  6321. // ════════ 顶部标题(v3.3.1 · 香槟金主题)════════
  6322. const titleHtml = `<defs>
  6323. <linearGradient id="cpTitleGold" x1="0" y1="0" x2="0" y2="1">
  6324. <stop offset="0%" stop-color="#E5C76A"/>
  6325. <stop offset="55%" stop-color="#C9A84C"/>
  6326. <stop offset="100%" stop-color="#9B7C3A"/>
  6327. </linearGradient>
  6328. </defs>
  6329. <g text-anchor="middle">
  6330. <text x="240" y="42" font-family="'Noto Serif SC','PingFang SC',serif"
  6331. font-size="26" font-weight="700" fill="url(#cpTitleGold)" letter-spacing="6"
  6332. ${stereoOn ? 'filter="url(#cpGoldGlow)"' : ''}>风险金字塔</text>
  6333. <text x="240" y="60" font-family="'Cormorant Garamond','Noto Serif SC',Georgia,serif"
  6334. font-size="11" font-weight="600" fill="#9B7C3A" letter-spacing="5">RISK PYRAMID</text>
  6335. </g>`;
  6336. // ════════ 背景层(v3.3.2 · 立体 ON 时先铺烟雾氛围 → 主面背景)════════
  6337. let bgHtml = '';
  6338. if (stereoOn) {
  6339. // 1) vignette 暗角
  6340. bgHtml += `<rect x="0" y="0" width="480" height="450" fill="url(#cpStereoVignette)"/>`;
  6341. // 2) v3.3.5 · 底部金色雾气已去掉(用户反馈底座那块"显脏" · 整体由 vignette + 粒子承担氛围)
  6342. // bgHtml += `<ellipse cx="240" cy="432" rx="240" ry="22" fill="url(#cpMistGround)"/>`;
  6343. // 3) 金色尘埃粒子(14 颗 · 不覆盖金字塔本体 · 散在四周)
  6344. const particles = [
  6345. { x:30, y:90, r:1.4, o:0.55 },
  6346. { x:55, y:150, r:1.0, o:0.42 },
  6347. { x:48, y:220, r:1.2, o:0.50 },
  6348. { x:35, y:300, r:1.6, o:0.60 },
  6349. { x:50, y:380, r:0.9, o:0.40 },
  6350. { x:445, y:95, r:1.2, o:0.50 },
  6351. { x:432, y:160, r:1.5, o:0.55 },
  6352. { x:455, y:240, r:1.0, o:0.42 },
  6353. { x:438, y:320, r:1.3, o:0.50 },
  6354. { x:435, y:395, r:1.1, o:0.45 },
  6355. { x:140, y:50, r:0.9, o:0.38 },
  6356. { x:330, y:48, r:1.1, o:0.42 },
  6357. { x:200, y:435, r:0.8, o:0.35 },
  6358. { x:280, y:435, r:1.0, o:0.40 }
  6359. ];
  6360. particles.forEach(p => {
  6361. bgHtml += `<circle cx="${p.x}" cy="${p.y}" r="${p.r}" fill="rgba(245,222,140,${p.o})"/>`;
  6362. });
  6363. }
  6364. // 4) v3.3.3 · 主面背景多边形(已迁移到 layersHtml 的 .pyr-layer 内,这里仅保留 atmosphere)
  6365. // (空: bgHtml 此时只含 vignette + mist + particles)
  6366. // ════════ v3.3.3 · 每层独立 .pyr-layer 组(bg + 水位 + 标签 + 百分比 全部包在内 · 支持点击放大)════════
  6367. // 用 viewBox 用户单位指定 transform-origin,确保点击放大以层中心为原点
  6368. // v3.4.1 · 水滴 ON = 实际水位(显示缺口) · 水滴 OFF = 满覆盖原色(对照参照),两者切换让差距一目了然
  6369. const buildWaterRect = (s) => {
  6370. const fillH = (s.yB - s.yT) * s.cov;
  6371. const waterY = s.yB - fillH;
  6372. // 水滴 OFF · 显示完整层颜色(满覆盖参照 · 用作"应有"基线)
  6373. if (!animOn) {
  6374. const fullH = s.yB - s.yT;
  6375. return `<rect x="0" y="${s.yT}" width="480" height="${fullH}"
  6376. fill="url(#${s.grad})" clip-path="url(#clip_${s.key})"/>`;
  6377. }
  6378. // 水滴 ON · 实际覆盖率水位 + 涨水动画(显示"实际"vs"应有"的差距)
  6379. if (fillH <= 0) return '';
  6380. return `<rect x="0" y="${s.yB}" width="480" height="0"
  6381. fill="url(#${s.grad})" clip-path="url(#clip_${s.key})">
  6382. <animate attributeName="y" from="${s.yB}" to="${waterY}" dur="1.4s" begin="0.2s"
  6383. fill="freeze" calcMode="spline" keyTimes="0;1" keySplines="0.22 1 0.36 1"/>
  6384. <animate attributeName="height" from="0" to="${fillH}" dur="1.4s" begin="0.2s"
  6385. fill="freeze" calcMode="spline" keyTimes="0;1" keySplines="0.22 1 0.36 1"/>
  6386. </rect>`;
  6387. };
  6388. let layersHtml = '<g class="pyr-layers" filter="url(#cpDS3D)">';
  6389. segments.forEach(s => {
  6390. const pct = Math.round(s.cov * 100);
  6391. layersHtml += `<g class="pyr-layer" data-key="${s.key}" style="transform-origin:${s.cx}px ${s.cy}px">`;
  6392. // bg 多边形
  6393. layersHtml += `<polygon points="${s.polygon}" fill="url(#${s.grad}_bg)"
  6394. stroke="rgba(0,0,0,0.08)" stroke-width="0.6"/>`;
  6395. // 水位 rect(clip 到本层 polygon)
  6396. layersHtml += buildWaterRect(s);
  6397. // 标签 + 百分比
  6398. if (animOn) {
  6399. layersHtml += `<text x="${s.labelX}" y="${s.labelY}" text-anchor="middle" fill="#fff"
  6400. font-family="'Noto Serif SC','PingFang SC',serif"
  6401. font-size="20" font-weight="700" letter-spacing="3"
  6402. filter="url(#cpTextShadow)" opacity="0">
  6403. ${s.label}
  6404. <animate attributeName="opacity" from="0" to="1" dur="0.5s" begin="0.6s" fill="freeze"/>
  6405. </text>`;
  6406. layersHtml += `<text x="${s.labelX}" y="${s.pctY}" text-anchor="middle"
  6407. font-family="'JetBrains Mono','Cormorant Garamond',monospace"
  6408. font-size="13" font-weight="800" letter-spacing="0.5"
  6409. fill="rgba(255,255,255,0.96)" filter="url(#cpTextShadow)" opacity="0">
  6410. ${pct}%
  6411. <animate attributeName="opacity" from="0" to="1" dur="0.6s" begin="1.2s" fill="freeze"/>
  6412. </text>`;
  6413. } else {
  6414. layersHtml += `<text x="${s.labelX}" y="${s.labelY}" text-anchor="middle" fill="#fff"
  6415. font-family="'Noto Serif SC','PingFang SC',serif"
  6416. font-size="20" font-weight="700" letter-spacing="3"
  6417. filter="url(#cpTextShadow)">${s.label}</text>`;
  6418. layersHtml += `<text x="${s.labelX}" y="${s.pctY}" text-anchor="middle"
  6419. font-family="'JetBrains Mono','Cormorant Garamond',monospace"
  6420. font-size="13" font-weight="800" letter-spacing="0.5"
  6421. fill="rgba(255,255,255,0.96)"
  6422. filter="url(#cpTextShadow)">${pct}%</text>`;
  6423. }
  6424. layersHtml += '</g>';
  6425. });
  6426. layersHtml += '</g>';
  6427. // ════════ 立体装饰(v3.3.3 · A方案最终: 仅金色 rim + 底座接地阴影 + apex halo · 去掉层间阴影线)════════
  6428. let rimHtml = '';
  6429. if (stereoOn) {
  6430. // (a) 4 条层间金色 rim 高光线 + 底座金色 rim · 全部加 cpRimGlow 柔光,补偿去掉阴影后的对比度
  6431. rimHtml = `<g stroke-linecap="round" fill="none" filter="url(#cpRimGlow)">
  6432. <line x1="163" y1="205" x2="317" y2="205" stroke="url(#cpRimGold)" stroke-width="2.2"/>
  6433. <line x1="131" y1="260" x2="349" y2="260" stroke="url(#cpRimGold)" stroke-width="2.2"/>
  6434. <line x1="100" y1="315" x2="380" y2="315" stroke="url(#cpRimGold)" stroke-width="2.2"/>
  6435. <line x1="69" y1="370" x2="411" y2="370" stroke="url(#cpRimGold)" stroke-width="2.2"/>
  6436. <line x1="40" y1="420" x2="440" y2="420" stroke="url(#cpRimGold)" stroke-width="2.4"/>
  6437. </g>`;
  6438. // (b) v3.3.4 · 底座接地阴影已去掉(用户反馈底座黑线显冷峻 · 整体已由金色 rim + 雾气提供视觉收尾)
  6439. // (c) L5 三分竖线(仅金色 rim · 去掉阴影竖线)
  6440. rimHtml += `<g stroke-linecap="round" fill="none" filter="url(#cpRimGlow)">
  6441. <line x1="183" y1="370" x2="173" y2="420" stroke="url(#cpRimGold)" stroke-width="1.6"/>
  6442. <line x1="297" y1="370" x2="307" y2="420" stroke="url(#cpRimGold)" stroke-width="1.6"/>
  6443. </g>`;
  6444. // (d) apex 顶部光晕(金色光球)
  6445. rimHtml += `<circle cx="240" cy="70" r="14" fill="url(#cpApexHalo)"/>`;
  6446. rimHtml += `<circle cx="240" cy="70" r="3.5" fill="rgba(255,250,220,0.95)"/>`;
  6447. }
  6448. // ════════ 层间分隔(v3.3.2 · 立体 ON 时已由 rim 替代,仅 OFF 时保留白线)════════
  6449. let dividerHtml = '';
  6450. if (!stereoOn) {
  6451. dividerHtml = `<g stroke="#fff" stroke-width="2.5" fill="none" opacity="0.95">
  6452. <line x1="163" y1="205" x2="317" y2="205"/>
  6453. <line x1="131" y1="260" x2="349" y2="260"/>
  6454. <line x1="100" y1="315" x2="380" y2="315"/>
  6455. <line x1="69" y1="370" x2="411" y2="370"/>
  6456. </g>
  6457. <g stroke="#fff" stroke-width="2.5" opacity="0.95">
  6458. <line x1="183" y1="370" x2="173" y2="420"/>
  6459. <line x1="297" y1="370" x2="307" y2="420"/>
  6460. </g>`;
  6461. }
  6462. // ════════ v3.3.3 · 标签已迁移到 .pyr-layer 内 · 这里清空 labelHtml ════════
  6463. let labelHtml = '';
  6464. svg.innerHTML = `<defs>${defs}</defs>${titleHtml}${bgHtml}${layersHtml}${rimHtml}${dividerHtml}${labelHtml}`;
  6465. // v3.3.3 · 点击放大动效:绑定每层 click,选中后 1.4s 自动收回(再次点击同层立即收回)
  6466. svg.querySelectorAll('.pyr-layer').forEach(el => {
  6467. if (el.dataset.bound) return;
  6468. el.dataset.bound = '1';
  6469. el.addEventListener('click', () => {
  6470. const wasActive = el.classList.contains('is-active');
  6471. svg.querySelectorAll('.pyr-layer.is-active').forEach(o => o.classList.remove('is-active'));
  6472. if (!wasActive) {
  6473. el.classList.add('is-active');
  6474. // 自动收回(避免用户离开后视觉残留)
  6475. clearTimeout(el._activeTimer);
  6476. el._activeTimer = setTimeout(() => el.classList.remove('is-active'), 1600);
  6477. }
  6478. });
  6479. });
  6480. }
  6481. function renderGapChart(data) {
  6482. const body = document.getElementById('gapChartBody');
  6483. if (!body) return;
  6484. // v3.0 · 7 险种分三层(基础 / 中端 / 高端)
  6485. const items = [
  6486. // 🟧 基础风险层
  6487. { key: 'acc', icon: '⚡', label: '意外险', tier: 'base', tierEmoji: '🟧', ...data.acc },
  6488. { key: 'med', icon: '🏥', label: '医疗险', tier: 'base', tierEmoji: '🟧', ...data.med },
  6489. { key: 'ci', icon: '⚕', label: '重疾险', tier: 'base', tierEmoji: '🟧', ...data.ci },
  6490. // 🟨 中端风险层
  6491. { key: 'life', icon: '🛡', label: '定期寿险', tier: 'mid', tierEmoji: '🟨', ...data.life },
  6492. { key: 'education', icon: '🎓', label: '教育年金', tier: 'mid', tierEmoji: '🟨', ...data.education },
  6493. { key: 'retirement', icon: '🌅', label: '养老年金', tier: 'mid', tierEmoji: '🟨', ...data.retirement },
  6494. // 🟡 高端风险层
  6495. { key: 'wl', icon: '💎', label: '终身寿险', tier: 'high', tierEmoji: '🟡', ...data.wl }
  6496. ];
  6497. // 找最大值用于归一化
  6498. const maxTotal = Math.max(...items.map(i => i.total || 1));
  6499. // tier 颜色 mapping
  6500. const tierColors = {
  6501. base: { fill: '#E07A3B', light: '#FBE3D2' },
  6502. mid: { fill: '#D4A93A', light: '#F5EBC8' },
  6503. high: { fill: '#7A3FA0', light: '#EFE3F5' } // v2026-06-14 · 同步金字塔顶层 L1 紫
  6504. };
  6505. body.innerHTML = items.map(item => {
  6506. const total = item.total || 0;
  6507. const existing = item.existing || 0;
  6508. const gap = item.gap || 0;
  6509. const totalPct = (total / maxTotal) * 100;
  6510. const existingPct = total > 0 ? (existing / total) * totalPct : 0;
  6511. const gapStartPct = existingPct;
  6512. const gapWidthPct = total > 0 ? (gap / total) * totalPct : 0;
  6513. const gapDisplay = gap >= 10000 ? '¥' + (gap/10000).toFixed(1) + '亿'
  6514. : gap >= 1 ? '¥' + Math.round(gap) + '万' : '¥0';
  6515. const tc = tierColors[item.tier];
  6516. return `<div class="gap-row" data-tier="${item.tier}" style="border-left:3px solid ${tc.fill}; padding-left:8px">
  6517. <div class="gap-label"><span>${item.icon}</span><span>${item.label}</span><span style="font-size:9px;opacity:0.6">${item.tierEmoji}</span></div>
  6518. <div class="gap-bar-wrap">
  6519. ${existingPct > 0 ? `<div class="gap-bar-existing" style="width:${existingPct}%; background:${tc.light}">${existing > 0 ? '已' : ''}</div>` : ''}
  6520. ${gapWidthPct > 0 ? `<div class="gap-bar-gap" style="left:${gapStartPct}%;width:${gapWidthPct}%; background:${tc.fill}">缺</div>` : ''}
  6521. </div>
  6522. <div class="gap-amount">缺口 <span class="gap-num">${gapDisplay}</span></div>
  6523. </div>`;
  6524. }).join('');
  6525. }
  6526. /* === Phase 3 · 推荐产品(从 products-bundle.js 匹配) === */
  6527. function matchProducts(category, criteria) {
  6528. if (!window.CY_PRODUCTS || !window.CY_PRODUCTS[category]) return [];
  6529. const products = window.CY_PRODUCTS[category] || [];
  6530. // 简单匹配:hot_selling 优先 + featured_rank 排序
  6531. return [...products]
  6532. .sort((a, b) => {
  6533. if (a.hot_selling !== b.hot_selling) return a.hot_selling ? -1 : 1;
  6534. return (a.featured_rank || 99) - (b.featured_rank || 99);
  6535. })
  6536. .slice(0, 6); // 最多展示 6 款
  6537. }
  6538. function renderProductCard(p) {
  6539. const isHot = p.hot_selling;
  6540. const features = (p.key_features || []).slice(0, 3);
  6541. let priceRange = '';
  6542. if (p.premium_range_cny) {
  6543. const min = p.premium_range_cny.min;
  6544. const max = p.premium_range_cny.max;
  6545. priceRange = '¥' + (min >= 10000 ? Math.round(min/10000) + '万' : min) +
  6546. ' - ¥' + (max >= 10000 ? Math.round(max/10000) + '万' : max);
  6547. } else if (p.premium_range_usd) {
  6548. const min = p.premium_range_usd.min;
  6549. const max = p.premium_range_usd.max;
  6550. priceRange = '$' + (min >= 1000000 ? (min/1000000).toFixed(1) + 'M' : min) +
  6551. ' - $' + (max >= 1000000 ? (max/1000000).toFixed(1) + 'M' : max);
  6552. }
  6553. return `<div class="product-item ${isHot ? 'hot' : ''}" onclick="showProductModal('${p.id}')" style="cursor:pointer">
  6554. <div class="product-name">
  6555. ${p.name_cn || ''}
  6556. ${isHot ? '<span class="hot-badge">HOT</span>' : ''}
  6557. </div>
  6558. <div class="product-issuer">${p.issuer || ''} · ${p.region || ''} · ${p.type_label || ''}</div>
  6559. ${p.tagline ? `<div class="product-tagline">"${p.tagline}"</div>` : ''}
  6560. <ul class="product-feats">
  6561. ${features.map(f => `<li>${f}</li>`).join('')}
  6562. </ul>
  6563. <div class="product-meta">
  6564. <span>保费 <span class="v">${priceRange || '—'}</span></span>
  6565. <span style="color:var(--accent);font-weight:600">点击查看详情 →</span>
  6566. </div>
  6567. </div>`;
  6568. }
  6569. /* === v2.8 · 支付能力健康度 + 行业基准对比 + 双轨配置 ===
  6570. [v2.9 升级]
  6571. (a) HNW 客户支付能力分母切换:工资 → AUM(他们用 AUM 缴保费,不是工资)
  6572. AUM-based 上限映射:用户选 20% → HNW 实际 = AUM × 2%(1% 行业惯例 × 2 容忍度)
  6573. 具体映射表 = { 10:0.5%, 15:1%, 20:2%, 30:3%, 100:100% }
  6574. (b) 教育金分级保留:留学子女(elite_us / full_overseas)floor 70%,
  6575. 国内+混合(domestic_plus)floor 50%,纯国内 floor 30%。
  6576. 缩减时优先保护教育金(签证 + 时间窗口),养老金可延后补足。
  6577. */
  6578. /* === v3.4 · 家庭总财富画像渲染 ===
  6579. 三盘视角(流动 / 自住 / 投资)+ 智能洞察 + 跳转 AssetCenter / LetsSee
  6580. */
  6581. /* === [v3.6] 7 险种计算依据 展开块 ===
  6582. 触发:result-cover 卡片上的 📐 按钮
  6583. 渲染:7 险种逐项公式 + 数字 + 总保额合计
  6584. 口径:客户感知口径(标注在 disclaimer)
  6585. */
  6586. window._lastFormulaCtx = null; // 保存上次计算上下文,toggleFormulaPanel 时用
  6587. /* === [v4.4.2] 通用 ⓘ Popover 折叠组件 · 全局 === */
  6588. function toggleInfoPopover(id) {
  6589. const overlay = document.getElementById('info-' + id);
  6590. if (!overlay) return;
  6591. // 关闭其他所有 popover
  6592. document.querySelectorAll('.info-popover-overlay.is-open').forEach(el => {
  6593. if (el.id !== overlay.id) el.classList.remove('is-open');
  6594. });
  6595. overlay.classList.toggle('is-open');
  6596. }
  6597. /* === [v4.5.2] 现金流方案切换器 · 建议 vs 可负担 · [v4.6] 加自定义方案 === */
  6598. function switchCfScenario(scenario) {
  6599. if (scenario !== 'full' && scenario !== 'affordable' && scenario !== 'custom') return;
  6600. window._cyShowScenario = scenario;
  6601. // 更新按钮 active 状态
  6602. document.querySelectorAll('.cf-scenario-btn').forEach(btn => {
  6603. btn.classList.remove('is-active');
  6604. btn.classList.remove('is-affordable');
  6605. btn.classList.remove('is-custom');
  6606. if (btn.getAttribute('data-scenario') === scenario) {
  6607. btn.classList.add('is-active');
  6608. if (scenario === 'affordable') btn.classList.add('is-affordable');
  6609. if (scenario === 'custom') btn.classList.add('is-custom');
  6610. } else if (btn.getAttribute('data-scenario') === 'custom') {
  6611. // 非激活态的自定义按钮也保留 is-custom 标识(用于 hover 蓝色)
  6612. btn.classList.add('is-custom');
  6613. }
  6614. });
  6615. // 触发重算 → Canvas + KPI 联动
  6616. const resultEl = document.getElementById('result');
  6617. if (resultEl && resultEl.style.display !== 'none' && typeof calculate === 'function') {
  6618. window._cySilentRecalc = true;
  6619. try { calculate(); } finally { window._cySilentRecalc = false; }
  6620. }
  6621. }
  6622. // 点击 overlay 自身(非内容区)关闭
  6623. document.addEventListener('click', function(e) {
  6624. if (e.target && e.target.classList && e.target.classList.contains('info-popover-overlay')) {
  6625. e.target.classList.remove('is-open');
  6626. }
  6627. });
  6628. // ESC 关闭
  6629. document.addEventListener('keydown', function(e) {
  6630. if (e.key === 'Escape') {
  6631. document.querySelectorAll('.info-popover-overlay.is-open').forEach(el => el.classList.remove('is-open'));
  6632. }
  6633. });
  6634. function toggleFormulaPanel() {
  6635. const panel = document.getElementById('formulaPanel');
  6636. if (!panel) return;
  6637. const visible = panel.style.display !== 'none';
  6638. if (visible) {
  6639. panel.style.display = 'none';
  6640. } else {
  6641. panel.style.display = 'block';
  6642. // 滚动到 panel
  6643. setTimeout(() => panel.scrollIntoView({ behavior: 'smooth', block: 'center' }), 50);
  6644. }
  6645. }
  6646. function renderFormulaPanel(ctx) {
  6647. // ctx 包含所有计算需要的上下文,在 calculate 末尾调用 setFormulaCtx 保存
  6648. window._lastFormulaCtx = ctx;
  6649. const body = document.getElementById('formulaPanelBody');
  6650. if (!body) return;
  6651. // 数字 → 友好格式
  6652. const fmt = (wan) => {
  6653. if (wan >= 10000) return '¥' + (wan/10000).toFixed(2) + ' 亿';
  6654. if (wan === 0) return '¥0';
  6655. return '¥' + Math.round(wan).toLocaleString('zh-CN') + ' 万';
  6656. };
  6657. const fmtPremium = (yuan) => '¥' + (yuan/10000).toFixed(2) + ' 万 / 年';
  6658. const isHNW = ctx.isHNWFinal;
  6659. // 7 险种公式 + 数字
  6660. const rows = [];
  6661. // 1. 意外险 · [v4.5.3] 差异化定位 · 伤残保障(独有价值)
  6662. if (isHNW) {
  6663. rows.push({
  6664. icon: '💢', name: '意外险(伤残保障)', tier: '基础',
  6665. formula: 'HNW 伤残应急 = 年薪 ' + ctx.salary + ' 万 × 3 = ¥' + ctx.accidentNeed + ' 万(意外身故由定寿覆盖)',
  6666. payYears: '1 年',
  6667. need: ctx.accidentNeed, gap: ctx.accidentGap, premium: ctx.accidentPremium,
  6668. note: '🟢 **意外伤残**全残 100% / 部分伤残按等级 10-90% · 与定寿差异化(意外险=伤残 / 定寿=身故)'
  6669. });
  6670. } else {
  6671. rows.push({
  6672. icon: '💢', name: '意外险(伤残保障)', tier: '基础',
  6673. formula: '伤残期 5 年家庭过渡 = 年薪 ' + ctx.salary + ' 万 × 5(主理人不能工作但活着)',
  6674. payYears: '1 年',
  6675. need: ctx.accidentNeed, gap: ctx.accidentGap, premium: ctx.accidentPremium,
  6676. note: '🟢 **意外伤残**全残 100% / 部分伤残按等级 10-90% · 与定寿差异化(意外险=伤残 / 定寿=身故)'
  6677. });
  6678. }
  6679. // 2. 重疾
  6680. rows.push({
  6681. icon: '🔴', name: '重疾(储蓄型)', tier: '基础',
  6682. formula: '年薪 ' + ctx.salary + ' 万 × ' + ctx.ciMultiplier + '(重疾倍数)',
  6683. payYears: (ctx.ciPayYears || 20) + ' 年',
  6684. need: ctx.ciNeed, gap: ctx.ciGap, premium: ctx.ciPremium,
  6685. note: '🟢 一次性给付:诊断重疾即赔 + **意外身故也赔保额**(储蓄型有身故责任) + 现金价值累积(Benchmark 标配储蓄型)'
  6686. });
  6687. // 3. 高端医疗
  6688. rows.push({
  6689. icon: '💚', name: '高端医疗', tier: '基础',
  6690. formula: '推荐固定值 800 万(覆盖境内顶级私立 + 海外医疗)',
  6691. payYears: '1 年',
  6692. need: ctx.medNeed,
  6693. gap: ctx.existingMed === 1 ? 0 : ctx.medNeed,
  6694. premium: ctx.medPremium,
  6695. note: '⚠ 年度报销上限(每年重置 · 不是一次性给付 · 简化计入总保额)'
  6696. });
  6697. // 4. 寿险(HNW 模式 = 境内定期寿险 / 普通家庭 = 定期寿险 DIM 法)
  6698. // [v4.3] 改名:寿险(DIM 法) → 定期寿险(明确产品类型 · 与终身寿险区分)
  6699. if (isHNW) {
  6700. rows.push({
  6701. icon: '🛡', name: '定期寿险(境内)', tier: '中端',
  6702. formula: '主理人 max(¥' + (ctx._lifeAgeMin/10000) + '亿, min(AUM × ' + (ctx._lifeAumRatio*100).toFixed(0) + '%, ¥' + (ctx._lifeAgeCap/10000) + '亿))<br>+ 配偶(主理人 50%)',
  6703. payYears: (ctx.lifePayYears || 30) + ' 年',
  6704. need: ctx.lifeNeed, gap: ctx.lifeGap, premium: ctx.lifePremium,
  6705. note: '🟢 **任何原因身故**(意外+疾病)赔保额 · ⚠ 意外身故时与意外险**双重赔付**(保险公司不冲抵) · 与意外险差异化(定寿=身故 / 意外险=伤残)'
  6706. });
  6707. } else {
  6708. // [v4.4] 普通家庭 DIM 法定期寿险 · 明确 I 收入替代公式 + 主理人占比 30% 下限说明
  6709. const _yearsToRetire = ctx.yearsToRetire || 0;
  6710. const _principalSharePct = ((ctx.principalShare || 0) * 100).toFixed(0);
  6711. const _incomeReplacePct = ((ctx.incomeReplaceRate || 0) * 100).toFixed(0);
  6712. const _discountRatePct = ((ctx.incomeDiscountRate || 0) * 100).toFixed(1);
  6713. const _floorTriggered = (ctx.principalShare || 0) < 0.3;
  6714. rows.push({
  6715. icon: '🛡', name: '定期寿险(DIM 法)', tier: '中端',
  6716. formula:
  6717. '<strong>DIM 公式</strong>:D 房贷+负债 + I 收入替代 - A 现有资产<br>' +
  6718. '<strong>D 房贷+负债</strong> = ¥' + ctx.D + ' 万<br>' +
  6719. '<strong>I 收入替代</strong> = 年薪 ¥' + ctx.salary + '万 × 主理人占比 ' + _incomeReplacePct + '% × ' + _yearsToRetire + ' 年现值因子(折现率 ' + _discountRatePct + '%)<br>' +
  6720. '&nbsp;&nbsp;&nbsp;&nbsp;= ¥' + Math.round(ctx.I) + ' 万' + (_floorTriggered ? '<span style="color:#A61C2B"> · ⚠ 主理人占比 30% 保底触发(实际 ' + _principalSharePct + '%)</span>' : '') + '<br>' +
  6721. '<strong>假设</strong>:<br>' +
  6722. '&nbsp;&nbsp;• 主理人占比 = max(salary/家庭总收入, <strong>30% 下限</strong>) — 意外身故对家庭情感+经济冲击不低于 30%<br>' +
  6723. '&nbsp;&nbsp;• 折现率(' + _discountRatePct + '%) = 国债收益率假设(form 可调:0/3/4/5/6%,默认 3%)<br>' +
  6724. '&nbsp;&nbsp;• 工作期 = 当前年龄至退休的剩余年数<br>' +
  6725. '<strong>A 现有资产</strong>(流动金融)= ¥' + ctx.liquid + ' 万<br>' +
  6726. '<strong>合计</strong> = D + I - A = ¥' + Math.round(ctx.lifeNeed) + ' 万',
  6727. payYears: (ctx.lifePayYears || 30) + ' 年',
  6728. need: ctx.lifeNeed, gap: ctx.lifeGap, premium: ctx.lifePremium,
  6729. note: '🟢 **任何原因身故**(意外+疾病)赔保额 · ⚠ 意外身故时与意外险**双重赔付**(保险公司不冲抵) · 教育金已剥离独立险种'
  6730. });
  6731. }
  6732. // 5. 养老金
  6733. rows.push({
  6734. icon: '💰', name: '养老金', tier: '中端',
  6735. formula:
  6736. '<strong>① 退休后月缺口</strong> = 年薪 × ' + (ctx.retireLifestyleRatio*100).toFixed(0) + '% / 12 - 社保 1.2 万<br>' +
  6737. '<strong>② 退休时所需保额</strong> = 月缺口 × 12 × 年金现值因子(' + ctx.retireYears + ' 年通胀 3% PV)<br>' +
  6738. '<strong>③ 缺口</strong> = 所需保额 − 已有储备<br>' +
  6739. '<strong>④ 年缴(精算)</strong> = 缺口 / FV 年金未来值因子(' + (ctx.retirePayYears || 20) + ' 年缴, IRR 3%)<br>' +
  6740. '<span style="color:#7A6028;font-size:10px">v4.7 替换原 ×0.65 魔术系数 → 精算 FV 因子,与缴费年限/IRR 联动</span>',
  6741. payYears: (ctx.retirePayYears || 20) + ' 年',
  6742. need: ctx.retireNeed, gap: ctx.retireGap, premium: ctx.retirePremium,
  6743. note: '✓ PV 现值(今天该准备的购买力 · 精算 FV 折扣反映年金险杠杆)'
  6744. });
  6745. // 6. 教育金
  6746. rows.push({
  6747. icon: '🎓', name: '教育金', tier: '中端',
  6748. formula:
  6749. '<strong>① 单子女总需求</strong> = ' + ctx.eduUnit + ' 万(' + ctx.eduPathLabel + ')PV 现值' + (ctx.childCount > 1 ? ' × ' + ctx.childCount + ' 子女' : '') + '<br>' +
  6750. '<strong>② 缺口</strong> = 总需求 − 已有储备 − 已配教育金险<br>' +
  6751. '<strong>③ 年缴(精算)</strong> = 缺口 / FV 年金未来值因子(' + (ctx.eduPayYears > 0 ? ctx.eduPayYears : '—') + ' 年缴, IRR 3%)<br>' +
  6752. '<span style="color:#7A6028;font-size:10px">v4.7 替换原 ×0.85 / 10 年硬编码 → 精算 FV 因子,与子女年龄/IRR 联动</span>',
  6753. payYears: (ctx.eduPayYears > 0 ? ctx.eduPayYears + ' 年' : '—'),
  6754. need: ctx.eduNeed, gap: ctx.eduGap, premium: ctx.eduPremium,
  6755. note: '✓ PV 现值 + FV 精算(子女越小缴期越长,年缴越低)'
  6756. });
  6757. // 7. 终身寿险(高端) · v4.0 双轨拆解
  6758. if (isHNW) {
  6759. const _wlD = ctx.wlDomestic || 0;
  6760. const _wlIUL = ctx.wlOverseasIUL || 0;
  6761. const _wlPPLI = ctx.wlOverseasPPLI || 0;
  6762. const _ageMul = ctx.ageMultiplier || 80;
  6763. const _annualIULWan = ctx.annualPremiumIULWan || 0;
  6764. const _ppliInjectable = ctx.ppliInjectable || 0;
  6765. const _enablePPLI = ctx.enablePPLI || false;
  6766. const _needRatio = ctx.hasUSPerson ? '50%' : '30%';
  6767. rows.push({
  6768. icon: '🏛', name: '终身寿险(双轨)', tier: '高端',
  6769. formula:
  6770. '<strong style="color:#A61C2B">境内增额终身寿</strong> ¥' + _wlD + ' 万<br>' +
  6771. '主理人 = min(max(salary × 10, 境内 × 30%), ageCap) + 配偶(按 spouseSalary/salary 比例,无收入 0)<br>' +
  6772. '合计 ≤ 境内 × 50%(v4.3 上限)<br><br>' +
  6773. '<strong style="color:#3D6F8C">境外 ' + (ctx.wlOverseasTier || 'IUL/VUL/PPLI') + '</strong> ¥' + (ctx.wlOverseas || 0) + ' 万<br>' +
  6774. (_enablePPLI
  6775. ? 'PPLI 保额 = 装入资产合计 ¥' + _ppliInjectable + ' 万(流动 100% + 自住 0% + 投资 30%)'
  6776. : 'IUL/VUL = 境外资产 × ' + _needRatio + ' = ¥' + _wlIUL + ' 万<br>反推年保费 ¥' + _annualIULWan + ' 万 = 保额 / 杠杆 ' + _ageMul + 'x(健康标体非吸烟)'),
  6777. payYears: (ctx.wlPayYears || 20) + ' 年',
  6778. need: ctx.wlNeed, gap: ctx.wlGap, premium: ctx.wlPremium,
  6779. note: _enablePPLI
  6780. ? '🟢 双轨配置:境内传承隔离 + 境外 IUL/VUL/PPLI(PPLI 装入非现金资产)· 建议 3-5 张保单分批'
  6781. : '🟢 双轨配置:境内传承隔离 + 境外 IUL/VUL(AUM < $2000 万美金不启用 PPLI)· 建议 3-5 张保单分批'
  6782. });
  6783. } else {
  6784. rows.push({
  6785. icon: '🏛', name: '终身寿险(传承)', tier: '高端',
  6786. formula: '总资产 ¥' + Math.round(ctx.totalAumForWL) + ' 万 × 30%(传承隔离基线)',
  6787. payYears: (ctx.wlPayYears || 20) + ' 年',
  6788. need: ctx.wlNeed, gap: ctx.wlGap, premium: ctx.wlPremium,
  6789. note: '○ 普通家庭可选购增额终身寿,做现金价值积累 + 传承隔离'
  6790. });
  6791. }
  6792. // 渲染
  6793. let html = '<table style="width:100%;border-collapse:collapse;table-layout:fixed">';
  6794. html += '<colgroup>' +
  6795. '<col style="width:18%">' + // 险种
  6796. '<col style="width:38%">' + // 公式(压缩)
  6797. '<col style="width:13%">' + // 建议保额(加宽)
  6798. '<col style="width:11%">' + // 缺口
  6799. '<col style="width:13%">' + // 年缴保费(加宽)
  6800. '<col style="width:7%">' + // 缴费年限(只显示数字 + 年)
  6801. '</colgroup>';
  6802. html += '<thead><tr style="border-bottom:2px solid #C9A84C">' +
  6803. '<th style="text-align:left;padding:6px 10px;font-size:11.5px;color:#7A6028">险种</th>' +
  6804. '<th style="text-align:left;padding:6px 10px;font-size:11.5px;color:#7A6028">公式</th>' +
  6805. '<th style="text-align:center;padding:6px 10px;font-size:13px;color:#3D2914;font-weight:700">建议保额</th>' +
  6806. '<th style="text-align:center;padding:6px 10px;font-size:13px;color:#3D2914;font-weight:700">保障缺口</th>' +
  6807. '<th style="text-align:center;padding:6px 10px;font-size:13px;color:#3D2914;font-weight:700">年缴保费</th>' +
  6808. '<th style="text-align:center;padding:6px 6px;font-size:11.5px;color:#7A6028">缴费<br>年限</th>' +
  6809. '</tr></thead><tbody>';
  6810. rows.forEach((r, idx) => {
  6811. const tierColor = { '基础': '#9B7C3A', '中端': '#A61C2B', '高端': '#7A5A8E' };
  6812. // [v4.0] 按口径分组上色:对应顶部三栏汇总
  6813. // 一次性赔付组(意外/重疾/医疗/寿险/终身寿险) → 金色 #9B7C3A
  6814. // 长周期累积组(养老金/教育金) → 蓝色 #3D6F8C
  6815. const isLongterm = r.name.includes('养老') || r.name.includes('教育');
  6816. const needColor = isLongterm ? '#3D6F8C' : '#9B7C3A';
  6817. const premiumColor = isLongterm ? '#3D6F8C' : '#9B7C3A';
  6818. const rowBg = isLongterm ? 'rgba(141,185,213,.04)' : 'rgba(196,151,58,.03)';
  6819. html += '<tr style="border-bottom:1px dashed rgba(155,124,58,.2);background:' + rowBg + '">' +
  6820. '<td style="padding:8px 10px;vertical-align:top">' +
  6821. '<div style="font-weight:600;color:#1A0F05;font-size:12.5px">' + r.icon + ' ' + r.name +
  6822. ' <span style="font-size:10px;color:' + tierColor[r.tier] + ';font-weight:500">[' + r.tier + ']</span>' +
  6823. ' <span style="font-size:9.5px;color:' + needColor + ';font-weight:600;letter-spacing:0.4px;margin-left:4px">[' + (isLongterm ? '长周期' : '一次性') + ']</span></div>' +
  6824. '<div style="font-size:10.5px;color:#7A6028;margin-top:3px">' + r.note + '</div>' +
  6825. '</td>' +
  6826. '<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>' +
  6827. '<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>' +
  6828. '<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>' +
  6829. '<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>' +
  6830. '<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>' +
  6831. '</tr>';
  6832. });
  6833. // [v4.0 → v4.7] 合计行 · 简化为只显示总缺口(去掉"一次性赔付"+"长周期累积"双栏分离)
  6834. // Jack 2026-06-21:底部合计保留"建议保额 + 保障缺口 + 年缴保费"三列居中对齐
  6835. const _totalNeed = rows.reduce(function(s, r){ return s + (r.need || 0); }, 0);
  6836. const _totalGap = rows.reduce(function(s, r){ return s + (r.gap || 0); }, 0);
  6837. 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">' +
  6838. '<td colspan="2" style="padding:12px;color:#1A0F05;font-size:13.5px;font-weight:800">📊 合计</td>' +
  6839. '<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>' +
  6840. '<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>' +
  6841. '<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>' +
  6842. '<td style="padding:12px 4px"></td>' +
  6843. '</tr>';
  6844. // v4.3 disclaimer 提示行
  6845. html += '<tr style="background:rgba(196,151,58,.04)">' +
  6846. '<td colspan="6" style="padding:10px 12px;font-size:10.5px;line-height:1.65;color:#7A6028">' +
  6847. '💡 <strong>v4.3 口径分离 + 缴费年限</strong>:一次性赔付(出险即赔,金色)/ 长周期累积(养老/教育 PV 现值,蓝色)/ 年缴保费(客户实际成本)。**缴费年限**列展示各险种的缴费周期(纯消费 1 年续保 / 储蓄型 20 年缴清 / 定期寿 20-30 年保障),帮助客户理解年现金流支出节奏(为 LDI 投资规划做准备)。' +
  6848. '</td>' +
  6849. '</tr>';
  6850. html += '</tbody></table>';
  6851. body.innerHTML = html;
  6852. }
  6853. /* === v3.4 · 家庭总财富画像渲染 === */
  6854. function renderWealthPicture(d) {
  6855. // [v3.6] 4 盘:流动 / 自住 / 其他投资 / 保险现金价值
  6856. const insurValue = d.insuranceCashValue || 0;
  6857. const total = d.totalWealth || (d.liquid + d.primaryResidence + d.investAssets + insurValue);
  6858. const fmtMoney = (wan) => {
  6859. if (wan >= 10000) return '¥' + (wan/10000).toFixed(2) + '亿';
  6860. return '¥' + Math.round(wan) + '万';
  6861. };
  6862. // 总额
  6863. document.getElementById('wpTotalAmt').textContent = fmtMoney(total);
  6864. if (total === 0) {
  6865. document.getElementById('wpInsight').innerHTML =
  6866. '⚠ 四盘均为 0 · 请在「家庭财务信息」段填写流动资产 / 自住房产 / 其他投资,以查看完整画像';
  6867. ['wpSegLiquid','wpSegHouse','wpSegInvest','wpSegInsur'].forEach(id => {
  6868. const el = document.getElementById(id);
  6869. if (el) el.style.width = '0%';
  6870. });
  6871. return;
  6872. }
  6873. // 四盘金额 + 占比
  6874. const liquidPct = total > 0 ? d.liquid / total : 0;
  6875. const housePct = total > 0 ? d.primaryResidence / total : 0;
  6876. const investPct = total > 0 ? d.investAssets / total : 0;
  6877. const insurPct = total > 0 ? insurValue / total : 0;
  6878. document.getElementById('wpLiquidAmt').textContent = fmtMoney(d.liquid);
  6879. document.getElementById('wpHouseAmt').textContent = fmtMoney(d.primaryResidence);
  6880. document.getElementById('wpInvestAmt').textContent = fmtMoney(d.investAssets);
  6881. const insurAmtEl = document.getElementById('wpInsurAmt');
  6882. if (insurAmtEl) insurAmtEl.textContent = fmtMoney(insurValue);
  6883. document.getElementById('wpLiquidPct').textContent = (liquidPct*100).toFixed(0) + '%';
  6884. document.getElementById('wpHousePct').textContent = (housePct*100).toFixed(0) + '%';
  6885. document.getElementById('wpInvestPct').textContent = (investPct*100).toFixed(0) + '%';
  6886. const insurPctEl = document.getElementById('wpInsurPct');
  6887. if (insurPctEl) insurPctEl.textContent = (insurPct*100).toFixed(0) + '%';
  6888. // 堆叠条 · 4 段
  6889. const segLiq = document.getElementById('wpSegLiquid');
  6890. const segHouse = document.getElementById('wpSegHouse');
  6891. const segInvest = document.getElementById('wpSegInvest');
  6892. const segInsur = document.getElementById('wpSegInsur');
  6893. if (segLiq) { segLiq.style.width = (liquidPct*100).toFixed(2) + '%'; segLiq.textContent = liquidPct >= 0.10 ? (liquidPct*100).toFixed(0) + '%' : ''; }
  6894. if (segHouse) { segHouse.style.width = (housePct*100).toFixed(2) + '%'; segHouse.textContent = housePct >= 0.10 ? (housePct*100).toFixed(0) + '%' : ''; }
  6895. if (segInvest) { segInvest.style.width = (investPct*100).toFixed(2) + '%'; segInvest.textContent = investPct >= 0.10 ? (investPct*100).toFixed(0) + '%' : ''; }
  6896. if (segInsur) { segInsur.style.width = (insurPct*100).toFixed(2) + '%'; segInsur.textContent = insurPct >= 0.10 ? (insurPct*100).toFixed(0) + '%' : ''; }
  6897. // 智能洞察
  6898. const familyIncome = d.salary + d.spouseSalary;
  6899. const wealthToIncomeRatio = familyIncome > 0 ? total / familyIncome : 0;
  6900. let insight = '';
  6901. // 1) 资产结构判断
  6902. if (housePct >= 0.70) {
  6903. insight += '🏠 <strong>自住房产占比 ' + (housePct*100).toFixed(0) + '%(过高)</strong> · 典型"房子比家底厚"中产结构 —— 流动性弱,一旦主理人意外,家人虽有房可住但缺现金支付教育/医疗。<strong>建议</strong>:把寿险作为流动性补充,不要用自住房做"现有资产"扣减寿险需求。';
  6904. } else if (liquidPct >= 0.60 && total < 1000) {
  6905. insight += '💧 <strong>流动资产占比高(' + (liquidPct*100).toFixed(0) + '%)且总财富仍小</strong> · 典型早期积累期 —— 配置重点应该是<strong>保障型</strong>(重疾/寿险/医疗),不要急于做激进资产配置。';
  6906. } else if (investPct >= 0.40) {
  6907. insight += '🏛 <strong>其他投资资产占比 ' + (investPct*100).toFixed(0) + '%(主动配置型)</strong> —— 您已经有相当的资产配置经验。建议<strong>跳转资产配置中心</strong>细化股票/基金/黄金/私募的具体仓位,让保险作为"对冲层"而非"主仓位"。';
  6908. } else if (total >= 5000) {
  6909. insight += '🏛 <strong>总财富 ' + fmtMoney(total) + '(HNW 级别)</strong> —— 已超过 HNW 触发线 ¥5000 万,系统已切换为 AUM 分母模式计算保费占比(行业惯例 1-3% AUM)。';
  6910. } else {
  6911. insight += '✓ <strong>三盘结构相对均衡</strong> —— 流动 ' + (liquidPct*100).toFixed(0) + '% / 自住 ' + (housePct*100).toFixed(0) + '% / 投资 ' + (investPct*100).toFixed(0) + '%。';
  6912. }
  6913. // 2) 财富 / 收入倍数
  6914. if (wealthToIncomeRatio > 0) {
  6915. insight += '<br>📐 <strong>总财富 ' + wealthToIncomeRatio.toFixed(1) + '× 家庭年收入</strong>';
  6916. if (wealthToIncomeRatio < 3) insight += '(早期积累期 · &lt; 3× 是中产典型)';
  6917. else if (wealthToIncomeRatio < 10) insight += '(中产成熟期 · 3-10× 健康范围)';
  6918. else if (wealthToIncomeRatio < 30) insight += '(财富富裕期 · 10-30× 上层中产)';
  6919. else insight += '(HNW / UHNW · ≥ 30× 财富主导收入)';
  6920. }
  6921. // 3) 提示自住房不进 DIM
  6922. if (d.primaryResidence > 0) {
  6923. insight += '<br>💡 <strong>注意</strong>:自住房产 ' + fmtMoney(d.primaryResidence) + ' <strong>不参与</strong>寿险 DIM 公式 A 项扣减(主理人去世后家人仍需居住,不能变现还债)。仅用于总财富画像 + HNW 触发判定。';
  6924. }
  6925. document.getElementById('wpInsight').innerHTML = insight;
  6926. }
  6927. /* === v3.4 · 跳转资产配置中心(带数据预填)===
  6928. 把当前表单的家庭财务 + 三盘资产数据写入 localStorage,跳转 AssetCenter 后由其读取预填
  6929. */
  6930. // 回 ClientProfile · ActionHub(IC 已写总线 clientId+measuredAt → 触发保险板块工具驱动点亮)
  6931. // 直接带 ?tab=actionhub 深链落到 ActionHub Tab(比 navJumpTo 更精准,后者会丢 tab 参数)
  6932. function jumpActionHubIC(){
  6933. var url=(window.CY_PAGES&&window.CY_PAGES.clientprofile)?window.CY_PAGES.clientprofile
  6934. :'承延融合平台v3.6(v3.5方案A通用版·纯Tab无双列+v3.5接通+动态画像渲染)-顾问端ClientProfile.html';
  6935. var sep=url.indexOf('?')>=0?'&':'?';
  6936. location.href=url+sep+'tab=actionhub';
  6937. }
  6938. // 返回:从 ActionHub 进来(?from=actionhub)→ 精确回 ActionHub Tab;否则浏览器返回
  6939. function goBackIC(){
  6940. try {
  6941. if (new URLSearchParams(location.search).get('from') === 'actionhub') { jumpActionHubIC(); return; }
  6942. } catch(e){}
  6943. history.back();
  6944. }
  6945. function jumpToAssetCenter() {
  6946. // [v3.5] 从当前 persona 的 v29_params 取扩展字段(name_en / nationality / residence_city / industry)
  6947. const personaId = sessionStorage.getItem('cy_persona_id');
  6948. const persona = personaId && window.CLIENT_PERSONAS ? window.CLIENT_PERSONAS.find(p => p.id === personaId) : null;
  6949. const v29 = (persona && persona.v29_params) ? persona.v29_params : {};
  6950. // childAges 数组 (从 form 字段读)
  6951. const childCount = parseInt(document.getElementById('childCount').value) || 0;
  6952. const childAges = [];
  6953. for (let i = 1; i <= 3; i++) {
  6954. if (i <= childCount) {
  6955. const v = parseInt(document.getElementById('childAge' + i).value);
  6956. if (!isNaN(v)) childAges.push(v);
  6957. }
  6958. }
  6959. const seed = {
  6960. source: 'InsuranceCalculator',
  6961. sourceVersion: 'v3.5',
  6962. timestamp: Date.now(),
  6963. family: {
  6964. surname: document.getElementById('surname').value || '',
  6965. age: parseInt(document.getElementById('age').value) || 0,
  6966. gender: document.getElementById('gender').value || '',
  6967. marriage: document.getElementById('marriage').value || '',
  6968. childCount: childCount,
  6969. childAges: childAges,
  6970. eduPath: document.getElementById('eduPath').value || '',
  6971. // [v3.5] 扩展字段从 v29_params 带过去(让 ActionHub 能出真实建议)
  6972. surname_en: v29.surname_en || '',
  6973. name_en: v29.name_en || '',
  6974. family_name_en: v29.family_name_en || '',
  6975. nationality: v29.nationality || 'cn',
  6976. residence_city: v29.residence_city || '',
  6977. industry: v29.industry || ''
  6978. },
  6979. finance: {
  6980. salary: parseFloat(document.getElementById('salary').value) || 0,
  6981. spouseSalary: parseFloat(document.getElementById('spouseSalary').value) || 0,
  6982. mortgage: parseFloat(document.getElementById('mortgage').value) || 0,
  6983. otherDebt: parseFloat(document.getElementById('otherDebt').value) || 0
  6984. },
  6985. wealth: {
  6986. liquid: parseFloat(document.getElementById('liquidAssets').value) || 0,
  6987. primaryResidence: (function(){ const el = document.getElementById('primaryResidence'); return el ? (parseFloat(el.value) || 0) : 0; })(),
  6988. investAssets: (function(){ const el = document.getElementById('investAssets'); return el ? (parseFloat(el.value) || 0) : 0; })()
  6989. },
  6990. insurance: {
  6991. ci: parseFloat(document.getElementById('existingCI').value) || 0,
  6992. med: parseInt(document.getElementById('existingMed').value) || 0,
  6993. life: parseFloat(document.getElementById('existingLife').value) || 0,
  6994. wholeLife: parseFloat(document.getElementById('existingWholeLife').value) || 0,
  6995. eduInsurance: parseFloat(document.getElementById('existingEduInsurance').value) || 0,
  6996. retirement: parseFloat(document.getElementById('existingRetirement').value) || 0,
  6997. accident: parseFloat(document.getElementById('existingAccident').value) || 0
  6998. },
  6999. retireAge: parseInt(document.getElementById('retireAge').value) || 60,
  7000. lifeExpectancy: parseInt(document.getElementById('lifeExpectancy').value) || 90
  7001. };
  7002. try {
  7003. localStorage.setItem('cy_asset_center_seed', JSON.stringify(seed));
  7004. showInlineToast('✅ 数据已暂存 · 跳转资产配置中心...');
  7005. } catch(e) {
  7006. console.error('Seed save failed', e);
  7007. }
  7008. // [v3.4 task #1] 走 cy-renderer 集中路由(navJumpTo → CY_PAGES → 硬编码 三层 fallback)
  7009. setTimeout(() => {
  7010. if (typeof navJumpTo === 'function') {
  7011. navJumpTo('assetcenter');
  7012. } else if (window.CY_PAGES && window.CY_PAGES.assetcenter) {
  7013. window.location.href = window.CY_PAGES.assetcenter;
  7014. } else {
  7015. window.location.href = '承延融合平台v3.2(5Tab·演示版·全接通)-顾问端AssetCenter.html';
  7016. }
  7017. }, 500);
  7018. }
  7019. /* === v3.4 · 跳转 LetsSee(带数据预填)=== */
  7020. function jumpToLetsSee() {
  7021. // LetsSee 走 portrait 路径,这里用同一份 seed 当 fallback
  7022. const seed = {
  7023. source: 'InsuranceCalculator',
  7024. sourceVersion: 'v3.4',
  7025. timestamp: Date.now(),
  7026. salary: parseFloat(document.getElementById('salary').value) || 0,
  7027. spouseSalary: parseFloat(document.getElementById('spouseSalary').value) || 0,
  7028. liquid: parseFloat(document.getElementById('liquidAssets').value) || 0,
  7029. primaryResidence: (function(){ const el = document.getElementById('primaryResidence'); return el ? (parseFloat(el.value) || 0) : 0; })(),
  7030. investAssets: (function(){ const el = document.getElementById('investAssets'); return el ? (parseFloat(el.value) || 0) : 0; })(),
  7031. retireAge: parseInt(document.getElementById('retireAge').value) || 60,
  7032. lifeExpectancy: parseInt(document.getElementById('lifeExpectancy').value) || 90
  7033. };
  7034. try {
  7035. localStorage.setItem('cy_letssee_seed', JSON.stringify(seed));
  7036. showInlineToast('✅ 数据已暂存 · 跳转 Let\'s See...');
  7037. } catch(e) {}
  7038. // [v3.4 task #1] 三层 fallback 同 jumpToAssetCenter
  7039. setTimeout(() => {
  7040. if (typeof navJumpTo === 'function') {
  7041. navJumpTo('letssee');
  7042. } else if (window.CY_PAGES && window.CY_PAGES.letssee) {
  7043. window.location.href = window.CY_PAGES.letssee;
  7044. } else {
  7045. window.location.href = '承延融合平台v2.3(+蒙特卡罗置信区间)-顾问端LetsSee.html';
  7046. }
  7047. }, 500);
  7048. }
  7049. /* === [v4.4] 现金流规划 · LDI 视角 · 年保费支出趋势图 === */
  7050. /* === [v4.5] 扩展为"60 年生命周期净现金流"·支出期(Y0-Y30 向上)+ 领取期(Y30-Y60 向下) === */
  7051. /* 设计:Canvas 双向柱状图,7 险种支出向上 + 养老/教育/终身寿返还向下,服务于全周期 LDI 规划 */
  7052. function renderPremiumTimeline(d) {
  7053. // [v4.6] 缓存最近一次 timeline data,供三轨自定义方案 input 修改时无 calculate() 直接重画
  7054. window._cyLastTimelineData = d;
  7055. const canvas = document.getElementById('premiumTimelineCanvas');
  7056. if (!canvas) return;
  7057. const ctx2d = canvas.getContext('2d');
  7058. // ===== [v4.5.2] 方案切换 · 默认建议方案 ('full'),客户主动切到 'affordable' =====
  7059. // [v4.6] 新增 'custom' 方案 · 读 window._cyCustomPremiums(三轨表 C 列实时编辑)
  7060. const scenario = window._cyShowScenario || 'full';
  7061. const isAffordable = scenario === 'affordable';
  7062. const _custom = window._cyCustomPremiums;
  7063. // 自定义方案兜底:三轨表未显示(无缩减)时,custom 等同 full;否则用 _cyCustomPremiums
  7064. const isCustom = scenario === 'custom' && _custom && Object.keys(_custom).length > 0;
  7065. // 选择保费数据源
  7066. const _afford = window._cyAffordablePremiums || {};
  7067. const premiumsForChart = isCustom ? {
  7068. accident: _custom.acc !== undefined ? _custom.acc : (d.accidentPremium||0),
  7069. medical: _custom.med !== undefined ? _custom.med : (d.medPremium||0),
  7070. ci: _custom.ci !== undefined ? _custom.ci : (d.ciPremium||0),
  7071. life: _custom.life!== undefined ? _custom.life: (d.lifePremium||0),
  7072. retire: _custom.retire !== undefined ? _custom.retire : (d.retirePremium||0),
  7073. edu: _custom.edu !== undefined ? _custom.edu : (d.eduPremium||0),
  7074. wl: _custom.wl !== undefined ? _custom.wl : (d.wlPremium||0)
  7075. } : isAffordable ? {
  7076. accident: _afford.acc !== undefined ? _afford.acc : (d.accidentPremium||0),
  7077. medical: _afford.med !== undefined ? _afford.med : (d.medPremium||0),
  7078. ci: _afford.ci !== undefined ? _afford.ci : (d.ciPremium||0),
  7079. life: _afford.life!== undefined ? _afford.life: (d.lifePremium||0),
  7080. retire: _afford.retire !== undefined ? _afford.retire : (d.retirePremium||0),
  7081. edu: _afford.edu !== undefined ? _afford.edu : (d.eduPremium||0),
  7082. wl: _afford.wl !== undefined ? _afford.wl : (d.wlPremium||0)
  7083. } : {
  7084. accident: d.accidentPremium||0,
  7085. medical: d.medPremium||0,
  7086. ci: d.ciPremium||0,
  7087. life: d.lifePremium||0,
  7088. retire: d.retirePremium||0,
  7089. edu: d.eduPremium||0,
  7090. wl: d.wlPremium||0
  7091. };
  7092. // 缩减后保额(用于领取端重算)
  7093. // 保费 = 保额 × 0.025 × 10000(万 → 元)→ 保额 = 保费 / (0.025 × 10000) = 保费 / 250
  7094. const adjustedRetireNeed = (isAffordable || isCustom)
  7095. ? premiumsForChart.retire / 250 // 缩减后养老金保额(万)
  7096. : (d.retireNeed || 0);
  7097. const adjustedEduNeed = (isAffordable || isCustom)
  7098. ? premiumsForChart.edu / 250
  7099. : (d.eduNeed || 0);
  7100. // ===== Step 1: 生成 60 年时间线数据(支出 + 领取) =====
  7101. // [v4.7+] 缴费年限智能化(单一数据源):算法 (calculate() 内) 已根据 yearsToRetire 智能算出
  7102. // ciPayYears / lifePayYears / wlPayYears / retirePayYears,这里直接读 d.* 不再重复计算
  7103. // 银发族 55 岁 + 退休 60 岁 → retire/wl = 5 年缴清,Canvas 流出图与算法完全一致
  7104. const _retireWlYears = (typeof d.wlPayYears === 'number' ? d.wlPayYears : 20);
  7105. const _retirePayYears = (typeof d.retirePayYears === 'number' ? d.retirePayYears : 20);
  7106. const _lifeCiYears = (typeof d.lifePayYears === 'number' ? d.lifePayYears : 30);
  7107. const _ciYears = (typeof d.ciPayYears === 'number' ? d.ciPayYears : 20);
  7108. const PAY_CYCLES = {
  7109. accident: { years: 99, recurring: true, total: premiumsForChart.accident, color: '#9B7C3A', label: '意外险' },
  7110. medical: { years: 99, recurring: true, total: premiumsForChart.medical, color: '#C4973A', label: '高端医疗'},
  7111. ci: { years: _ciYears, recurring: false, total: premiumsForChart.ci, color: '#A61C2B', label: '重疾' },
  7112. life: { years: _lifeCiYears, recurring: false, total: premiumsForChart.life, color: '#7A3FA0', label: '定期寿险'},
  7113. retire: { years: _retirePayYears, recurring: false, total: premiumsForChart.retire, color: '#3D6F8C', label: '养老金' },
  7114. edu: { years: d.eduPayYears || 15, recurring: false, total: premiumsForChart.edu, color: '#5DB890', label: '教育金' },
  7115. wl: { years: _retireWlYears, recurring: false, total: premiumsForChart.wl, color: '#7A5A8E', label: '终身寿险'}
  7116. };
  7117. // [v4.5] 领取期参数(向下柱)· [v4.5.2] 用 adjusted 保额(缩减后)
  7118. const _age = d.age || 35;
  7119. const _retireAge = d.retireAge || 60;
  7120. const yearsToRetire = Math.max(0, _retireAge - _age);
  7121. const retireYears = 30; // 退休后 30 年领取期
  7122. const annualRetireWan = adjustedRetireNeed / retireYears; // [v4.5.2] 缩减后养老金保额
  7123. // 教育返还:逐子女计算 startY-endY · [v4.5.2] eduUnit 按缩减后口径
  7124. const eduIncomeTimeline = {}; // year → wan
  7125. const _adjustedEduUnit = (isAffordable || isCustom) && (d.eduUnit || 0) > 0 && (d.eduNeed || 0) > 0
  7126. ? (d.eduUnit || 0) * (adjustedEduNeed / d.eduNeed) // 按缩减后保额比例缩减单价
  7127. : (d.eduUnit || 0);
  7128. if (d.childAges && d.childAges.length > 0 && _adjustedEduUnit > 0) {
  7129. const annualEduPerChild = _adjustedEduUnit / 4; // 4 年大学,每年 eduUnit/4
  7130. d.childAges.forEach(cAge => {
  7131. const startY = Math.max(0, 18 - cAge);
  7132. const endY = Math.max(0, 22 - cAge);
  7133. for (let y = startY; y < endY; y++) {
  7134. eduIncomeTimeline[y] = (eduIncomeTimeline[y] || 0) + annualEduPerChild;
  7135. }
  7136. });
  7137. }
  7138. const orderedKeys = ['accident','medical','ci','life','retire','edu','wl'];
  7139. const TIMELINE_YEARS = 60; // [v4.5] 30 → 60 年
  7140. const timeline = [];
  7141. for (let y = 0; y < TIMELINE_YEARS; y++) {
  7142. const yearData = { year: y, total: 0, items: {}, incomeTotal: 0, incomeItems: {} };
  7143. // 支出端(向上)
  7144. orderedKeys.forEach(key => {
  7145. const cfg = PAY_CYCLES[key];
  7146. const annualPremium = cfg.total / 10000;
  7147. let amount = 0;
  7148. if (cfg.recurring) amount = annualPremium;
  7149. else if (y < cfg.years) amount = annualPremium;
  7150. yearData.items[key] = amount;
  7151. yearData.total += amount;
  7152. });
  7153. // [v4.5] 领取端(向下)
  7154. // 养老金:Y(yearsToRetire) 到 Y(yearsToRetire + 30)
  7155. if (y >= yearsToRetire && y < yearsToRetire + retireYears && annualRetireWan > 0) {
  7156. yearData.incomeItems.retireIncome = annualRetireWan;
  7157. yearData.incomeTotal += annualRetireWan;
  7158. }
  7159. // 教育金返还
  7160. if (eduIncomeTimeline[y]) {
  7161. yearData.incomeItems.eduIncome = eduIncomeTimeline[y];
  7162. yearData.incomeTotal += eduIncomeTimeline[y];
  7163. }
  7164. timeline.push(yearData);
  7165. }
  7166. // ===== Step 2: 计算关键节点(支出 + 领取双视角) =====
  7167. const peakYears = timeline.slice(0, 15); // Y0-Y15 高峰期
  7168. const midYears = timeline.slice(15, 20); // Y15-Y20 过渡期
  7169. const endYears = timeline.slice(20, 30); // Y20-Y30 尾段
  7170. const retireYearsArr = timeline.slice(yearsToRetire, Math.min(60, yearsToRetire + retireYears)); // 领取期
  7171. const peakAvg = peakYears.reduce((s, y) => s + y.total, 0) / peakYears.length;
  7172. const midAvg = midYears.reduce((s, y) => s + y.total, 0) / midYears.length;
  7173. const endAvg = endYears.reduce((s, y) => s + y.total, 0) / endYears.length;
  7174. const retireIncomeAvg = retireYearsArr.length > 0
  7175. ? retireYearsArr.reduce((s, y) => s + y.incomeTotal, 0) / retireYearsArr.length
  7176. : 0;
  7177. const totalLifetimeOutflow = timeline.reduce((s, y) => s + y.total, 0); // 60 年累计流出
  7178. const totalLifetimeIncome = timeline.reduce((s, y) => s + y.incomeTotal, 0); // 60 年累计流入
  7179. const netCashflow = totalLifetimeIncome - totalLifetimeOutflow;
  7180. // ===== Step 3: Canvas 渲染(双向柱:支出向上 + 收入向下) =====
  7181. const W = canvas.width;
  7182. const H = canvas.height;
  7183. const padLeft = 64, padRight = 24, padTop = 28, padBottom = 64;
  7184. const chartW = W - padLeft - padRight;
  7185. const chartH = H - padTop - padBottom;
  7186. const barGap = 1; // [v4.5] 60 年柱多了,gap 减半
  7187. const barW = (chartW - barGap * (TIMELINE_YEARS - 1)) / TIMELINE_YEARS;
  7188. // 找最大值确定 Y 轴(支出 + 领取双向)
  7189. const maxOutflow = Math.max(...timeline.map(y => y.total));
  7190. const maxIncome = Math.max(...timeline.map(y => y.incomeTotal));
  7191. // [v4.4.5] 红线 = 实际可负担方案保费(双轨 B 列, affordableTotalYuan)而非理论上限
  7192. // 理论上限 = salary/AUM × cap% (计算用,但不画在 Canvas 上,避免与双轨 B 列冲突)
  7193. const affordableLineWan = (typeof d.affordableTotalYuan === 'number' && d.affordableTotalYuan > 0)
  7194. ? (d.affordableTotalYuan / 10000)
  7195. : ((d.affordableCap && d.denominatorYuan) ? (d.affordableCap * d.denominatorYuan / 10000) : 0);
  7196. const _theoreticalCapWan = (d.affordableCap && d.denominatorYuan)
  7197. ? (d.affordableCap * d.denominatorYuan / 10000)
  7198. : 0;
  7199. // [v4.5] Y 轴双向 · 上半 = 支出 (peak max),下半 = 领取 (income max)
  7200. const yMaxOut = Math.ceil(Math.max(maxOutflow, affordableLineWan * 1.05) * 1.1 / 50) * 50 || 50;
  7201. const yMaxIn = Math.ceil(maxIncome * 1.1 / 50) * 50 || 50;
  7202. // 上下区域比例 · 默认 60%(支出)/ 40%(领取),按数据自适应
  7203. const totalRange = yMaxOut + yMaxIn;
  7204. const outAreaRatio = totalRange > 0 ? yMaxOut / totalRange : 0.6;
  7205. const outAreaH = chartH * outAreaRatio;
  7206. const inAreaH = chartH - outAreaH;
  7207. const baselineY = padTop + outAreaH; // 0 轴位置(支出向上 / 领取向下)
  7208. // 清空 Canvas
  7209. ctx2d.fillStyle = '#FFFFFF';
  7210. ctx2d.fillRect(0, 0, W, H);
  7211. // 绘制 Y 轴网格 + 标签(双向 · 支出向上,领取向下)
  7212. ctx2d.strokeStyle = '#E8DFC8';
  7213. ctx2d.lineWidth = 1;
  7214. ctx2d.font = '10.5px Inter, sans-serif';
  7215. ctx2d.fillStyle = '#7A6028';
  7216. ctx2d.textAlign = 'right';
  7217. ctx2d.textBaseline = 'middle';
  7218. // 上半区(支出, 0 → yMaxOut)
  7219. const yTicksOut = 4;
  7220. for (let i = 0; i <= yTicksOut; i++) {
  7221. const v = (yMaxOut / yTicksOut) * i;
  7222. const y = baselineY - (outAreaH / yTicksOut) * i;
  7223. ctx2d.beginPath();
  7224. ctx2d.moveTo(padLeft, y);
  7225. ctx2d.lineTo(W - padRight, y);
  7226. ctx2d.stroke();
  7227. ctx2d.fillText('¥' + v.toFixed(0) + '万', padLeft - 8, y);
  7228. }
  7229. // 下半区(领取, 0 → -yMaxIn) · 标签为正数前加 -
  7230. const yTicksIn = 3;
  7231. for (let i = 1; i <= yTicksIn; i++) {
  7232. const v = (yMaxIn / yTicksIn) * i;
  7233. const y = baselineY + (inAreaH / yTicksIn) * i;
  7234. ctx2d.beginPath();
  7235. ctx2d.moveTo(padLeft, y);
  7236. ctx2d.lineTo(W - padRight, y);
  7237. ctx2d.stroke();
  7238. ctx2d.fillStyle = '#2DB37C'; // 领取用绿色标签
  7239. ctx2d.fillText('+¥' + v.toFixed(0) + '万', padLeft - 8, y);
  7240. ctx2d.fillStyle = '#7A6028';
  7241. }
  7242. // 0 基线(加粗)
  7243. ctx2d.strokeStyle = '#3D2914';
  7244. ctx2d.lineWidth = 1.5;
  7245. ctx2d.beginPath();
  7246. ctx2d.moveTo(padLeft, baselineY);
  7247. ctx2d.lineTo(W - padRight, baselineY);
  7248. ctx2d.stroke();
  7249. ctx2d.lineWidth = 1;
  7250. // 绘制 X 轴标签(每 10 年一个 · v4.5 60 年时间线 + 投保人年龄)
  7251. ctx2d.textAlign = 'center';
  7252. ctx2d.textBaseline = 'top';
  7253. const baseAge = d.age || 0;
  7254. for (let y = 0; y < TIMELINE_YEARS; y += 10) {
  7255. const x = padLeft + (barW + barGap) * y + barW / 2;
  7256. // 上行:Y0/Y10/Y20... (主标签)
  7257. ctx2d.fillStyle = '#5C4810';
  7258. ctx2d.font = 'bold 10.5px Inter, sans-serif';
  7259. ctx2d.fillText('Y' + y, x, padTop + chartH + 6);
  7260. // 下行:35/45/55/65/75/85/95 岁 (年龄标签)
  7261. if (baseAge > 0) {
  7262. ctx2d.fillStyle = '#7A6028';
  7263. ctx2d.font = '10px Inter, sans-serif';
  7264. ctx2d.fillText((baseAge + y) + ' 岁', x, padTop + chartH + 22);
  7265. }
  7266. }
  7267. // 退休点垂直分割线(虚线)
  7268. if (yearsToRetire > 0 && yearsToRetire < TIMELINE_YEARS) {
  7269. const xRetire = padLeft + (barW + barGap) * yearsToRetire;
  7270. ctx2d.save();
  7271. ctx2d.strokeStyle = '#9B7C3A';
  7272. ctx2d.lineWidth = 1.5;
  7273. ctx2d.setLineDash([4, 3]);
  7274. ctx2d.beginPath();
  7275. ctx2d.moveTo(xRetire, padTop);
  7276. ctx2d.lineTo(xRetire, padTop + chartH);
  7277. ctx2d.stroke();
  7278. ctx2d.restore();
  7279. ctx2d.fillStyle = '#9B7C3A';
  7280. ctx2d.font = 'bold 10.5px Inter, sans-serif';
  7281. ctx2d.textAlign = 'left';
  7282. ctx2d.textBaseline = 'top';
  7283. ctx2d.fillText('🏖 退休 ' + (baseAge + yearsToRetire) + '岁', xRetire + 4, padTop + 4);
  7284. }
  7285. // X 轴底标签(向下挪以避让年龄标签)
  7286. ctx2d.font = '10.5px Inter, sans-serif';
  7287. ctx2d.fillStyle = '#7A6028';
  7288. ctx2d.textAlign = 'center';
  7289. ctx2d.fillText('60 年生命周期 · Y0 = 当前 / 投保人年龄', W / 2, padTop + chartH + 38);
  7290. // 绘制堆叠柱(双向 · 支出向上 + 领取向下)
  7291. const barRects = []; // 用于 hit-test tooltip
  7292. timeline.forEach((yearData, idx) => {
  7293. const x = padLeft + (barW + barGap) * idx;
  7294. // ↑ 支出柱(向上堆叠)
  7295. let yCursorOut = baselineY;
  7296. orderedKeys.forEach(key => {
  7297. const cfg = PAY_CYCLES[key];
  7298. const v = yearData.items[key];
  7299. if (v <= 0) return;
  7300. const segH = yMaxOut > 0 ? (v / yMaxOut) * outAreaH : 0;
  7301. yCursorOut -= segH;
  7302. ctx2d.fillStyle = cfg.color;
  7303. ctx2d.fillRect(x, yCursorOut, barW, segH);
  7304. });
  7305. // ↓ 领取柱(向下堆叠)
  7306. let yCursorIn = baselineY;
  7307. if (yearData.incomeItems.retireIncome) {
  7308. const v = yearData.incomeItems.retireIncome;
  7309. const segH = yMaxIn > 0 ? (v / yMaxIn) * inAreaH : 0;
  7310. ctx2d.fillStyle = '#2DB37C'; // 养老月领 · 绿色
  7311. ctx2d.fillRect(x, yCursorIn, barW, segH);
  7312. yCursorIn += segH;
  7313. }
  7314. if (yearData.incomeItems.eduIncome) {
  7315. const v = yearData.incomeItems.eduIncome;
  7316. const segH = yMaxIn > 0 ? (v / yMaxIn) * inAreaH : 0;
  7317. ctx2d.fillStyle = '#5DB890'; // 教育金返还 · 浅绿色(稍亮区分)
  7318. ctx2d.fillRect(x, yCursorIn, barW, segH);
  7319. yCursorIn += segH;
  7320. }
  7321. // 记录柱坐标(用于 tooltip · 含支出 + 领取)
  7322. const totalHOut = yMaxOut > 0 ? (yearData.total / yMaxOut) * outAreaH : 0;
  7323. const totalHIn = yMaxIn > 0 ? (yearData.incomeTotal / yMaxIn) * inAreaH : 0;
  7324. barRects.push({
  7325. x: x, y: baselineY - totalHOut, w: barW,
  7326. h: totalHOut + totalHIn,
  7327. yearData: yearData
  7328. });
  7329. });
  7330. // 顶部标题
  7331. ctx2d.font = 'bold 11px Inter, sans-serif';
  7332. ctx2d.fillStyle = '#1A0F05';
  7333. ctx2d.textAlign = 'left';
  7334. ctx2d.textBaseline = 'top';
  7335. ctx2d.fillText('↑ 流出(年保费) · ¥万', padLeft, 8);
  7336. ctx2d.fillStyle = '#2DB37C';
  7337. ctx2d.textAlign = 'right';
  7338. ctx2d.fillText('↓ 流入(养老月领 + 教育返还) · ¥万', W - padRight, 8);
  7339. // [v4.4.5] 可负担方案警戒线(红色虚线 · 只画在支出区,baseline 上方)
  7340. if (affordableLineWan > 0 && affordableLineWan < yMaxOut) {
  7341. const lineY = baselineY - (affordableLineWan / yMaxOut) * outAreaH;
  7342. ctx2d.save();
  7343. ctx2d.strokeStyle = '#E87070';
  7344. ctx2d.lineWidth = 2;
  7345. ctx2d.setLineDash([6, 4]);
  7346. ctx2d.beginPath();
  7347. ctx2d.moveTo(padLeft, lineY);
  7348. ctx2d.lineTo(W - padRight, lineY);
  7349. ctx2d.stroke();
  7350. ctx2d.restore();
  7351. // 标签 — 与双轨 B 列对齐
  7352. ctx2d.fillStyle = '#E87070';
  7353. ctx2d.font = 'bold 10.5px Inter, sans-serif';
  7354. ctx2d.textAlign = 'right';
  7355. ctx2d.textBaseline = 'bottom';
  7356. ctx2d.fillText('⚠ 可负担方案 ¥' + affordableLineWan.toFixed(1) + '万/年(= 三轨 B 列)', W - padRight - 4, lineY - 2);
  7357. }
  7358. // [v4.6] 自定义方案警戒线(蓝色虚线 · 只画在支出区 · 仅当三轨表展示时画 · 与可负担方案差 > 0.5 万时才画,避免重叠)
  7359. const customLineYuan = (typeof window._cyCustomTotalYuan === 'number') ? window._cyCustomTotalYuan : 0;
  7360. const customLineWan = customLineYuan / 10000;
  7361. const triVisible = (function(){
  7362. const el = document.getElementById('affDualTrack');
  7363. return el && el.style.display !== 'none';
  7364. })();
  7365. if (triVisible && customLineWan > 0 && customLineWan < yMaxOut &&
  7366. Math.abs(customLineWan - affordableLineWan) > 0.5) {
  7367. const lineY2 = baselineY - (customLineWan / yMaxOut) * outAreaH;
  7368. ctx2d.save();
  7369. ctx2d.strokeStyle = '#2B6CB0';
  7370. ctx2d.lineWidth = 2;
  7371. ctx2d.setLineDash([8, 3, 2, 3]); // 虚线段更密 + 不同间距,与可负担方案区分
  7372. ctx2d.beginPath();
  7373. ctx2d.moveTo(padLeft, lineY2);
  7374. ctx2d.lineTo(W - padRight, lineY2);
  7375. ctx2d.stroke();
  7376. ctx2d.restore();
  7377. // 标签放左侧避让可负担方案标签
  7378. ctx2d.fillStyle = '#2B6CB0';
  7379. ctx2d.font = 'bold 10.5px Inter, sans-serif';
  7380. ctx2d.textAlign = 'left';
  7381. ctx2d.textBaseline = customLineWan > affordableLineWan ? 'bottom' : 'top';
  7382. const labelOffsetY = customLineWan > affordableLineWan ? -2 : 2;
  7383. ctx2d.fillText('🔵 自定义方案 ¥' + customLineWan.toFixed(1) + '万/年(= 三轨 C 列)', padLeft + 4, lineY2 + labelOffsetY);
  7384. }
  7385. // ===== Step 4: 鼠标交互 tooltip =====
  7386. const tooltip = document.getElementById('cfTooltip');
  7387. // 移除旧监听器
  7388. if (canvas._mmHandler) canvas.removeEventListener('mousemove', canvas._mmHandler);
  7389. if (canvas._mlHandler) canvas.removeEventListener('mouseleave', canvas._mlHandler);
  7390. canvas._mmHandler = function(e) {
  7391. const rect = canvas.getBoundingClientRect();
  7392. const mx = (e.clientX - rect.left) * (canvas.width / rect.width);
  7393. const my = (e.clientY - rect.top) * (canvas.height / rect.height);
  7394. let hit = null;
  7395. for (let i = 0; i < barRects.length; i++) {
  7396. const b = barRects[i];
  7397. // 放宽命中区域到整个柱位置(包括空白)
  7398. if (mx >= b.x && mx <= b.x + b.w) {
  7399. hit = b;
  7400. break;
  7401. }
  7402. }
  7403. if (hit) {
  7404. const yd = hit.yearData;
  7405. const _baseAge = baseAge || 0;
  7406. const netY = yd.incomeTotal - yd.total;
  7407. const netSign = netY >= 0 ? '+' : '';
  7408. let html = '<strong>Y' + yd.year + (_baseAge ? ' · ' + (_baseAge + yd.year) + ' 岁' : '') + '</strong>';
  7409. // 流出明细
  7410. if (yd.total > 0) {
  7411. html += '<div class="tooltip-row" style="margin-top:6px;color:#FFB8B0"><span><strong>↑ 流出 ¥' + yd.total.toFixed(2) + '万</strong></span></div>';
  7412. orderedKeys.forEach(key => {
  7413. if (yd.items[key] > 0) {
  7414. 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>';
  7415. }
  7416. });
  7417. }
  7418. // 流入明细
  7419. if (yd.incomeTotal > 0) {
  7420. html += '<div class="tooltip-row" style="margin-top:6px;color:#90E0B0"><span><strong>↓ 流入 ¥' + yd.incomeTotal.toFixed(2) + '万</strong></span></div>';
  7421. if (yd.incomeItems.retireIncome) {
  7422. html += '<div class="tooltip-row"><span><span class="tooltip-dot" style="background:#2DB37C"></span>养老月领</span><span>+¥' + yd.incomeItems.retireIncome.toFixed(2) + '万</span></div>';
  7423. }
  7424. if (yd.incomeItems.eduIncome) {
  7425. html += '<div class="tooltip-row"><span><span class="tooltip-dot" style="background:#5DB890"></span>教育金返还</span><span>+¥' + yd.incomeItems.eduIncome.toFixed(2) + '万</span></div>';
  7426. }
  7427. }
  7428. // 净现金流
  7429. 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>';
  7430. tooltip.innerHTML = html;
  7431. tooltip.style.display = 'block';
  7432. tooltip.style.left = (e.clientX - rect.left + 12) + 'px';
  7433. tooltip.style.top = (e.clientY - rect.top - 10) + 'px';
  7434. } else {
  7435. tooltip.style.display = 'none';
  7436. }
  7437. };
  7438. canvas._mlHandler = function() { tooltip.style.display = 'none'; };
  7439. canvas.addEventListener('mousemove', canvas._mmHandler);
  7440. canvas.addEventListener('mouseleave', canvas._mlHandler);
  7441. // ===== Step 5: 关键节点说明 + LDI 建议(v4.5 60 年生命周期视角) =====
  7442. // [v4.5.1] 同步刷新风险对冲覆盖 KPI 卡片
  7443. const _onetimeCoverageWan = (d.totalOnetimeCoverage || 0);
  7444. const rhkEl = document.getElementById('rhkTotalCoverage');
  7445. if (rhkEl) {
  7446. rhkEl.textContent = _onetimeCoverageWan >= 10000
  7447. ? '¥' + (_onetimeCoverageWan / 10000).toFixed(2) + '亿'
  7448. : '¥' + Math.round(_onetimeCoverageWan) + '万';
  7449. }
  7450. const rhkFooterEl = document.getElementById('rhkFooter');
  7451. if (rhkFooterEl) {
  7452. const aumWan = d.totalAumForWL || 0;
  7453. const coverPct = aumWan > 0 ? (_onetimeCoverageWan / aumWan * 100).toFixed(0) : '—';
  7454. rhkFooterEl.innerHTML =
  7455. '💡 这是 Canvas 图表 <strong>外的隐性流入</strong> · 一旦出险,保险公司一次性赔付 <strong>¥' +
  7456. (_onetimeCoverageWan >= 10000 ? (_onetimeCoverageWan/10000).toFixed(2) + '亿' : Math.round(_onetimeCoverageWan) + '万') +
  7457. '</strong>(占总财富 ' + coverPct + '%) · 杠杆对冲 + 现金价值 + 跨代传承 + 税务隔离 + 紧急救援(详见 ⓘ 5 视角)';
  7458. }
  7459. // [v4.5.2] 杠杆比指标 · 仅可负担方案 / 自定义方案下显示
  7460. // [v4.6] 自定义方案也显示杠杆比 · 用 _cyCustomTotalYuan
  7461. const rhkLevEl = document.getElementById('rhkLeverage');
  7462. if (rhkLevEl) {
  7463. if (isAffordable || isCustom) {
  7464. // 当前方案 20 年累计总保费(元) · [v4.7] 杠杆比也用纯保障型口径(剔除养老/教育/终身寿储蓄)
  7465. const _baseTotalYuan = isCustom
  7466. ? (window._cyCustomTotalYuan || 0)
  7467. : (window._cyAffordableTotalYuan || 0);
  7468. // [v4.7] 提取该方案下的纯保障型保费(acc + med + ci + life),与上方 leverageV4 同一口径
  7469. const _premsForScenario = isCustom
  7470. ? (window._cyCustomPremiums || window._cyAffordablePremiums || {})
  7471. : (window._cyAffordablePremiums || {});
  7472. const _protectionAnnualWan = ((_premsForScenario.acc || 0) + (_premsForScenario.med || 0) +
  7473. (_premsForScenario.ci || 0) + (_premsForScenario.life || 0)) / 10000;
  7474. const _protectionTotal20yWan = _protectionAnnualWan * 20;
  7475. const total20yPremiumYuan = _baseTotalYuan * 20;
  7476. const total20yPremiumWan = total20yPremiumYuan / 10000;
  7477. // [v4.7] 杠杆口径修正:用纯保障型保费,而非 7 险种全合计
  7478. const leverageRatio = _protectionTotal20yWan > 0
  7479. ? (_onetimeCoverageWan / _protectionTotal20yWan).toFixed(1)
  7480. : '—';
  7481. const _scnLabel = isCustom ? '自定义方案' : '可负担方案';
  7482. const ratioEl = document.getElementById('rhkLeverageRatio');
  7483. const descEl = document.getElementById('rhkLeverageDesc');
  7484. if (ratioEl) ratioEl.textContent = leverageRatio;
  7485. if (descEl) {
  7486. descEl.innerHTML = '客户用 <strong>¥' + Math.round(_protectionTotal20yWan) + ' 万</strong>(20 年纯保障型' + _scnLabel + '保费 · 剔除储蓄)换 <strong>¥' +
  7487. (_onetimeCoverageWan >= 10000 ? (_onetimeCoverageWan/10000).toFixed(2) + '亿' : Math.round(_onetimeCoverageWan) + '万') +
  7488. '</strong> 风险保障 · <strong>每 1 元保费换 ' + leverageRatio + ' 元保障</strong>' +
  7489. '<br><span style="font-size:10.5px;color:#7A6028">📌 v4.7 口径修正:杠杆比仅算保障型保费(意外/医疗/重疾/定寿),不计养老/教育/终身寿(储蓄性质,不属"杠杆"范畴)</span>';
  7490. }
  7491. rhkLevEl.style.display = 'flex';
  7492. } else {
  7493. rhkLevEl.style.display = 'none';
  7494. }
  7495. }
  7496. // [v4.5.2] 更新切换器副文案(年缴金额) · [v4.6] 加自定义方案副文案
  7497. const _scnFullYuan = ((d.accidentPremium||0) + (d.medPremium||0) + (d.ciPremium||0) + (d.lifePremium||0) + (d.retirePremium||0) + (d.eduPremium||0) + (d.wlPremium||0));
  7498. const _scnAfford = window._cyAffordableTotalYuan || _scnFullYuan;
  7499. const _scnCustomYuan = (typeof window._cyCustomTotalYuan === 'number') ? window._cyCustomTotalYuan : _scnAfford;
  7500. const scnFullEl = document.getElementById('scnFullDetail');
  7501. const scnAffordEl = document.getElementById('scnAffordableDetail');
  7502. const scnCustomEl = document.getElementById('scnCustomDetail');
  7503. if (scnFullEl) scnFullEl.textContent = '完整需求 · 年缴 ¥' + (_scnFullYuan/10000).toFixed(1) + '万';
  7504. if (scnAffordEl) scnAffordEl.textContent = '系统缩减 · 年缴 ¥' + (_scnAfford/10000).toFixed(1) + '万';
  7505. if (scnCustomEl) {
  7506. if (window._cyCustomPremiums && Object.keys(window._cyCustomPremiums).length > 0) {
  7507. scnCustomEl.textContent = '代理人编辑 · 年缴 ¥' + (_scnCustomYuan/10000).toFixed(1) + '万';
  7508. } else {
  7509. scnCustomEl.textContent = '等同完整需求 · 无需缩减';
  7510. }
  7511. }
  7512. // 切换器 hint
  7513. const hintEl = document.getElementById('cfScenarioHint');
  7514. if (hintEl) {
  7515. if (isCustom) {
  7516. hintEl.innerHTML = '🔵 当前展示「自定义方案」· 直接读取三轨表 C 列实时编辑值 · Canvas 同步反映<strong>代理人微调后</strong>的现金流';
  7517. } else if (isAffordable) {
  7518. hintEl.innerHTML = '✓ 当前展示「可负担方案」· 系统已按客户支付能力缩减养老/教育/终身寿,Canvas 反映<strong>真实未来现金流</strong>';
  7519. } else {
  7520. hintEl.innerHTML = '💡 当前展示「建议方案」· 完整需求口径,养老/教育按完整 retireNeed/eduNeed 计算 · 切换可负担/自定义方案查看真实可承受版本';
  7521. }
  7522. }
  7523. const insightsEl = document.getElementById('cfInsights');
  7524. if (insightsEl) {
  7525. const overflowYears = timeline.filter(y => affordableLineWan > 0 && y.total > affordableLineWan).length;
  7526. const overflowNote = overflowYears > 0 && affordableLineWan > 0
  7527. ? `<br><span style="color:#A61C2B;font-weight:600">⚠ 共 ${overflowYears}/30 年超出三轨 B 列</span>`
  7528. : '';
  7529. const retireStartAge = (d.age || 0) + yearsToRetire;
  7530. insightsEl.innerHTML =
  7531. '<div class="cf-insight cf-insight-peak"><strong>↑ 流出 · Y0-Y15</strong> 年均保费 ¥' + peakAvg.toFixed(0) + '万 · 高峰期需短久期债券匹配' + overflowNote + '</div>' +
  7532. '<div class="cf-insight cf-insight-mid"><strong>↑ 流出 · Y20-Y30</strong> 年均保费 ¥' + endAvg.toFixed(0) + '万 · 储蓄型缴清,只剩续保险种</div>' +
  7533. '<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>';
  7534. }
  7535. // LDI 资产匹配建议(动态文案 · v4.5 加 60 年净现金流)
  7536. const ldiEl = document.getElementById('ldiSuggestion');
  7537. if (ldiEl) {
  7538. const totalY15 = peakYears.reduce((s, y) => s + y.total, 0);
  7539. const aumWan = d.totalAumForWL || 0;
  7540. const aumPctY15 = aumWan > 0 ? (totalY15 / aumWan * 100).toFixed(1) : '0';
  7541. const overflowYears = timeline.filter(y => affordableLineWan > 0 && y.total > affordableLineWan).length;
  7542. let affordableNote = '';
  7543. if (affordableLineWan > 0) {
  7544. if (overflowYears > 0) {
  7545. affordableNote = '<br><strong style="color:#A61C2B">⚠ 可负担方案对比</strong>:建议方案在 ' + overflowYears + ' 年超出三轨 B 列 ¥' + affordableLineWan.toFixed(1) + '万/年。代理人应与客户讨论缩减储蓄型 / 延长缴费期 / 推迟部分险种到 Y15+ 配置。';
  7546. } else {
  7547. affordableNote = '<br><strong style="color:#2DB37C">✓ 全周期可负担</strong>:30 年内年缴均未超出三轨 B 列 ¥' + affordableLineWan.toFixed(1) + '万/年。';
  7548. }
  7549. }
  7550. // [v4.5] 60 年净现金流总结
  7551. const lifetimeSummary = '<br><strong style="color:#7A5A8E">📊 60 年生命周期净现金流</strong>:累计流出 ¥' + totalLifetimeOutflow.toFixed(0) + '万(保费投入)/ 累计流入 ¥' + totalLifetimeIncome.toFixed(0) + '万(养老 + 教育返还)' +
  7552. ' / <strong>净 ' + (netCashflow >= 0 ? '+' : '') + '¥' + netCashflow.toFixed(0) + '万</strong> ' +
  7553. (netCashflow >= 0
  7554. ? '<span style="color:#2DB37C">(资产增值,保险既保障也是长期储蓄工具)</span>'
  7555. : '<span style="color:#7A6028">(净支出,保险价值在风险对冲 + 现金价值积累 + 身故金跨代传承,不能单看流入流出账面差额)</span>');
  7556. ldiEl.innerHTML =
  7557. '<strong>💡 LDI 视角投资建议</strong> · ' +
  7558. 'Y0-Y15 期间(高峰期)累计保费支出约 <strong>¥' + totalY15.toFixed(0) + '万</strong>(占总财富 ' + aumPctY15 + '%)。' +
  7559. '建议配置等额的<strong>短久期债券</strong>(1-5 年期国债 + 货币基金)用于覆盖年保费支出。<br>' +
  7560. 'Y15+ 之后流动性需求降低,可逐步增配长期增值资产(股票 / 私募 / PE)。' +
  7561. 'Y' + yearsToRetire + '+ 退休后,养老月领进入流入期 → 资产配置转向"保守 + 稳定收益"匹配生活支出。' +
  7562. affordableNote +
  7563. lifetimeSummary +
  7564. '<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>';
  7565. }
  7566. // [v4.4.2] LDI 通用 disclaimer popover · 在 DOM 中只创建一次
  7567. if (ldiEl && !document.getElementById('info-ldi-disclaimer')) {
  7568. const overlay = document.createElement('div');
  7569. overlay.className = 'info-popover-overlay';
  7570. overlay.id = 'info-ldi-disclaimer';
  7571. overlay.innerHTML =
  7572. '<div class="info-popover" onclick="event.stopPropagation()">' +
  7573. '<div class="info-popover-head">' +
  7574. '<span class="info-pop-icon">💡</span>' +
  7575. '<span>LDI 框架适用范围</span>' +
  7576. '<button class="info-popover-close" onclick="toggleInfoPopover(\'ldi-disclaimer\')">×</button>' +
  7577. '</div>' +
  7578. '<div class="info-popover-body">' +
  7579. '<p>本工具的 LDI(Liability Driven Investment · 负债驱动投资)框架是<strong>通用配置基线</strong>,主要适用于:</p>' +
  7580. '<ul>' +
  7581. '<li>主理人 35-55 岁,salary 100-1000 万 中端 HNW / 跨境美籍家庭</li>' +
  7582. '<li>资产以流动金融 + 自住房产 + 公募基金 + 港美股为主</li>' +
  7583. '<li>有 1-2 子女教育规划 + 退休规划需求</li>' +
  7584. '</ul>' +
  7585. '<div class="info-row info-row-warn">' +
  7586. '<strong>不适用场景</strong>:UHNW(≥¥10 亿 AUM)/ 极特殊行业(矿产/建筑/演艺等收入波动大)/ 复杂跨境家族架构(多本护照/多代际信托)。' +
  7587. '</div>' +
  7588. '<p><strong>具体方案</strong>需 1v1 顾问根据客户风险承受度 + 流动性偏好 + 跨境合规需求定制。Benchmark 后续版本将加 UI 输入字段(身份/US-situs 比例/家族信托结构)实现精细化测算。</p>' +
  7589. '</div>' +
  7590. '</div>';
  7591. document.body.appendChild(overlay);
  7592. }
  7593. }
  7594. function renderAffordabilityCheck(d) {
  7595. // [v2.9] 决定分母:HNW 用 AUM,普通家庭用工资
  7596. // [v4.7] 引入"中端档"分母公式 — totalWealth ∈ [2000 万, 5000 万) 走 max(salary × cap, AUM × 1%)
  7597. // 解决"高储蓄低工资"客户(如银发族 准退休 / 国企退休 G1)被 salary cap 强制卡死的问题
  7598. const isHNW = d.isHNW;
  7599. const familyIncomeWan = d.salary + d.spouseSalary; // 万
  7600. const aumWan = d.portraitAum > 0 ? d.portraitAum : (d.totalWealth > 0 ? d.totalWealth : (d.liquidAssets * 5)); // 万,优先 portrait → totalWealth(v3.4) → liquid×5 (legacy fallback)
  7601. // [v4.7] 三档分母逻辑
  7602. const HNW_CAP_MAP = {0.10:0.005, 0.15:0.01, 0.20:0.02, 0.30:0.03, 1.00:1.00};
  7603. const totalWealthForTier = d.totalWealth || 0; // 万
  7604. let denominatorWan, cap, tier, tierLabel, tierSub;
  7605. if (isHNW) {
  7606. tier = 'hnw';
  7607. tierLabel = '🏛 HNW 模式 · 总 AUM(支付能力分母)';
  7608. tierSub = d.portraitAum > 0 ? '总 AUM(画像实读)' : 'AUM 估算 = 流动资产 × 5';
  7609. denominatorWan = aumWan;
  7610. cap = HNW_CAP_MAP[d.affordabilityCap] !== undefined ? HNW_CAP_MAP[d.affordabilityCap] : (d.affordabilityCap * 0.1);
  7611. } else if (totalWealthForTier >= 2000 && totalWealthForTier < 5000) {
  7612. // [v4.7] 中端档:高储蓄低工资客户(如银发族),分母用 max(salary × cap, AUM × 1%)
  7613. tier = 'mid';
  7614. const incomeBudgetYuan = familyIncomeWan * d.affordabilityCap * 10000; // salary 路径年缴上限
  7615. const aumBudgetYuan = aumWan * 0.01 * 10000; // AUM × 1% 路径年缴上限
  7616. if (aumBudgetYuan > incomeBudgetYuan) {
  7617. // AUM 路径更宽松 → 用 AUM × 1%
  7618. tierLabel = '🟦 中端档 · AUM × 1%(高储蓄低工资优化)';
  7619. tierSub = `工资 ¥${familyIncomeWan}万 × ${(d.affordabilityCap*100).toFixed(0)}% = ¥${(incomeBudgetYuan/10000).toFixed(1)}万 < AUM ¥${aumWan.toFixed(0)}万 × 1% = ¥${(aumBudgetYuan/10000).toFixed(1)}万 · 取更宽口径`;
  7620. denominatorWan = aumWan;
  7621. cap = 0.01;
  7622. } else {
  7623. // salary 路径更宽松 → 沿用 salary
  7624. tierLabel = '🟩 中端档 · 工资口径';
  7625. tierSub = `工资 ¥${familyIncomeWan}万 × ${(d.affordabilityCap*100).toFixed(0)}% > AUM × 1% · 取更宽口径`;
  7626. denominatorWan = familyIncomeWan;
  7627. cap = d.affordabilityCap;
  7628. }
  7629. } else {
  7630. // 普通家庭 totalWealth < 2000 万
  7631. tier = 'normal';
  7632. tierLabel = '家庭年收入(支付能力分母)';
  7633. tierSub = `主理人 ¥${d.salary}万 + 配偶 ¥${d.spouseSalary}万`;
  7634. denominatorWan = familyIncomeWan;
  7635. cap = d.affordabilityCap;
  7636. }
  7637. const denominatorYuan = denominatorWan * 10000;
  7638. const fullPremium = d.totalPremium; // 元
  7639. const premiumRatio = denominatorYuan > 0 ? fullPremium / denominatorYuan : 0;
  7640. const coverageMultiple = denominatorWan > 0 ? d.totalCoverage / denominatorWan : 0;
  7641. // 顶部 4 卡片
  7642. const labelEl = document.getElementById('affFamilyIncomeLabel');
  7643. if (tier === 'hnw') {
  7644. if (labelEl) labelEl.textContent = '家庭 AUM(支付能力分母)';
  7645. document.getElementById('affFamilyIncome').textContent = '¥' + (aumWan >= 10000 ? (aumWan/10000).toFixed(2) + '亿' : aumWan.toFixed(0) + '万');
  7646. document.getElementById('affFamilyIncomeSub').textContent = tierSub;
  7647. } else if (tier === 'mid') {
  7648. if (labelEl) labelEl.textContent = tierLabel;
  7649. document.getElementById('affFamilyIncome').textContent = '¥' + (denominatorWan >= 10000 ? (denominatorWan/10000).toFixed(2) + '亿' : denominatorWan.toFixed(0) + '万');
  7650. document.getElementById('affFamilyIncomeSub').textContent = tierSub;
  7651. } else {
  7652. if (labelEl) labelEl.textContent = '家庭年收入';
  7653. document.getElementById('affFamilyIncome').textContent = '¥' + familyIncomeWan.toFixed(0) + '万';
  7654. document.getElementById('affFamilyIncomeSub').textContent = tierSub;
  7655. }
  7656. document.getElementById('affFullPremium').textContent = '¥' + (fullPremium/10000).toFixed(1) + '万';
  7657. document.getElementById('affFullPremiumSub').textContent = '7 险种缺口理论值';
  7658. document.getElementById('affPremiumRatio').textContent = (premiumRatio*100).toFixed((tier==='hnw'||tier==='mid')?2:0) + '%';
  7659. // 颜色 + 副文案(HNW / 中端档 用 AUM 标准 1-3%,普通家庭用 10-20%)
  7660. // [v4.7] 中端档复用 HNW 的 1-3% 区间(因为分母也是 AUM 口径)
  7661. let ratioColor, ratioStatus;
  7662. if (tier === 'hnw' || (tier === 'mid' && cap === 0.01)) {
  7663. if (premiumRatio <= 0.01) { ratioColor = '#2DB37C'; ratioStatus = '✓ 占 AUM ≤ 1% · ' + (tier==='hnw'?'HNW ':'中端档 ') + '健康区间'; }
  7664. else if (premiumRatio <= 0.03) { ratioColor = '#E89B3D'; ratioStatus = '⚠ 占 AUM 1-3% · ' + (tier==='hnw'?'HNW ':'中端档 ') + '警示区(行业 1-3%)'; }
  7665. else { ratioColor = '#A61C2B'; ratioStatus = '🔴 占 AUM > 3% · 超出行业惯例'; }
  7666. } else {
  7667. if (premiumRatio <= 0.20) { ratioColor = '#2DB37C'; ratioStatus = '✓ 处于行业建议区间'; }
  7668. else if (premiumRatio <= 0.30) { ratioColor = '#E89B3D'; ratioStatus = '⚠ 略高于行业建议(10-20%)'; }
  7669. else { ratioColor = '#A61C2B'; ratioStatus = '🔴 严重超出可负担范围'; }
  7670. }
  7671. document.getElementById('affPremiumRatio').style.color = ratioColor;
  7672. document.getElementById('affPremiumRatioSub').textContent = ratioStatus;
  7673. // [v2.9] 教育金分级 floor
  7674. const EDU_FLOOR_MAP = {
  7675. 'elite_us': 0.70, // 美高+美本+美研:最低保留 70%(签证 + 时间窗口最紧)
  7676. 'full_overseas': 0.70, // 全程英美:最低保留 70%
  7677. 'domestic_plus': 0.50, // 国内 + 海外硕士:50%
  7678. 'domestic': 0.30 // 纯国内:可缩到 30%
  7679. };
  7680. const eduFloorRatio = EDU_FLOOR_MAP[d.eduPath] !== undefined ? EDU_FLOOR_MAP[d.eduPath] : 0.50;
  7681. // 双轨缩减计算(v3.1 · 7 险种:rigid 含意外/医疗/重疾/定寿,savings 含养老/教育/终身寿)
  7682. const rigid = (d.premiums.acc || 0) + d.premiums.med + d.premiums.ci + d.premiums.life;
  7683. const savings = d.premiums.retire + d.premiums.edu + (d.premiums.wl || 0);
  7684. const cappedTotal = denominatorYuan * cap; // 元
  7685. let recRetire = d.premiums.retire, recEdu = d.premiums.edu, recWl = (d.premiums.wl || 0);
  7686. let scalingFactor = 1, isOverflow = false, eduFloorTriggered = false;
  7687. if (cap >= 1) {
  7688. // 不设上限模式
  7689. } else if (rigid >= cappedTotal) {
  7690. // 极端:连刚需都超过上限
  7691. recRetire = 0; recEdu = 0; recWl = 0; scalingFactor = 0; isOverflow = true;
  7692. } else if (rigid + savings > cappedTotal) {
  7693. // 储蓄型按比例缩减(v3.1 · 终身寿险也按比例缩)
  7694. const budgetForSavings = cappedTotal - rigid;
  7695. scalingFactor = savings > 0 ? budgetForSavings / savings : 0;
  7696. recRetire = d.premiums.retire * scalingFactor;
  7697. recEdu = d.premiums.edu * scalingFactor;
  7698. recWl = (d.premiums.wl || 0) * scalingFactor;
  7699. // [v2.9] 教育金 floor 保护:如果缩减后教育金 < floor,抬到 floor,差额从养老金扣
  7700. const eduFloorPremium = d.premiums.edu * eduFloorRatio;
  7701. if (d.childAges && d.childAges.length > 0 && recEdu < eduFloorPremium) {
  7702. const topup = eduFloorPremium - recEdu;
  7703. recEdu = eduFloorPremium;
  7704. recRetire = Math.max(0, recRetire - topup);
  7705. eduFloorTriggered = true;
  7706. }
  7707. }
  7708. const affordableTotal = (d.premiums.acc || 0) + d.premiums.med + d.premiums.ci + d.premiums.life + recRetire + recEdu + recWl;
  7709. // [v4.4.5] 暴露给 renderPremiumTimeline,确保 Canvas 红线与双轨 B 列完全一致
  7710. window._cyAffordableTotalYuan = affordableTotal;
  7711. window._cyIsOverflow = isOverflow;
  7712. window._cyRigidYuan = rigid;
  7713. window._cyTheoreticalCapYuan = cappedTotal;
  7714. // [v4.5.2] 暴露完整可负担方案保费(7 险种)+ scaling 信息,供 renderPremiumTimeline 切换"建议 vs 可负担"
  7715. window._cyAffordablePremiums = {
  7716. acc: d.premiums.acc || 0,
  7717. med: d.premiums.med,
  7718. ci: d.premiums.ci,
  7719. life: d.premiums.life,
  7720. retire: recRetire,
  7721. edu: recEdu,
  7722. wl: recWl || 0
  7723. };
  7724. window._cyScalingFactor = scalingFactor;
  7725. window._cyEduFloorTriggered = eduFloorTriggered;
  7726. document.getElementById('affAffordablePremium').textContent = '¥' + (affordableTotal/10000).toFixed(1) + '万';
  7727. const _denomNoun = (tier === 'hnw' || (tier === 'mid' && cap === 0.01)) ? 'AUM' : '收入';
  7728. const _capDecimals = (tier === 'hnw' || (tier === 'mid' && cap === 0.01)) ? 1 : 0;
  7729. if (cap >= 1) {
  7730. document.getElementById('affAffordablePremiumSub').textContent = '不设上限 · 完整需求方案';
  7731. } else if (scalingFactor < 1) {
  7732. let sub = `已按 ${(cap*100).toFixed(_capDecimals)}% ${_denomNoun}上限缩减储蓄型`;
  7733. if (eduFloorTriggered) sub += ` · 教育金按 ${(eduFloorRatio*100).toFixed(0)}% floor 保留`;
  7734. document.getElementById('affAffordablePremiumSub').textContent = sub;
  7735. } else {
  7736. document.getElementById('affAffordablePremiumSub').textContent = '已在可负担范围,无需缩减';
  7737. }
  7738. // 警示带
  7739. const warnEl = document.getElementById('affWarning');
  7740. const warnText = document.getElementById('affWarnText');
  7741. if (cap < 1 && premiumRatio > cap) {
  7742. warnEl.style.display = 'flex';
  7743. const denomLabel = (tier === 'hnw' || (tier === 'mid' && cap === 0.01))
  7744. ? `AUM ¥${(aumWan>=10000?(aumWan/10000).toFixed(2)+'亿':aumWan.toFixed(0)+'万')}`
  7745. : `收入 ¥${familyIncomeWan}万`;
  7746. const _ratioDecimals = (tier === 'hnw' || (tier === 'mid' && cap === 0.01)) ? 2 : 0;
  7747. if (isOverflow) {
  7748. warnText.innerHTML = `<strong>🔴 严重超标</strong>:即便仅保留刚需(重疾/医疗/寿险)的 ¥${(rigid/10000).toFixed(1)}万年缴,也已超过${_denomNoun==='AUM'?'AUM 行业惯例 1-3%':'家庭年收入 ' + (cap*100).toFixed(0) + '% 上限'}。<strong>建议</strong>:降低重疾倍数(从 3× 调到 2×)、延长寿险缴费期至 30 年、或先与客户谈"未来 3 年储蓄型暂缓"。`;
  7749. } else {
  7750. const eduNote = eduFloorTriggered ? ` · 留学子女教育金按 ${(eduFloorRatio*100).toFixed(0)}% floor 保留(签证 + 时间窗口刚性)` : '';
  7751. 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}。`;
  7752. }
  7753. } else {
  7754. warnEl.style.display = 'none';
  7755. }
  7756. // [v4.7-Q2] 准退休客户智能护栏 · yearsToRetire ≤ 10 时提示
  7757. // 触发条件:age + retireAge 都有 + yearsToRetire ≤ 10 + 养老金保费 > 收入 15% (3-yr 紧迫窗口)
  7758. const _yearsToRetire = Math.max(0, (d.retireAge || 60) - (d.age || 35));
  7759. const _retirePremiumRatio = familyIncomeWan > 0 ? ((d.premiums.retire || 0) / 10000 / familyIncomeWan) : 0;
  7760. let triNearRetireWarnHtml = '';
  7761. if (_yearsToRetire > 0 && _yearsToRetire <= 10 && d.premiums.retire > 0) {
  7762. const annualRetirePremiumWan = (d.premiums.retire / 10000).toFixed(1);
  7763. const retireBudgetTotalWan = (d.premiums.retire * _yearsToRetire / 10000).toFixed(1);
  7764. triNearRetireWarnHtml =
  7765. '<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">' +
  7766. '<strong style="color:#A61C2B">⏰ 准退休缴费窗口仅 ' + _yearsToRetire + ' 年</strong> · 养老金年缴 <strong>¥' + annualRetirePremiumWan + '万</strong>' +
  7767. (_retirePremiumRatio > 0.15 ? '(占工资 <strong style="color:#A61C2B">' + (_retirePremiumRatio*100).toFixed(0) + '%</strong>,偏高)' : '(占工资 ' + (_retirePremiumRatio*100).toFixed(0) + '%)') +
  7768. ' · 累计 ' + _yearsToRetire + ' 年 = ¥' + retireBudgetTotalWan + '万。<br>' +
  7769. '<strong>💡 三种现金流方案</strong>:<br>' +
  7770. '① <strong>趸交</strong>:用流动资产 ¥' + retireBudgetTotalWan + '万一次性投保(降低现金流压力)<br>' +
  7771. '② <strong>配偶投保</strong>:转移核保到配偶,延长缴费窗口至配偶退休年(节省年缴 30-50%)<br>' +
  7772. '③ <strong>缩小养老金保额</strong>:把 retireNeed 从理论值降到家庭可承受档位(下调 30-50% 后年缴 ¥' + (annualRetirePremiumWan*0.5).toFixed(1) + '-' + (annualRetirePremiumWan*0.7).toFixed(1) + '万)' +
  7773. '</div>';
  7774. }
  7775. // [v4.7-Q3] 中端档现金流来源提示 · 帮代理人讲清"用存款 / 投资收益交保费"
  7776. if (tier === 'mid') {
  7777. const liquidWan = d.liquidAssets || 0;
  7778. const monthlyExpWan = familyIncomeWan * 0.45 / 12; // 简化:salary × 45% lifestyle / 12
  7779. const emergencyReserveWan = Math.max(monthlyExpWan * 6, 30); // 6 个月生活费,最少 30 万
  7780. const usableLiquidWan = Math.max(0, liquidWan - emergencyReserveWan);
  7781. const recommendedAnnualWan = usableLiquidWan / 20; // 20 年分摊
  7782. triNearRetireWarnHtml +=
  7783. '<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">' +
  7784. '<strong style="color:#2B6CB0">💰 中端档 · 现金流来源建议</strong> · 您的工资 ¥' + familyIncomeWan + '万 + 流动资产 ¥' + liquidWan + '万 给了"双现金流"灵活性:<br>' +
  7785. '① 建议保留应急金 <strong>¥' + emergencyReserveWan.toFixed(0) + '万</strong>(6 个月生活费)<br>' +
  7786. '② 剩余 ¥' + usableLiquidWan.toFixed(0) + '万可作"长期保费来源",分 20 年摊 ≈ <strong>¥' + recommendedAnnualWan.toFixed(1) + '万/年</strong><br>' +
  7787. '③ 实际缴费可"工资 + 存款"混合:工资覆盖刚需(意外/医疗/重疾/定寿),存款 / 投资收益覆盖储蓄型(养老/教育/终身寿)' +
  7788. '</div>';
  7789. }
  7790. // 注入到双轨 note 下方(暴露给 renderTriTable)
  7791. window._cyTriExtraWarnHtml = triNearRetireWarnHtml;
  7792. // 行业基准条:HNW / 中端档(AUM 口径) vs 普通家庭(收入口径)使用不同刻度
  7793. // [v4.7] 中端档 cap 0.01 时复用 HNW AUM 刻度
  7794. const _useAumScale = (tier === 'hnw') || (tier === 'mid' && cap === 0.01);
  7795. const covScale = _useAumScale ? 10 : 40;
  7796. const covMarkerPct = Math.min(100, (coverageMultiple / covScale) * 100);
  7797. document.getElementById('affCoverageMarker').style.left = covMarkerPct + '%';
  7798. document.getElementById('affCoverageMultiple').textContent = coverageMultiple.toFixed(1) + '×';
  7799. // 保费占比基准条:AUM 口径 0-4.5%, 收入口径 0-45%
  7800. const premScale = _useAumScale ? 0.045 : 0.45;
  7801. const premMarkerPct = Math.min(100, (premiumRatio / premScale) * 100);
  7802. document.getElementById('affPremiumMarker').style.left = premMarkerPct + '%';
  7803. document.getElementById('affPremiumPct').textContent = (premiumRatio*100).toFixed(_useAumScale?2:0) + '%';
  7804. // [v2.9] 动态切换基准条 label + scale 文案 · [v4.7] 加中端档支持
  7805. const covLabelEl = document.getElementById('affCoverageBenchLabel');
  7806. const premLabelEl = document.getElementById('affPremiumBenchLabel');
  7807. const covScaleEl = document.getElementById('affCoverageScale');
  7808. const premScaleEl = document.getElementById('affPremiumScale');
  7809. if (_useAumScale) {
  7810. const _denomNounLabel = tier === 'mid' ? '总财富(中端档)' : '家庭 AUM';
  7811. if (covLabelEl) covLabelEl.textContent = '总保额 / ' + _denomNounLabel;
  7812. if (premLabelEl) premLabelEl.textContent = '年缴 / ' + _denomNounLabel;
  7813. if (covScaleEl) covScaleEl.innerHTML = '<span>0×</span><span>2×</span><span>5×</span><span>8×</span><span>10×+</span>';
  7814. if (premScaleEl) premScaleEl.innerHTML = '<span>0%</span><span>1.5%</span><span>3%</span><span>4.5%+</span>';
  7815. } else {
  7816. if (covLabelEl) covLabelEl.textContent = '总保额 / 家庭年收入';
  7817. if (premLabelEl) premLabelEl.textContent = '年缴 / 家庭年收入';
  7818. if (covScaleEl) covScaleEl.innerHTML = '<span>0×</span><span>10×</span><span>20×</span><span>30×</span><span>40×+</span>';
  7819. if (premScaleEl) premScaleEl.innerHTML = '<span>0%</span><span>15%</span><span>30%</span><span>45%+</span>';
  7820. }
  7821. // [v4.6] 三轨配置表 · 完整需求(A) vs 可负担方案(B) vs 自定义方案(C · 可编辑)
  7822. const dualTrackEl = document.getElementById('affDualTrack');
  7823. if (cap < 1 && (premiumRatio > cap || scalingFactor < 1)) {
  7824. dualTrackEl.style.display = 'block';
  7825. const triBody = document.getElementById('affTriTableBody');
  7826. const eduTierLabel = {
  7827. 'elite_us': '🇺🇸 美高+美本+美研', 'full_overseas': '🇬🇧🇺🇸 全程英美',
  7828. 'domestic_plus': '🇨🇳+🌐 国内+海外硕士', 'domestic': '🇨🇳 纯国内'
  7829. }[d.eduPath] || '';
  7830. const rows = [
  7831. // 🟧 基础风险层(刚需)
  7832. { key: 'acc', name: '⚡ 意外险(基础·刚需)', full: (d.premiums.acc || 0), aff: (d.premiums.acc || 0) },
  7833. { key: 'med', name: '🏥 高端医疗(基础·刚需)', full: d.premiums.med, aff: d.premiums.med },
  7834. { key: 'ci', name: '⚕ 重疾险(基础·刚需)', full: d.premiums.ci, aff: d.premiums.ci },
  7835. // 🟨 中端风险层(部分刚需 + 部分储蓄)
  7836. { key: 'life', name: '🛡 定期寿险(中端·收入替代)', full: d.premiums.life, aff: d.premiums.life },
  7837. { key: 'edu', name: `🎓 教育金(中端·储蓄${eduFloorTriggered?' · floor '+(eduFloorRatio*100).toFixed(0)+'%':''})${eduTierLabel?' · '+eduTierLabel:''}`, full: d.premiums.edu, aff: recEdu },
  7838. { key: 'retire', name: '💰 养老年金(中端·储蓄)', full: d.premiums.retire, aff: recRetire },
  7839. // 🟡 高端风险层(传承)
  7840. { key: 'wl', name: '💎 终身寿险(高端·传承)', full: (d.premiums.wl || 0), aff: recWl }
  7841. ];
  7842. // [v4.6] 自定义方案默认 = 可负担方案;但如代理人之前已编辑过(_cyCustomDirty=true),保留原编辑值
  7843. // 这样 switchCfScenario('custom') 触发 silent calculate() 时,代理人 C 列输入不被重置
  7844. // 如用户改了 form 字段(salary 等)+ 没编辑过 C 列 → 重置到新 aff 默认值
  7845. const customDefaults = {};
  7846. rows.forEach(r => { customDefaults[r.key] = r.aff; });
  7847. const _existingCustom = window._cyCustomPremiums;
  7848. const _preserveCustom = _existingCustom
  7849. && Object.keys(_existingCustom).length === rows.length
  7850. && window._cyCustomDirty === true;
  7851. window._cyCustomPremiums = _preserveCustom
  7852. ? Object.assign({}, _existingCustom)
  7853. : Object.assign({}, customDefaults);
  7854. triBody.innerHTML = rows.map((r, idx) => {
  7855. const cutAff = r.full > 0 && r.aff < r.full * 0.99;
  7856. const affClass = cutAff ? ' tri-cell-cut' : '';
  7857. const _customYuan = window._cyCustomPremiums[r.key] !== undefined ? window._cyCustomPremiums[r.key] : r.aff;
  7858. const customWan = (_customYuan / 10000).toFixed(2);
  7859. const cutCustom = r.full > 0 && _customYuan < r.full * 0.99;
  7860. const customCellClass = cutCustom ? ' tri-cell-cut' : '';
  7861. // 自定义方案 = 可编辑 input · 默认值 = 可负担方案 / 之前编辑值
  7862. return '<tr data-row-idx="' + idx + '" data-key="' + r.key + '" data-full="' + r.full + '">' +
  7863. '<td>' + r.name + '</td>' +
  7864. '<td class="tri-num">¥' + (r.full/10000).toFixed(2) + '万</td>' +
  7865. '<td class="tri-num tri-num-aff' + affClass + '">¥' + (r.aff/10000).toFixed(2) + '万</td>' +
  7866. '<td class="tri-num-custom' + customCellClass + '">' +
  7867. '<input type="number" class="tri-custom-input" data-key="' + r.key + '" ' +
  7868. 'min="0" step="0.5" value="' + customWan + '" oninput="onTriCustomInput(this)">' +
  7869. '<span class="tri-custom-suffix">万</span>' +
  7870. '</td>' +
  7871. '</tr>';
  7872. }).join('');
  7873. // 合计行
  7874. document.getElementById('triFullTotal').textContent = '¥' + (fullPremium/10000).toFixed(1) + '万';
  7875. document.getElementById('triAffTotal').textContent = '¥' + (affordableTotal/10000).toFixed(1) + '万';
  7876. // 自定义方案合计 · 默认 = 可负担方案 / 保留之前编辑值
  7877. let _customTotalInit = 0;
  7878. Object.keys(window._cyCustomPremiums).forEach(k => {
  7879. _customTotalInit += (window._cyCustomPremiums[k] || 0);
  7880. });
  7881. window._cyCustomTotalYuan = _customTotalInit;
  7882. document.getElementById('triCustomTotal').textContent = '¥' + (_customTotalInit/10000).toFixed(1) + '万';
  7883. // [v4.7 Q1 + Jack 2026-06-21] 三档差异 mini badge · 让客户秒看出"自定义 vs 完整需求"差额
  7884. updateTriDiffBadges(fullPremium, affordableTotal, _customTotalInit);
  7885. // 计算并显示初始 warn
  7886. updateTriCustomWarn(_customTotalInit, denominatorYuan, isHNW, cap, fullPremium);
  7887. // 暴露刷新工具,供 onTriCustomInput 复用
  7888. window._cyTriCtx = {
  7889. rows, fullPremium, affordableTotal, denominatorYuan, isHNW, cap
  7890. };
  7891. } else {
  7892. dualTrackEl.style.display = 'none';
  7893. // 不显示双轨时,自定义方案 = 完整需求(供 Canvas 兜底,但实际不画线)
  7894. window._cyCustomTotalYuan = fullPremium;
  7895. window._cyCustomPremiums = null;
  7896. }
  7897. // [v4.7] 注入准退休护栏 + 中端档现金流提示 到 triExtraWarn(无论双轨是否展示都注入,准退休客户即便不超 cap 也要看到)
  7898. const triExtraEl = document.getElementById('triExtraWarn');
  7899. if (triExtraEl) {
  7900. triExtraEl.innerHTML = window._cyTriExtraWarnHtml || '';
  7901. }
  7902. }
  7903. // === [v4.6] 三轨自定义方案 · 输入监听器 ===
  7904. function onTriCustomInput(inputEl) {
  7905. const ctx = window._cyTriCtx;
  7906. if (!ctx) return;
  7907. const key = inputEl.getAttribute('data-key');
  7908. const wanVal = parseFloat(inputEl.value) || 0;
  7909. const yuanVal = wanVal * 10000;
  7910. // 更新存储
  7911. if (window._cyCustomPremiums) {
  7912. window._cyCustomPremiums[key] = yuanVal;
  7913. }
  7914. // 标记已被编辑 · 让 renderAffordabilityCheck 在后续 calculate() 中保留 _cyCustomPremiums
  7915. window._cyCustomDirty = true;
  7916. // 复用 cut 逻辑(自定义 < 完整需求 99% 时标 cut)
  7917. const tr = inputEl.closest('tr');
  7918. const fullVal = parseFloat(tr.getAttribute('data-full')) || 0;
  7919. const customCell = tr.querySelector('td.tri-num-custom');
  7920. if (customCell) {
  7921. if (fullVal > 0 && yuanVal < fullVal * 0.99) {
  7922. customCell.classList.add('tri-cell-cut');
  7923. } else {
  7924. customCell.classList.remove('tri-cell-cut');
  7925. }
  7926. }
  7927. // 重算自定义方案合计
  7928. let customTotal = 0;
  7929. Object.keys(window._cyCustomPremiums).forEach(k => {
  7930. customTotal += (window._cyCustomPremiums[k] || 0);
  7931. });
  7932. window._cyCustomTotalYuan = customTotal;
  7933. document.getElementById('triCustomTotal').textContent = '¥' + (customTotal/10000).toFixed(1) + '万';
  7934. // [v4.7 Q1] 三档差异 mini badge 实时同步
  7935. updateTriDiffBadges(ctx.fullPremium, ctx.affordableTotal, customTotal);
  7936. // 更新 warn
  7937. updateTriCustomWarn(customTotal, ctx.denominatorYuan, ctx.isHNW, ctx.cap, ctx.fullPremium);
  7938. // [v4.6] 自动切到「自定义方案」展示模式 · 让 Canvas 直接反映微调后的现金流
  7939. // 如已经在 custom 模式,只需轻量重画 Canvas;否则触发 silent 切换并重算
  7940. if (window._cyShowScenario !== 'custom') {
  7941. if (typeof switchCfScenario === 'function') {
  7942. switchCfScenario('custom'); // 自动切换 + 重算 + 更新副文案
  7943. return;
  7944. }
  7945. }
  7946. // 已在 custom 模式 → 无 calculate(),直接调用 renderPremiumTimeline 用最新 _cyCustomPremiums 重画
  7947. if (typeof renderPremiumTimeline === 'function' && window._cyLastTimelineData) {
  7948. renderPremiumTimeline(window._cyLastTimelineData);
  7949. }
  7950. }
  7951. // === [v4.7 Q1 + Jack 2026-06-21] 三档差异 mini badge 渲染 ===
  7952. // 让客户秒看出"自定义方案 vs 完整需求 / 可负担方案"差额(绝对值 + 百分比)
  7953. function updateTriDiffBadges(fullYuan, affYuan, customYuan) {
  7954. function _pill(diffYuan, baseYuan) {
  7955. if (baseYuan <= 0) return '<span class="tri-diff-pill tri-diff-pill-eq">—</span>';
  7956. const ratio = diffYuan / baseYuan;
  7957. const absWan = Math.abs(diffYuan) / 10000;
  7958. const pct = (Math.abs(ratio) * 100);
  7959. if (Math.abs(ratio) < 0.005) {
  7960. return '<span class="tri-diff-pill tri-diff-pill-eq">≈ 完整需求</span>';
  7961. } else if (diffYuan < 0) {
  7962. // 比基准少 → 绿色"省"
  7963. return '<span class="tri-diff-pill tri-diff-pill-down">−' + pct.toFixed(0) + '%</span>' +
  7964. '<span class="tri-diff-amt">省 ¥' + absWan.toFixed(1) + '万</span>';
  7965. } else {
  7966. // 比基准多 → 红色"超"
  7967. return '<span class="tri-diff-pill tri-diff-pill-up">+' + pct.toFixed(0) + '%</span>' +
  7968. '<span class="tri-diff-amt">超 ¥' + absWan.toFixed(1) + '万</span>';
  7969. }
  7970. }
  7971. const affEl = document.getElementById('triAffDiff');
  7972. const customEl = document.getElementById('triCustomDiff');
  7973. if (affEl) affEl.innerHTML = _pill(affYuan - fullYuan, fullYuan);
  7974. if (customEl) customEl.innerHTML = _pill(customYuan - fullYuan, fullYuan);
  7975. }
  7976. // === [v4.6] 三轨自定义方案 · 超标 warn 渲染 ===
  7977. function updateTriCustomWarn(customYuan, denomYuan, isHNW, cap, fullPremium) {
  7978. const warnEl = document.getElementById('triCustomWarn');
  7979. if (!warnEl) return;
  7980. if (denomYuan <= 0 || cap >= 1) {
  7981. warnEl.className = 'aff-tri-warn';
  7982. warnEl.style.display = 'none';
  7983. return;
  7984. }
  7985. const customRatio = customYuan / denomYuan;
  7986. const denomLabelShort = isHNW ? 'AUM' : '家庭年收入';
  7987. const overPct = ((customRatio / cap - 1) * 100);
  7988. const ratioPct = (customRatio * 100).toFixed(isHNW ? 2 : 1);
  7989. const capPct = (cap * 100).toFixed(isHNW ? 1 : 0);
  7990. if (customRatio > cap) {
  7991. warnEl.className = 'aff-tri-warn is-warn';
  7992. warnEl.innerHTML = '⚠ <strong>自定义方案已超 ' + overPct.toFixed(0) + '%</strong>:年缴 ¥' +
  7993. (customYuan/10000).toFixed(1) + '万 / ' + denomLabelShort + ' = ' + ratioPct + '%,超过 ' +
  7994. capPct + '% 上限。建议下调储蓄型(养老/教育/终身寿)或延长缴费期。';
  7995. } else if (customYuan < fullPremium * 0.999 && customYuan > 0) {
  7996. warnEl.className = 'aff-tri-warn is-ok';
  7997. warnEl.innerHTML = '✓ <strong>自定义方案在可负担区间</strong>:年缴 ¥' +
  7998. (customYuan/10000).toFixed(1) + '万 / ' + denomLabelShort + ' = ' + ratioPct + '%(上限 ' +
  7999. capPct + '%)· Canvas 蓝色虚线已同步。';
  8000. } else {
  8001. warnEl.className = 'aff-tri-warn';
  8002. warnEl.style.display = 'none';
  8003. }
  8004. }
  8005. function renderProductRecommendations(d) {
  8006. if (!window.CY_PRODUCTS) {
  8007. document.getElementById('onshoreProducts').innerHTML =
  8008. '<div style="grid-column:1/-1;text-align:center;color:var(--text-dim);padding:30px">⚠ 未载入 products-bundle.js</div>';
  8009. return;
  8010. }
  8011. const onshore = matchProducts('insurance_onshore', d);
  8012. const offshore = matchProducts('insurance_offshore', d);
  8013. document.getElementById('onshoreProducts').innerHTML =
  8014. onshore.length ? onshore.map(renderProductCard).join('')
  8015. : '<div style="grid-column:1/-1;text-align:center;color:var(--text-dim);padding:20px">未找到匹配境内产品</div>';
  8016. document.getElementById('offshoreProducts').innerHTML =
  8017. offshore.length ? offshore.map(renderProductCard).join('')
  8018. : '<div style="grid-column:1/-1;text-align:center;color:var(--text-dim);padding:20px">未找到匹配境外产品</div>';
  8019. // HNW 客户默认切到境外 Tab
  8020. if (d.isHNW) {
  8021. document.querySelectorAll('.product-tab').forEach(t => t.classList.remove('active'));
  8022. document.querySelectorAll('.product-pane').forEach(p => p.classList.remove('active'));
  8023. document.querySelectorAll('.product-tab')[1].classList.add('active');
  8024. document.getElementById('productPaneOffshore').classList.add('active');
  8025. }
  8026. }
  8027. function switchProductTab(track, el) {
  8028. document.querySelectorAll('.product-tab').forEach(t => t.classList.remove('active'));
  8029. document.querySelectorAll('.product-pane').forEach(p => p.classList.remove('active'));
  8030. if (el) el.classList.add('active');
  8031. document.getElementById(track === 'onshore' ? 'productPaneOnshore' : 'productPaneOffshore').classList.add('active');
  8032. }
  8033. /* === 产品详情 Modal(v2026-06-13)· 点击产品卡弹出 === */
  8034. function showProductModal(productId) {
  8035. if (!window.CY_PRODUCTS) return;
  8036. // 在所有 category 中查找
  8037. let p = null;
  8038. ['insurance_onshore','insurance_offshore','identity','crs_tax','asset','trust','education'].forEach(cat => {
  8039. if (p) return;
  8040. const arr = window.CY_PRODUCTS[cat] || [];
  8041. const found = arr.find(x => x.id === productId);
  8042. if (found) p = found;
  8043. });
  8044. if (!p) return;
  8045. // 价格范围格式化
  8046. let priceRange = '—';
  8047. if (p.premium_range_cny) {
  8048. const min = p.premium_range_cny.min;
  8049. const max = p.premium_range_cny.max;
  8050. priceRange = '¥' + (min >= 10000 ? Math.round(min/10000) + '万' : min) +
  8051. ' - ¥' + (max >= 10000 ? Math.round(max/10000) + '万' : max);
  8052. } else if (p.premium_range_usd) {
  8053. const min = p.premium_range_usd.min;
  8054. const max = p.premium_range_usd.max;
  8055. priceRange = '$' + (min >= 1000000 ? (min/1000000).toFixed(1) + 'M' : min/1000 + 'K') +
  8056. ' - $' + (max >= 1000000 ? (max/1000000).toFixed(1) + 'M' : max/1000 + 'K');
  8057. }
  8058. const isHot = p.hot_selling;
  8059. const features = p.key_features || [];
  8060. const audiences = p.target_audience || [];
  8061. const useCases = p.use_cases || [];
  8062. const indices = p.indices || [];
  8063. const fs = p.financial_strength || {};
  8064. // Header
  8065. let html = '<div class="pm-header">';
  8066. html += `<div class="pm-eyebrow">${(p.subcategory || p.category || '').replace(/_/g,' ').toUpperCase()}${isHot ? ' · HOT 主推' : ''}</div>`;
  8067. html += `<div class="pm-title">${p.name_cn || ''}${isHot ? '<span class="hot-badge">HOT</span>' : ''}</div>`;
  8068. if (p.name_en) html += `<div class="pm-title-en">${p.name_en}</div>`;
  8069. html += '<div class="pm-meta-row">';
  8070. if (p.issuer) html += `<span class="pm-meta-item">🏢 ${p.issuer}</span>`;
  8071. if (p.region) html += `<span class="pm-meta-item">🌏 ${p.region}</span>`;
  8072. if (p.type_label) html += `<span class="pm-meta-item">📦 ${p.type_label}</span>`;
  8073. if (p.coverage_period) html += `<span class="pm-meta-item">📅 ${p.coverage_period}</span>`;
  8074. html += '</div>';
  8075. if (p.tagline) html += `<div class="pm-tagline">"${p.tagline}"</div>`;
  8076. html += '</div>';
  8077. // Body
  8078. html += '<div class="pm-body">';
  8079. // 产品参数
  8080. html += '<div class="pm-section"><div class="pm-section-title">📦 产品参数</div>';
  8081. html += '<div class="pm-grid-2">';
  8082. html += `<div class="pm-label">保费范围</div><div class="pm-value">${priceRange}</div>`;
  8083. if (p.payment_terms) html += `<div class="pm-label">缴费期</div><div class="pm-value">${p.payment_terms.join(' / ')}</div>`;
  8084. if (p.coverage_period) html += `<div class="pm-label">保障期间</div><div class="pm-value">${p.coverage_period}</div>`;
  8085. if (p.currency) html += `<div class="pm-label">币种</div><div class="pm-value">${p.currency}</div>`;
  8086. 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>`;
  8087. 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>`;
  8088. 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>`;
  8089. if (p.min_premium_usd) html += `<div class="pm-label">最低起投</div><div class="pm-value">$${(p.min_premium_usd/1000000).toFixed(1)}M</div>`;
  8090. html += '</div></div>';
  8091. // 财务实力(IUL 独有)
  8092. if (Object.keys(fs).length) {
  8093. html += '<div class="pm-section"><div class="pm-section-title">🏛 财务实力</div>';
  8094. html += '<div class="pm-grid-2">';
  8095. if (fs.sp) html += `<div class="pm-label">S&P 评级</div><div class="pm-value">${fs.sp}</div>`;
  8096. if (fs.moody) html += `<div class="pm-label">Moody's 评级</div><div class="pm-value">${fs.moody}</div>`;
  8097. if (fs.ambest) html += `<div class="pm-label">A.M. Best 评级</div><div class="pm-value">${fs.ambest}</div>`;
  8098. if (fs.aum_cad) html += `<div class="pm-label">管理资产(CAD)</div><div class="pm-value">${fs.aum_cad}</div>`;
  8099. if (fs.staff) html += `<div class="pm-label">员工数</div><div class="pm-value">${fs.staff}</div>`;
  8100. if (fs.advisors) html += `<div class="pm-label">顾问数</div><div class="pm-value">${fs.advisors}</div>`;
  8101. if (fs.clients_global) html += `<div class="pm-label">全球客户</div><div class="pm-value">${fs.clients_global}</div>`;
  8102. html += '</div></div>';
  8103. }
  8104. // 上市交易所(IUL 独有)
  8105. if (p.listing && p.listing.length) {
  8106. html += '<div class="pm-section"><div class="pm-section-title">📈 上市交易所</div>';
  8107. html += '<div class="pm-tags">' + p.listing.map(x => `<span class="pm-tag">${x}</span>`).join('') + '</div>';
  8108. html += '</div>';
  8109. }
  8110. // 适合人群
  8111. if (audiences.length) {
  8112. html += '<div class="pm-section"><div class="pm-section-title">🎯 适合人群</div>';
  8113. html += '<div class="pm-tags">' + audiences.map(x => `<span class="pm-tag">${x}</span>`).join('') + '</div>';
  8114. html += '</div>';
  8115. }
  8116. // 核心特性
  8117. if (features.length) {
  8118. html += '<div class="pm-section"><div class="pm-section-title">⭐ 核心特性</div>';
  8119. html += '<ul class="pm-list">' + features.map(x => `<li>${x}</li>`).join('') + '</ul>';
  8120. html += '</div>';
  8121. }
  8122. // 适用场景
  8123. if (useCases.length) {
  8124. html += '<div class="pm-section"><div class="pm-section-title">💼 适用场景</div>';
  8125. html += '<div class="pm-tags">' + useCases.map(x => `<span class="pm-tag">${x}</span>`).join('') + '</div>';
  8126. html += '</div>';
  8127. }
  8128. // 指数账户(IUL 独有)
  8129. if (indices.length) {
  8130. html += '<div class="pm-section"><div class="pm-section-title">📊 挂钩指数账户</div>';
  8131. html += '<table class="pm-indices-table"><thead><tr><th>账户名</th><th>权重 / 标的</th></tr></thead><tbody>';
  8132. indices.forEach(idx => {
  8133. html += `<tr><td>${idx.name || ''}</td><td>${idx.weight || ''}</td></tr>`;
  8134. });
  8135. html += '</tbody></table></div>';
  8136. }
  8137. // 备注
  8138. if (p.notes) {
  8139. html += '<div class="pm-section"><div class="pm-section-title">💡 备注</div>';
  8140. html += `<div class="pm-notes">${p.notes}</div>`;
  8141. html += '</div>';
  8142. }
  8143. html += '</div>';
  8144. // Footer
  8145. html += '<div class="pm-footer">';
  8146. html += '<button class="pm-btn" onclick="closeProductModal()">关闭</button>';
  8147. 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>`;
  8148. html += '</div>';
  8149. document.getElementById('pmContent').innerHTML = html;
  8150. document.getElementById('productModal').classList.add('active');
  8151. document.body.style.overflow = 'hidden';
  8152. }
  8153. function closeProductModal() {
  8154. document.getElementById('productModal').classList.remove('active');
  8155. document.body.style.overflow = '';
  8156. }
  8157. // ESC 关闭 modal
  8158. document.addEventListener('keydown', e => {
  8159. if (e.key === 'Escape') closeProductModal();
  8160. });
  8161. /* === Phase 4 · 9 画像专属建议库(每画像 2-3 条独有建议)
  8162. v2026-06-13 · 去品牌化 · 只说保险类型不提具体产品名,避免代理人公司冲突 */
  8163. const PERSONA_SPECIFIC_TIPS = {
  8164. middle_3: [
  8165. { name: '👨‍👩‍👧 三口之家·黄金组合', desc: '重疾 ¥150 万(年缴 ¥1.5 万)+ 寿险 ¥800 万(覆盖房贷)+ 高端医疗险 + 教育金险(子女 5 岁起 18 年缴)' },
  8166. { name: '🎓 教育金最佳起点', desc: '子女 5 岁是教育金险黄金窗口 · 12 年复利让 ¥30 万 = ¥80 万大学金 · 推荐配置:**分红型年金险 / 增额终身寿**' }
  8167. ],
  8168. two_child: [
  8169. { name: '👨‍👩‍👧‍👦 二孩家庭·重头戏', desc: '寿险 ¥3000 万(房贷 ¥500 + 教育金 ¥1200 + 收入替代 ¥1300)+ 配偶补充 ¥1500 万分散投保' },
  8170. { name: '🇺🇸 跨境教育金锁定', desc: '英美留学路径 · 香港分红型储蓄险 35 岁前完成储备 · 美元抗通胀对冲 · 推荐配置:**美元分红型储蓄险**' }
  8171. ],
  8172. single_lady: [
  8173. { name: '👩‍💼 单身专属·重养老不重寿', desc: '重疾 ¥150 万(32 岁是黄金窗口)+ 高端医疗 ¥800 万 + 美元年金险(55 岁早退)· 寿险只需小额覆盖父母赡养' },
  8174. { name: '🏥 健康危机第一线', desc: '32 岁投保 50 岁需续保 · 50 岁后保费 5 倍 · 现在锁定 30 年缴期 · 推荐配置:**重疾险(终身保障型)+ 高端医疗险(全球医疗)**' }
  8175. ],
  8176. dink: [
  8177. { name: '💑 DINK 双轨配置', desc: '双方各自重疾 ¥100 万 + 互为受益人寿险 ¥1500 万 + 共同美元年金账户 · 一人意外另一人独居必须有保障' },
  8178. { name: '⚖ 互为依赖结构', desc: '丁克家庭一人意外另一人独居 30+ 年 · 寿险一次性给付 ≥ 10 年生活费 ¥1500 万 + 高端医疗双账户' }
  8179. ],
  8180. single_mom: [
  8181. { name: '👩‍👦 单亲专属·受益人单一指定', desc: '寿险 ¥1500 万受益人单一指定 8 岁儿子(必须公证)· 避免前夫/前夫家庭干扰 · 推荐配置:**增额终身寿(可嵌套保险金信托)**' },
  8182. { name: '⚡ 紧迫时间窗口', desc: '38 岁单亲单收入 · 健康一旦出问题孩子无依靠 · 优先级:寿险 ¥1500 > 重疾 ¥100 > 高端医疗 · 6 个月内必须配齐' }
  8183. ],
  8184. entrepreneur: [
  8185. { name: '🏢 经营贷担保解除', desc: '寿险 ≥ 经营贷 ¥1000 万 + 房贷 ¥800 万 = ¥1800 万 · 一旦意外触发自动解除担保 · 避免家族资产被追索清盘' },
  8186. { name: '📐 股权传承双轨架构', desc: '境内增额终身寿 ¥3000 万(主理人投保)+ 境外 PPLI 装入公司股权 30%(¥1500 万估值)· 双轨准备避免股权过户失控' },
  8187. { name: '⚠ 经营贷个人担保警示', desc: '中国《公司法》§3:有限责任公司股东以出资额为限 · 但银行经营贷常要求个人无限连带担保 · 寿险是唯一"对冲死亡触发还款"工具' }
  8188. ],
  8189. silver: [
  8190. { name: '👴 准退休最后投保窗口', desc: '55 岁是终身寿险最后黄金期 · 60 岁保费翻倍 · 70 岁多家公司停售 · 推荐配置:**增额终身寿(50-60 岁专属档)**' },
  8191. { name: '💰 退休现金流双层', desc: '美元年金险(¥200 万 5 年缴)+ 国内分红型年金 · 60 岁开始领取 · 通胀对冲 · 配偶投保转移核保' }
  8192. ],
  8193. cross_border: [
  8194. { name: '🌐 美籍二代核心隔离架构', desc: 'PPLI 装入境内股权 50%(¥3 亿+)+ Pre-Immigration Trust + 5-10 年弃籍税路径 · 持牌跨境通道办理' },
  8195. { name: '⚖ FATCA 申报合规', desc: 'CRS / FATCA 双重申报 · 美籍子女金融账户跨境透明 · 必须 PPLI 包装才能合规节税 · 否则 40% 美国遗产税' },
  8196. { name: '🛂 跨境身份预筹', desc: '主理人香港优才 / 新加坡 GIP · 美籍子女独立路径 · 配偶身份选择影响整个家族架构 · 推荐配套法务咨询' }
  8197. ],
  8198. uhnw_succession: [
  8199. { name: '🏛 完整传承四件套', desc: '境内大额寿险 ¥5 亿(配偶分散投保)+ 境外 PPLI ¥30 亿(装入股权 30%)+ 离岸主信托 + 在岸辅助信托 · 双层架构' },
  8200. { name: '⚖ 多子女分配防纠纷', desc: '长子 25 岁接班 vs 幼子 18 岁留学 → 寿险指定受益比例 长子 60% / 幼子 40% · 配套家族宪章 · 避免争产' },
  8201. { name: '🤲 慈善基金三合一', desc: '设立家族慈善信托 ¥10 亿规模 · 节税(企业所得税抵扣)+ 传承隔离(慈善豁免遗产税)+ 品牌三合一' }
  8202. ]
  8203. };
  8204. // [v4.8 · 2026-06-26] 客户家庭报告 · 一页总结(报告尾部"客户带走"卡)
  8205. // 聚合 总缺口 + 评分 + 最大缺口险种 + 年缴/年薪 + 3 步行动 → 客户视角故事化呈现
  8206. function renderClientSummary(d) {
  8207. const card = document.getElementById('clientSummaryCard');
  8208. if (!card) return;
  8209. // 1. 总缺口
  8210. const totalGap = (d.gaps.acc + d.gaps.med + d.gaps.ci + d.gaps.life +
  8211. d.gaps.edu + d.gaps.retire + d.gaps.wl) || 0;
  8212. // 2. 评分(复用主算法 · 60 分基线 + 加分项)
  8213. const baseExist = d.exists.acc + d.exists.med + d.exists.ci;
  8214. const baseNeed = d.needs.acc + d.needs.med + d.needs.ci;
  8215. const midExist = d.exists.life + d.exists.edu + d.exists.retire;
  8216. const midNeed = d.needs.life + d.needs.edu + d.needs.retire;
  8217. const highExist = d.exists.wl;
  8218. const highNeed = d.needs.wl;
  8219. const baseCov = baseNeed > 0 ? Math.min(1, baseExist / baseNeed) : 0;
  8220. const midCov = midNeed > 0 ? Math.min(1, midExist / midNeed) : 0;
  8221. const highCov = highNeed > 0 ? Math.min(1, highExist / highNeed) : 0;
  8222. const hasAnyExisting = (baseCov + midCov + highCov) > 0;
  8223. const baseline = hasAnyExisting ? 6.0 : 2.0;
  8224. const policyCount = ['acc','med','ci','life','edu','retire','wl']
  8225. .filter(k => (d.exists[k] || 0) > 0).length;
  8226. const balancedBonus = Math.max(0, Math.min(0.4, (policyCount - 3) * 0.1));
  8227. const score = Math.min(10,
  8228. Math.round((baseline + baseCov*1.5 + midCov*1.0 + highCov*0.8 + balancedBonus) * 10) / 10);
  8229. // 3. 最大缺口险种
  8230. const gapEntries = [
  8231. { key:'acc', name:'意外险', gap: d.gaps.acc || 0 },
  8232. { key:'med', name:'高端医疗', gap: d.gaps.med || 0 },
  8233. { key:'ci', name:'重疾险', gap: d.gaps.ci || 0 },
  8234. { key:'life', name:'定期寿险', gap: d.gaps.life || 0 },
  8235. { key:'edu', name:'教育金', gap: d.gaps.edu || 0 },
  8236. { key:'retire', name:'养老金', gap: d.gaps.retire || 0 },
  8237. { key:'wl', name:'终身寿险', gap: d.gaps.wl || 0 }
  8238. ].filter(e => e.gap > 0).sort((a,b) => b.gap - a.gap);
  8239. const maxGapEntry = gapEntries[0] || { name:'已配齐', gap:0 };
  8240. // 4. 年缴 / 年薪 比例
  8241. const totalPremium = d.totalPremium || 0;
  8242. const annualIncomeYuan = (d.salary + (d.spouseSalary || 0)) * 10000;
  8243. const ratio = annualIncomeYuan > 0 ? totalPremium / annualIncomeYuan : 0;
  8244. const ratioPct = (ratio * 100).toFixed(1);
  8245. const ratioLabel = ratio < 0.10 ? '空间充足' : ratio < 0.20 ? '合理区间' : ratio < 0.30 ? '需关注' : '超标';
  8246. const ratioColor = ratio < 0.20 ? '#2D6A4F' : ratio < 0.30 ? '#B58A21' : '#A6121C';
  8247. // 5. 评分 label
  8248. const scoreLabel = score >= 8.5 ? '✅ 优秀'
  8249. : score >= 7.0 ? '✓ 良好'
  8250. : score >= 6.0 ? '⚡ 及格'
  8251. : score >= 4.0 ? '⚠ 待补齐'
  8252. : '🚨 待启动';
  8253. // 6. 三层缺口分组
  8254. const baseGap = (d.gaps.acc + d.gaps.med + d.gaps.ci) || 0;
  8255. const midGap = (d.gaps.life + d.gaps.edu + d.gaps.retire) || 0;
  8256. const highGap = d.gaps.wl || 0;
  8257. // ─────────── 渲染 ───────────
  8258. card.classList.add('show');
  8259. // 一句话诊断
  8260. const headlineEl = document.getElementById('csHeadline');
  8261. if (totalGap > 0) {
  8262. headlineEl.innerHTML =
  8263. '您家庭目前的<strong>总缺口</strong>约 <span class="cs-h-num">' + fmtWan(totalGap) + '</span>,' +
  8264. '最大风险敞口在【<strong>' + maxGapEntry.name + '</strong>】(缺口 <span class="cs-h-num">' + fmtWan(maxGapEntry.gap) + '</span>)。' +
  8265. '当前年缴预算占年薪 <span class="cs-h-num">' + ratioPct + '%</span>,' +
  8266. '<strong style="color:' + ratioColor + '">' + ratioLabel + '</strong>。';
  8267. } else {
  8268. headlineEl.innerHTML = '您的家庭保障已基本配齐 ✓ 后续仅需周期性复盘 + 险种均衡度微调。';
  8269. }
  8270. // 关键指标 4 项
  8271. document.getElementById('csMetricGap').textContent = totalGap > 0 ? fmtWan(totalGap) : '已配齐';
  8272. document.getElementById('csMetricScore').innerHTML = score + ' <span style="font-size:14px;opacity:.7">/ 10</span>';
  8273. document.getElementById('csMetricScoreLabel').textContent = scoreLabel;
  8274. document.getElementById('csMetricMaxGap').textContent = maxGapEntry.name;
  8275. document.getElementById('csMetricMaxGapAmt').textContent = maxGapEntry.gap > 0 ? ('¥' + fmtWan(maxGapEntry.gap)) : '—';
  8276. document.getElementById('csMetricRatio').textContent = ratioPct + ' %';
  8277. const ratioLabelEl = document.getElementById('csMetricRatioLabel');
  8278. ratioLabelEl.textContent = ratioLabel;
  8279. ratioLabelEl.style.color = ratioColor;
  8280. // 3 步行动
  8281. const actionsEl = document.getElementById('csActions');
  8282. const actions = [];
  8283. if (baseGap > 0) {
  8284. actions.push({
  8285. tier:'base', window:'30 天内', name:'基础保障补齐',
  8286. detail:'意外 / 医疗 / 重疾 三项 · 缺口 <strong>¥' + fmtWan(baseGap) + '</strong> · 无体检窗口期,立即可投保'
  8287. });
  8288. }
  8289. if (midGap > 0) {
  8290. actions.push({
  8291. tier:'mid', window:'90 天内', name:'中端配置(收入替代 + 储蓄)',
  8292. detail:'定期寿险 / 教育金 / 养老金 · 缺口 <strong>¥' + fmtWan(midGap) + '</strong> · 需 1 次完整顾问会面定方案'
  8293. });
  8294. }
  8295. if (highGap > 0) {
  8296. actions.push({
  8297. tier:'high', window:'365 天内', name:'高端路径(传承 ± 跨境)',
  8298. detail:'终身寿险 ± 境内/境外双轨 · 缺口 <strong>¥' + fmtWan(highGap) + '</strong> · 涉及架构 · 需 2-3 次会面'
  8299. });
  8300. }
  8301. // 若全部配齐
  8302. if (actions.length === 0) {
  8303. actions.push({
  8304. tier:'base', window:'季度复盘', name:'保障已配齐 · 周期性回看',
  8305. detail:'年度收入 / 资产变动 / 婚育规划变化时,<strong>重跑一遍 IC</strong>;任何险种缺口 > 30% 即触发补充配置'
  8306. });
  8307. }
  8308. actionsEl.innerHTML = actions.map((a, i) => `
  8309. <div class="cs-action cs-action--${a.tier}">
  8310. <div class="cs-action-num">${i+1}</div>
  8311. <div class="cs-action-body">
  8312. <div class="cs-action-head">
  8313. <span>${a.name}</span>
  8314. <span class="cs-action-window">${a.window}</span>
  8315. </div>
  8316. <div class="cs-action-desc">${a.detail}</div>
  8317. </div>
  8318. </div>
  8319. `).join('');
  8320. }
  8321. function renderUhnwSuggestions(d) {
  8322. const list = document.getElementById('uhnwList');
  8323. if (!list) return; // [v4.8 · 2026-06-26] uhnw-card 已移除 · DOM 缺失时安全早返
  8324. const items = [];
  8325. // === 第 1 层 · 画像专属建议(优先,如已选画像) ===
  8326. const personaId = sessionStorage.getItem('cy_persona_id') || '';
  8327. const personaTips = PERSONA_SPECIFIC_TIPS[personaId];
  8328. if (personaTips && personaTips.length) {
  8329. personaTips.forEach(t => items.push(t));
  8330. }
  8331. // === 第 2 层 · 数字驱动通用规则(基于实际财务/家庭数据) ===
  8332. // 经营贷担保(otherDebt 高)
  8333. if (d.otherDebt && d.otherDebt >= 500 && !personaId.includes('entrepreneur')) {
  8334. items.push({
  8335. name: '🏢 经营贷担保解除',
  8336. desc: '其他负债 ¥' + d.otherDebt + '万(疑似经营贷)· 主理人寿险 ≥ 该金额可触发自动解除担保 · 避免家族资产被追索'
  8337. });
  8338. }
  8339. // 多子女分配公平
  8340. if (d.childCount >= 3 && !personaId) {
  8341. items.push({
  8342. name: '⚖ 多子女分配公平',
  8343. desc: d.childCount + ' 子 · 寿险指定受益人比例避免法定继承大乱 · 每子女平均 ¥' + Math.round((d.lifeNeed||1000) / d.childCount) + '万'
  8344. });
  8345. }
  8346. // 美籍二代专项(无画像但有美籍标识)
  8347. if (d.hasUS && !personaId.includes('cross_border') && !personaId.includes('uhnw')) {
  8348. items.push({
  8349. name: '🌐 美籍二代 FATCA 隔离',
  8350. desc: 'PPLI 跨境隔离 · Pre-Immigration Trust · 美国遗产税 40% 重灾区,必须专项处理'
  8351. });
  8352. }
  8353. // HNW 双轨(无画像但 lifeNeed ≥ 5 亿)
  8354. if (d.lifeNeed >= 50000 && !personaId.includes('uhnw') && !personaId.includes('cross')) {
  8355. items.push({
  8356. name: '🏛 境内 + 境外双轨配置',
  8357. desc: '境内 ¥3-5 亿(年龄健康限制)+ 境外 PPLI 装入股权 30%(几乎无上限)· 双轨叠加'
  8358. });
  8359. }
  8360. // 单收入家庭(配偶 0 + 主理人 ≥ 80)
  8361. if (d.spouseSalary === 0 && d.salary >= 80 && d.childCount > 0 && !personaId.includes('single')) {
  8362. items.push({
  8363. name: '👫 单收入家庭风险锁定',
  8364. desc: '主理人 100% 收入支柱 · 寿险按 100% 收入替代率配置 · 重疾全配 · 配偶健康险补充'
  8365. });
  8366. }
  8367. // 双高收入家庭
  8368. if (d.spouseSalary && d.spouseSalary >= d.salary * 0.8 && d.salary >= 80 && !personaId.includes('dink')) {
  8369. items.push({
  8370. name: '⚖ 双高收入家庭',
  8371. desc: '配偶赚得不少 → 双方均配大额寿险(互为受益人)· 双轨重疾 · 美元年金双账户对冲'
  8372. });
  8373. }
  8374. // 准退休(50+)
  8375. if (d.age >= 50 && d.retireGap >= 500 && !personaId.includes('silver')) {
  8376. items.push({
  8377. name: '💰 退休前最后窗口',
  8378. desc: '5-10 年内退休 · 抓紧美元增额年金 · 现金价值长期持有 · 退休后流动性已锁定'
  8379. });
  8380. }
  8381. // 离异家庭(无画像但 marriage='divorced')
  8382. if (d.marriage === 'divorced' && d.childCount > 0 && !personaId.includes('single_mom')) {
  8383. items.push({
  8384. name: '👩‍👦 离异家庭专项',
  8385. desc: '寿险受益人**单一指定子女**(必须公证)· 避免前任家庭干扰 · 教育金险锁定子女专属'
  8386. });
  8387. }
  8388. // 默认建议(完全空白时)
  8389. if (items.length === 0) {
  8390. items.push({
  8391. name: '✓ 当前保障基础健全',
  8392. desc: '建议每年复盘 1 次保单 · 关注现金价值增长 · 与家庭资产再平衡同步'
  8393. });
  8394. }
  8395. // 渲染(最多 6 条,避免过长)
  8396. list.innerHTML = items.slice(0, 6).map(it => `<div class="uhnw-item">
  8397. <div class="uhnw-item-name">${it.name}</div>
  8398. <div class="uhnw-item-desc">${it.desc}</div>
  8399. </div>`).join('');
  8400. }
  8401. function updateChildAgeFields() {
  8402. const count = parseInt(document.getElementById('childCount').value);
  8403. for (let i = 1; i <= 3; i++) {
  8404. document.getElementById('childAge'+i+'Wrap').style.display = i <= count ? 'flex' : 'none';
  8405. }
  8406. }
  8407. function resetForm() {
  8408. if (!confirm('确认重置所有输入?')) return;
  8409. document.querySelectorAll('input').forEach(i => {
  8410. if (i.type === 'number') i.value = i.defaultValue || '';
  8411. else i.value = '';
  8412. });
  8413. document.querySelectorAll('select').forEach(s => s.selectedIndex = 0);
  8414. document.getElementById('result').style.display = 'none';
  8415. // [Bug fix] 清 persona 标记
  8416. sessionStorage.removeItem('cy_persona_id');
  8417. sessionStorage.removeItem('cy_persona_force_hnw');
  8418. document.querySelectorAll('.persona-chip').forEach(c => c.classList.remove('selected'));
  8419. updateChildAgeFields();
  8420. window.scrollTo({ top:0, behavior:'smooth' });
  8421. }
  8422. window.addEventListener('DOMContentLoaded', () => {
  8423. updateChildAgeFields();
  8424. // v3.3.1 · 强制初始化金字塔工具开关 + 默认渲染一次,确保点击立即生效(不依赖用户先点击"计算")
  8425. if (typeof initCalcPyramidToggles === 'function') initCalcPyramidToggles();
  8426. if (typeof renderCalcPyramidSvg === 'function') {
  8427. renderCalcPyramidSvg({ wl:0.55, retire:0.40, edu:0.35, life:0.65, acc:0.85, med:0.75, ci:0.55 });
  8428. }
  8429. // v3.3.4 · 画像切换 dropdown 初始化(暴露 vault 全部 CY_PORTRAITS · 与 PolicySummary 同源)
  8430. if (typeof populatePortraitSwitcher === 'function') populatePortraitSwitcher();
  8431. // [2026-07-15 quiz×IC 桥] URL 参数 ?portrait=<key> 预载画像(来自 interactive-case-quiz「用 IC 算」按钮)
  8432. try {
  8433. const qpKey = new URLSearchParams(window.location.search).get('portrait');
  8434. if (qpKey && window.CY_PORTRAITS && window.CY_PORTRAITS[qpKey]) {
  8435. const data = JSON.stringify(window.CY_PORTRAITS[qpKey]);
  8436. localStorage.setItem('cy_current_portrait', data);
  8437. localStorage.setItem('cy-demo-portrait-data', data);
  8438. localStorage.setItem('cy-demo-family', qpKey);
  8439. }
  8440. } catch (e) { /* 无参数或解析失败 → 走正常 loadPortrait 流程 */ }
  8441. // Phase 2: 自动检测 cy_current_portrait 并预填
  8442. const pt = loadPortrait();
  8443. if (pt && pt.family) {
  8444. prefillFromPortrait(pt);
  8445. }
  8446. });
  8447. </script>
  8448. <script id="v01-hero-js">
  8449. /* [2026-07-12 移植自 家庭保障体检报告 v0.1] 体检报告 Hero 渲染引擎 */
  8450. const V01_PERSPECTIVES = {
  8451. layers: {
  8452. title: '保险三层 · 基础 / 中端 / 高端',
  8453. subtitle: '沿用 v4.7 风险金字塔架构 · 60 基线 + 三层差异化(高若楠 6-24 反馈)',
  8454. compute: function() {
  8455. // 7 险种 ready/need 从 v4.7 DOM 取
  8456. function _gv(id) { const el = document.getElementById(id); return el ? parseFloat(el.textContent.replace(/[^0-9.]/g, '')) || 0 : 0; }
  8457. const acc = { need: _gv('accAmount'), have: _gv('accExisting') };
  8458. const med = { need: _gv('medAmount'), have: _gv('medExisting') };
  8459. const ci = { need: _gv('ciAmount'), have: _gv('ciExisting') };
  8460. const life= { need: _gv('lifeAmount'), have: _gv('lifeExisting') };
  8461. const edu = { need: _gv('eduAmount'), have: _gv('eduExisting') };
  8462. const ret = { need: _gv('retireAmount'), have: _gv('retireExisting') };
  8463. const wl = { need: _gv('wlAmount'), have: _gv('wlExisting') };
  8464. // 计算"实际/需求"覆盖率(0~1)
  8465. function _cov(items) {
  8466. const need = items.reduce(function(s, x){ return s + x.need; }, 0);
  8467. const have = items.reduce(function(s, x){ return s + Math.min(x.have, x.need); }, 0);
  8468. return need > 0 ? have / need : 0;
  8469. }
  8470. // 判断该层是否有任何险种已配
  8471. function _hasAny(items) {
  8472. return items.some(function(x){ return x.have > 0; });
  8473. }
  8474. // [v0.1 · 2026-06-27 · 高若楠 6-24 反馈] 三层差异化基线公式
  8475. // 基础层 = 刚需(意外/医疗/重疾)· 必配 · 没买 = 严重缺口 20 分
  8476. // 中端层 = 应配(定寿/教育/养老)· 中度 · 没买 = 中性 40 分
  8477. // 高端层 = 选配(终身寿/传承)· 非通用刚需 · 没买 = 默认良好 60 分(不视为缺口)
  8478. const baseItems = [acc, med, ci];
  8479. const midItems = [life, edu, ret];
  8480. const highItems = [wl];
  8481. const basic = _hasAny(baseItems)
  8482. ? Math.round(60 + _cov(baseItems) * 40)
  8483. : 20;
  8484. const middle = _hasAny(midItems)
  8485. ? Math.round(55 + _cov(midItems) * 45)
  8486. : 40;
  8487. const high = _hasAny(highItems)
  8488. ? Math.round(50 + _cov(highItems) * 50)
  8489. : 60;
  8490. return [
  8491. { icon: '🟧', label: '基础保障', value: basic, status: _statusFor(basic, '刚需'), color: _colorFor(basic) },
  8492. { icon: '🟦', label: '中端规划', value: middle, status: _statusFor(middle, '储蓄'), color: _colorFor(middle) },
  8493. { icon: '🟪', label: '高端传承', value: high, status: _statusFor(high, '传承'), color: _colorForLegacy(high) }
  8494. ];
  8495. }
  8496. },
  8497. holistic: {
  8498. title: '全息体检 · 保障 / 财富 / 健康',
  8499. subtitle: 'Benchmark 双管家战略 · 财富 + 健康并列(健康环演示数据)',
  8500. compute: function() {
  8501. // 保障 = 已配齐 / 完整需求
  8502. function _gv(id) { const el = document.getElementById(id); return el ? parseFloat(el.textContent.replace(/[^0-9.]/g, '')) || 0 : 0; }
  8503. const total = _gv('totalCoverage');
  8504. const gap = _gv('totalGap');
  8505. const ready = Math.max(0, total - gap);
  8506. const protectionScore = total > 0 ? Math.round((ready / total) * 100) : 0;
  8507. // 财富配置度 = 综合(流动性 30% + 跨境合规 30% + AUM 档位 40%)
  8508. const liquid = _gv('liquidAssets');
  8509. const wealth = _gv('totalAumForWL') || (liquid * 5); // fallback
  8510. const liquidScore = wealth > 0 ? Math.min(100, (liquid / (wealth * 0.15)) * 100) : 0; // 流动性占 15% 最佳
  8511. const aumScore = wealth >= 50000 ? 100 : wealth >= 5000 ? 80 : wealth >= 2000 ? 65 : wealth >= 500 ? 45 : 25;
  8512. const usPersonEl = document.getElementById('hasUSPerson');
  8513. const isUS = usPersonEl && usPersonEl.value === 'yes';
  8514. const complianceScore = isUS ? 60 : 85; // 美籍家族跨境合规复杂度高
  8515. const wealthScore = Math.round(liquidScore * 0.3 + complianceScore * 0.3 + aumScore * 0.4);
  8516. // 健康规划度(演示数据 · 等 Benchmark Health 接入后切真实)
  8517. // 简化模型:基于年龄(35-50 最佳 / 50+ 风险增加)+ 假定 MICA/MISS 检测覆盖
  8518. const ageEl = document.getElementById('age');
  8519. const age = ageEl ? parseInt(ageEl.value) || 35 : 35;
  8520. let healthScore = 50;
  8521. if (age < 35) healthScore = 80;
  8522. else if (age < 45) healthScore = 70;
  8523. else if (age < 55) healthScore = 55;
  8524. else if (age < 65) healthScore = 45;
  8525. else healthScore = 35;
  8526. // 演示用:加 ±10 随机基于 persona id(让不同画像差异化)
  8527. const pid = sessionStorage.getItem('cy_persona_id') || '';
  8528. if (pid === 'silver') healthScore = Math.min(100, healthScore + 5); // 银发已有储备
  8529. if (pid === 'cross_border') healthScore = Math.min(100, healthScore + 10); // HNW 健康投入
  8530. if (pid === 'uhnw_succession') healthScore = Math.min(100, healthScore + 15);
  8531. return [
  8532. { icon: '🛡', label: '保障完整度', value: protectionScore, status: _statusFor(protectionScore, '保险'), color: _colorFor(protectionScore) },
  8533. { icon: '💰', label: '财富配置度', value: Math.min(100, wealthScore), status: _statusFor(wealthScore, '配置'), color: _colorForWealth(wealthScore) },
  8534. { icon: '❤', label: '健康规划度', value: healthScore, status: _statusFor(healthScore, '健康') + ' (演示)', color: _colorForHealth(healthScore) }
  8535. ];
  8536. }
  8537. },
  8538. decision: {
  8539. title: '决策三视角 · 完整度 / 支付能力 / 时间窗口',
  8540. subtitle: '回答 "我缺多少 / 我能不能负担 / 我还有多少时间"',
  8541. compute: function() {
  8542. function _gv(id) { const el = document.getElementById(id); return el ? parseFloat(el.textContent.replace(/[^0-9.]/g, '')) || 0 : 0; }
  8543. const total = _gv('totalCoverage');
  8544. const gap = _gv('totalGap');
  8545. const ready = Math.max(0, total - gap);
  8546. const completeScore = total > 0 ? Math.round((ready / total) * 100) : 0;
  8547. // 支付能力 = 1 - (年缴 / cap上限),即"可负担方案 vs 完整需求"占比
  8548. // 用 _cyAffordableTotalYuan 与完整需求保费对比
  8549. const affordable = window._cyAffordableTotalYuan || 0;
  8550. const fullPremiumWan = _gv('totalAnnualPremium');
  8551. const fullPremium = fullPremiumWan * 10000;
  8552. const affordScore = fullPremium > 0
  8553. ? Math.min(100, Math.round((affordable / fullPremium) * 100))
  8554. : 100;
  8555. // 时间窗口 = yearsToRetire / 30
  8556. const ageEl = document.getElementById('age');
  8557. const retireAgeEl = document.getElementById('retireAge');
  8558. const age = ageEl ? parseInt(ageEl.value) || 35 : 35;
  8559. const retireAge = retireAgeEl ? parseInt(retireAgeEl.value) || 60 : 60;
  8560. const yearsToRetire = Math.max(0, retireAge - age);
  8561. const timeScore = Math.min(100, Math.round((yearsToRetire / 30) * 100));
  8562. return [
  8563. { icon: '💰', label: '保障完整度', value: completeScore, status: _statusFor(completeScore, '已配齐'), color: _colorFor(completeScore) },
  8564. { icon: '💸', label: '支付能力', value: affordScore, status: affordScore >= 100 ? '完整可负担' : '需缩减 ' + (100-affordScore) + '%', color: _colorForCapacity(affordScore) },
  8565. { icon: '⏰', label: '时间窗口', value: timeScore, status: yearsToRetire <= 5 ? '紧迫 · ' + yearsToRetire + ' 年' : yearsToRetire + ' 年至退休', color: _colorForTime(timeScore) }
  8566. ];
  8567. }
  8568. },
  8569. assets: {
  8570. title: '资产三层 · 保险 / 投资 / 现金流',
  8571. subtitle: '跨工具联动 · 投资环演示数据(待接入 AssetCenter)',
  8572. compute: function() {
  8573. function _gv(id) { const el = document.getElementById(id); return el ? parseFloat(el.textContent.replace(/[^0-9.]/g, '')) || 0 : 0; }
  8574. const total = _gv('totalCoverage');
  8575. const gap = _gv('totalGap');
  8576. const ready = Math.max(0, total - gap);
  8577. const insuranceScore = total > 0 ? Math.round((ready / total) * 100) : 0;
  8578. // 投资配置(演示)· 基于 totalWealth 档位 + 行业平均假设
  8579. const liquid = _gv('liquidAssets');
  8580. const invest = _gv('investAssets');
  8581. const totalWealth = liquid + _gv('primaryResidence') + invest;
  8582. // 投资比例 = invest / totalWealth(15-40% 健康)
  8583. const investRatio = totalWealth > 0 ? (invest / totalWealth) : 0;
  8584. let investScore = 0;
  8585. if (investRatio < 0.05) investScore = 25;
  8586. else if (investRatio < 0.15) investScore = 50;
  8587. else if (investRatio < 0.40) investScore = 80;
  8588. else if (investRatio < 0.60) investScore = 70; // 投资过重也扣分
  8589. else investScore = 50;
  8590. // 演示加成:有跨境资产 +10
  8591. if (_gv('overseasAssets') > 0) investScore = Math.min(100, investScore + 10);
  8592. // 现金流健康 = (流动 - 应急金) / 月生活费
  8593. // 应急金 = 6-12 月生活费 ≈ 月生活费 × 9
  8594. const salary = _gv('salary');
  8595. const monthlyExp = salary * 0.45 / 12; // 简化模型
  8596. const emergencyReserve = monthlyExp * 9;
  8597. const usableLiquid = Math.max(0, liquid - emergencyReserve);
  8598. // 健康度 = usable 占 liquid 的比例 + 应急金充足度
  8599. let cashflowScore = 0;
  8600. if (liquid > emergencyReserve * 2) cashflowScore = 90;
  8601. else if (liquid > emergencyReserve * 1.5) cashflowScore = 75;
  8602. else if (liquid > emergencyReserve) cashflowScore = 60;
  8603. else if (liquid > emergencyReserve * 0.5) cashflowScore = 35;
  8604. else cashflowScore = 15;
  8605. return [
  8606. { icon: '🛡', label: '保险保障', value: insuranceScore, status: _statusFor(insuranceScore, '保障'), color: _colorFor(insuranceScore) },
  8607. { icon: '📈', label: '投资配置', value: investScore, status: _statusFor(investScore, '配置') + ' (演示)', color: _colorForInvest(investScore) },
  8608. { icon: '💧', label: '现金流健康', value: cashflowScore, status: cashflowScore >= 75 ? '应急金充足' : cashflowScore >= 60 ? '基本应急' : '应急金不足', color: _colorForCashflow(cashflowScore) }
  8609. ];
  8610. }
  8611. }
  8612. };
  8613. // 状态文案 helpers
  8614. function _statusFor(score, label) {
  8615. if (score >= 80) return label + ' · 完备';
  8616. if (score >= 60) return label + ' · 良好';
  8617. if (score >= 40) return label + ' · 部分就绪';
  8618. return label + ' · 待规划';
  8619. }
  8620. function _colorFor(score) {
  8621. if (score >= 80) return '#5EE0A0';
  8622. if (score >= 60) return '#C9A84C';
  8623. if (score >= 40) return '#E89B3D';
  8624. return '#E87070';
  8625. }
  8626. function _colorForLegacy(score) { // 高端传承:紫色系
  8627. if (score >= 80) return '#A875E0';
  8628. if (score >= 60) return '#7A5A8E';
  8629. if (score >= 40) return '#E89B3D';
  8630. return '#E87070';
  8631. }
  8632. function _colorForWealth(score) { // 财富:暖金
  8633. if (score >= 80) return '#F5C988';
  8634. if (score >= 60) return '#C9A84C';
  8635. if (score >= 40) return '#E89B3D';
  8636. return '#E87070';
  8637. }
  8638. function _colorForHealth(score) { // 健康:绿系
  8639. if (score >= 80) return '#5EE0A0';
  8640. if (score >= 60) return '#A0C9A8';
  8641. if (score >= 40) return '#E89B3D';
  8642. return '#E87070';
  8643. }
  8644. function _colorForCapacity(score) { // 支付能力:红绿(满分绿)
  8645. if (score >= 100) return '#5EE0A0';
  8646. if (score >= 80) return '#C9A84C';
  8647. if (score >= 60) return '#E89B3D';
  8648. return '#E87070';
  8649. }
  8650. function _colorForTime(score) { // 时间窗口:满 100% 蓝/紧迫红
  8651. if (score >= 60) return '#8FB9D6';
  8652. if (score >= 30) return '#C9A84C';
  8653. return '#E87070';
  8654. }
  8655. function _colorForInvest(score) { // 投资:深蓝
  8656. if (score >= 80) return '#5EE0A0';
  8657. if (score >= 60) return '#8FB9D6';
  8658. if (score >= 40) return '#E89B3D';
  8659. return '#E87070';
  8660. }
  8661. function _colorForCashflow(score) { // 现金流:水蓝
  8662. if (score >= 80) return '#5EE0A0';
  8663. if (score >= 60) return '#8FB9D6';
  8664. if (score >= 40) return '#E89B3D';
  8665. return '#E87070';
  8666. }
  8667. /* === 三环渲染 · 重写整个 #v01RingsRow DOM === */
  8668. function v01RenderRings(perspective) {
  8669. perspective = perspective || 'layers';
  8670. window.V01_CURRENT_PERSPECTIVE = perspective;
  8671. const cfg = V01_PERSPECTIVES[perspective];
  8672. if (!cfg) return;
  8673. const row = document.getElementById('v01RingsRow');
  8674. const titleEl = document.getElementById('v01RingsTitle');
  8675. const subtitleEl = document.getElementById('v01RingsSubtitle');
  8676. if (titleEl) titleEl.textContent = cfg.title;
  8677. if (subtitleEl) subtitleEl.textContent = cfg.subtitle;
  8678. if (!row) return;
  8679. let rings;
  8680. try { rings = cfg.compute(); } catch(e) { console.warn('[v0.1.3 perspective compute fail]', e); rings = [{value:0},{value:0},{value:0}]; }
  8681. // SVG circumference (r=72)
  8682. const r = 72, circumference = 2 * Math.PI * r;
  8683. let html = '';
  8684. rings.forEach(function(ring, idx){
  8685. const val = Math.max(0, Math.min(100, ring.value || 0));
  8686. const offset = circumference - (val / 100) * circumference;
  8687. html += '<div class="v01-ring-tile" data-ring-idx="' + idx + '" onclick="v01OpenRingPopover(\'' + perspective + '\',' + idx + ')">' +
  8688. '<div class="v01-ring-tile-canvas">' +
  8689. '<svg viewBox="0 0 160 160">' +
  8690. '<circle class="v01-ring-tile-track" cx="80" cy="80" r="' + r + '"></circle>' +
  8691. '<circle class="v01-ring-tile-progress" cx="80" cy="80" r="' + r + '" ' +
  8692. 'stroke="' + (ring.color || '#C9A84C') + '" ' +
  8693. 'stroke-dasharray="' + circumference + '" ' +
  8694. 'stroke-dashoffset="' + offset + '"></circle>' +
  8695. '</svg>' +
  8696. '<div class="v01-ring-tile-text">' +
  8697. '<div class="v01-ring-tile-icon">' + (ring.icon || '◆') + '</div>' +
  8698. '<div class="v01-ring-tile-num">' + val + '</div>' +
  8699. '<div class="v01-ring-tile-unit">/100</div>' +
  8700. '</div>' +
  8701. '</div>' +
  8702. '<div class="v01-ring-tile-label">' + (ring.label || '') + '</div>' +
  8703. '<div class="v01-ring-tile-status">' + (ring.status || '') + '</div>' +
  8704. '</div>';
  8705. });
  8706. row.innerHTML = html;
  8707. }
  8708. /* === [v0.1.6 + Jack 2026-06-22] 三环点击 popup · 算法解释 === */
  8709. const V01_RING_EXPLAINS = {
  8710. // 视角 → 3 环索引 → { formula, text, drillTo }
  8711. layers: [
  8712. { formula: '<strong>基础保障</strong>(刚需层 · 全家庭必配)<br>' +
  8713. '<br>· <strong>有买任一项</strong> → 60 + (覆盖率 × 40)· 区间 60~100<br>' +
  8714. '· <strong>完全未配</strong> → 20 分(严重缺口红线)<br>' +
  8715. '<br><span style="opacity:.7">含 意外 / 医疗 / 重疾 · 公式:意外=salary×3-5 / 医疗=¥800万 / 重疾=salary×2-5</span>',
  8716. text: '基础保障层是<strong>所有家庭必配的"刚需层"</strong> — 对冲"损失性风险"(进/防 · 没钱)。<br>' +
  8717. '<strong>评分规则</strong>:已买任一项 → 自动 60 分起评,然后按实际覆盖率加分到 100 · 完全未配 → 20 分警示(严重红线)。',
  8718. drillTo: 'pyramidCheckCard' },
  8719. { formula: '<strong>中端规划</strong>(应配层 · 中产以上推荐)<br>' +
  8720. '<br>· <strong>有买任一项</strong> → 55 + (覆盖率 × 45)· 区间 55~100<br>' +
  8721. '· <strong>完全未配</strong> → 40 分(中性 · 非必须)<br>' +
  8722. '<br><span style="opacity:.7">含 定寿 / 教育金 / 养老金 · 公式:定寿=DIM法 / 教育金=子女路径×通胀PV / 养老金=月缺口×退休年限</span>',
  8723. text: '中端规划层覆盖"<strong>支出性风险</strong>"(出/增 · 花钱)— 子女教育 / 退休生活 / 收入替代等长周期支出。<br>' +
  8724. '<strong>评分规则</strong>:已配任一项 → 55 起评 · 覆盖率加分 · 未配为中性 40 分(非刚需 · 不视为严重缺口)。',
  8725. drillTo: 'affDualTrack' },
  8726. { formula: '<strong>高端传承</strong>(选配层 · UHNW / 跨境家族)<br>' +
  8727. '<br>· <strong>有买终身寿</strong> → 50 + (覆盖率 × 50)· 区间 50~100<br>' +
  8728. '· <strong>未配</strong> → 60 分(默认良好 · 非通用刚需)<br>' +
  8729. '<br><span style="opacity:.7">普通家庭 wlNeed = 总财富 × 30%(传承基线)/ HNW wlNeed = 境内增额 + 境外 IUL·VUL·PPLI 双轨</span>',
  8730. text: '高端传承层对冲"<strong>所有性风险</strong>"(保/传/留钱)— 家族财富跨代隔离 + 税务结构。<br>' +
  8731. '<strong>评分规则</strong>:已配终身寿 → 50 起评 · 未配 → 默认 60(因为不是所有家庭都需要传承层,普通家庭无此环为大红线一说)。',
  8732. drillTo: 'pyramidCheckCard' }
  8733. ],
  8734. holistic: [
  8735. { formula: '<strong>保障完整度</strong> = (7 险种已配齐保额) / 7 险种完整需求合计<br><br>' +
  8736. '即 v4.7 "保障缺口" Hero 的反向口径:已配齐 = totalCoverage − totalGap',
  8737. text: '<strong>保障维度</strong>是 Benchmark 的<strong>核心专业领域</strong> — 保险 7 险种(意外/医疗/重疾/定寿/教育/养老/终身寿)综合体检。',
  8738. drillTo: 'result' },
  8739. { formula: '<strong>财富配置度</strong> = 流动性 30% + 跨境合规 30% + AUM 档位 40%<br><br>' +
  8740. '流动性:流动资产 / (总财富 × 15% 最佳)<br>' +
  8741. '合规:美籍标记 60 分 / 非美籍 85 分<br>' +
  8742. 'AUM 档位:< 500 万=25 / 500-2000 万=45 / 2000-5000 万=65 / 5000 万-5 亿=80 / 5 亿+=100',
  8743. text: '<strong>财富维度</strong>测量<strong>资产配置健康度</strong>(估算)— 流动性 + 跨境合规复杂度 + AUM 档位 加权综合。<br>' +
  8744. '⚠ 演示数据 · 真实评估需走 AssetCenter / LetsSee 完整推演。',
  8745. drillTo: 'result' },
  8746. { formula: '<strong>健康规划度</strong> = 年龄基线 + persona 健康加成<br><br>' +
  8747. '< 35 岁=80 / 35-45=70 / 45-55=55 / 55-65=45 / 65+=35<br>' +
  8748. '银发已有储备 +5 / HNW 健康投入 +10 / UHNW +15',
  8749. text: '<strong>健康维度</strong>是双管家战略的<strong>另一翼</strong>(Benchmark Health)。<br>' +
  8750. '⚠ 当前演示数据 · 真实评估对接 MICA/MISS 检测覆盖率 + 健康风险预案。<br>' +
  8751. '<strong>未来对接</strong>:Benchmark Health 平台 API + 客户实际检测数据。',
  8752. drillTo: 'result' }
  8753. ],
  8754. decision: [
  8755. { formula: '<strong>保障完整度</strong> = 已配齐保额 / 完整需求保额<br><br>' +
  8756. '回答 "<strong>我缺多少</strong>" — 这是 7 险种的"已盖率"',
  8757. text: '决策视角第 1 维:<strong>距离目标的差距</strong>。<br>' +
  8758. '> 80 视为完备 · 60-80 良好 · 40-60 部分就绪 · < 40 待规划。',
  8759. drillTo: 'result' },
  8760. { formula: '<strong>支付能力</strong> = 可负担方案年缴 / 完整需求年缴<br><br>' +
  8761. '可负担方案 = 系统按客户支付能力(salary × cap% 或 AUM × 1%)自动缩减后的方案<br>' +
  8762. '若 = 100% → 完整需求即可负担 · 若 < 100% → 储蓄型已被缩减',
  8763. text: '决策视角第 2 维:<strong>我能不能负担</strong>。<br>' +
  8764. '若 < 100% 说明完整需求超出客户支付上限,代理人应优先讨论<strong>缩减养老/教育</strong>或<strong>延长缴费期</strong>。',
  8765. drillTo: 'affDualTrack' },
  8766. { formula: '<strong>时间窗口</strong> = yearsToRetire / 30<br><br>' +
  8767. 'yearsToRetire = 退休年龄 - 当前年龄<br>' +
  8768. '< 5 年 = 紧迫 / 5-10 年 = 较紧 / 10-30 年 = 充裕',
  8769. text: '决策视角第 3 维:<strong>我还有多少时间</strong>。<br>' +
  8770. '准退休客户(yearsToRetire ≤ 10)的"时间窗口"环会告急 — 代理人应抓<strong>短缴期(5/10 年)+ 趸交</strong>组合,锁定不可保性。',
  8771. drillTo: 'cashflowSection' }
  8772. ],
  8773. assets: [
  8774. { formula: '<strong>保险保障</strong> = 同"保障完整度" = 已配齐 / 完整需求',
  8775. text: '资产视角第 1 层:<strong>保险(对冲层)</strong> — 出险时的"紧急救援基金"。',
  8776. drillTo: 'result' },
  8777. { formula: '<strong>投资配置</strong> = 基于 invest / totalWealth 比例 + 跨境加成<br><br>' +
  8778. '< 5% = 25(配置不足)<br>' +
  8779. '5-15% = 50<br>' +
  8780. '15-40% = 80(健康区间)<br>' +
  8781. '40-60% = 70(投资过重)<br>' +
  8782. '> 60% = 50(过激)<br>' +
  8783. '有跨境资产 +10',
  8784. text: '资产视角第 2 层:<strong>投资(增长层)</strong> — 资产分散度健康检查。<br>' +
  8785. '⚠ 演示数据 · 真实评估走 AssetCenter / LetsSee 完整推演。',
  8786. drillTo: 'result' },
  8787. { formula: '<strong>现金流健康</strong> = 流动资产 vs 应急金倍数<br><br>' +
  8788. '应急金 = 月生活费 × 9(6-12 月)<br>' +
  8789. '月生活费 = salary × 45% / 12<br>' +
  8790. '<br>liquid > 应急金 × 2 → 90 分<br>' +
  8791. 'liquid > 应急金 × 1.5 → 75<br>' +
  8792. 'liquid > 应急金 → 60<br>' +
  8793. 'liquid > 应急金 × 0.5 → 35<br>' +
  8794. '其他 → 15',
  8795. text: '资产视角第 3 层:<strong>现金流(流动层)</strong> — 应急金是否足够 + 流动性灵活度。<br>' +
  8796. 'HNW / 准退休客户尤其重要 — 决定能否"<strong>用存款交保费</strong>"。',
  8797. drillTo: 'affordabilitySection' }
  8798. ]
  8799. };
  8800. function v01OpenRingPopover(perspective, ringIdx) {
  8801. const expl = (V01_RING_EXPLAINS[perspective] || [])[ringIdx];
  8802. if (!expl) return;
  8803. const cfg = V01_PERSPECTIVES[perspective];
  8804. if (!cfg) return;
  8805. let rings;
  8806. try { rings = cfg.compute(); } catch(e) { rings = []; }
  8807. const ring = rings[ringIdx];
  8808. if (!ring) return;
  8809. // 填充 popup 内容
  8810. document.getElementById('v01PopIcon').textContent = ring.icon || '◆';
  8811. document.getElementById('v01PopLabel').textContent = cfg.title + ' · 维度 ' + (ringIdx + 1);
  8812. document.getElementById('v01PopTitle').textContent = ring.label || '维度';
  8813. document.getElementById('v01PopScoreNum').textContent = ring.value || 0;
  8814. document.getElementById('v01PopScoreStatus').textContent = ring.status || '';
  8815. document.getElementById('v01PopFormula').innerHTML = expl.formula;
  8816. document.getElementById('v01PopText').innerHTML = expl.text;
  8817. // 把当前 ring 对应的 drillTarget 记到 popup,关闭时可用
  8818. window._v01PopupDrillTarget = expl.drillTo;
  8819. document.getElementById('v01RingPopover').classList.add('is-open');
  8820. }
  8821. function v01ClosePopover(ev) {
  8822. if (ev && ev.target && !ev.target.classList.contains('v01-ring-popover-overlay') && !ev.target.classList.contains('v01-pop-close')) {
  8823. // 点击非 overlay/close 按钮的内容区域 · 不关闭
  8824. if (ev.currentTarget !== ev.target && !ev.target.matches('.v01-pop-close')) return;
  8825. }
  8826. document.getElementById('v01RingPopover').classList.remove('is-open');
  8827. }
  8828. function v01PopJumpToFull() {
  8829. const target = window._v01PopupDrillTarget || 'result';
  8830. v01ClosePopover();
  8831. setTimeout(function(){ v01DrillTo(target); }, 100);
  8832. }
  8833. /* === Perspective 切换器 === */
  8834. function v01SwitchPerspective(perspective) {
  8835. // 更新按钮 active 状态
  8836. document.querySelectorAll('.v01-perspective-btn').forEach(function(b){
  8837. b.classList.toggle('is-active', b.getAttribute('data-perspective') === perspective);
  8838. });
  8839. // 重新渲染三环
  8840. v01RenderRings(perspective);
  8841. // 持久化
  8842. localStorage.setItem('cy_v01_perspective', perspective);
  8843. }
  8844. /* === 启动恢复 perspective === */
  8845. (function v01RestorePerspective(){
  8846. const saved = localStorage.getItem('cy_v01_perspective');
  8847. if (saved && V01_PERSPECTIVES[saved]) {
  8848. window.V01_CURRENT_PERSPECTIVE = saved;
  8849. setTimeout(function(){
  8850. document.querySelectorAll('.v01-perspective-btn').forEach(function(b){
  8851. b.classList.toggle('is-active', b.getAttribute('data-perspective') === saved);
  8852. });
  8853. }, 50);
  8854. } else {
  8855. window.V01_CURRENT_PERSPECTIVE = 'layers';
  8856. }
  8857. })();
  8858. function v01UpdateHero() {
  8859. // 5.1 保障完整度 (0-100)
  8860. const totalCoverageEl = document.getElementById('totalCoverage');
  8861. const totalGapEl = document.getElementById('totalGap');
  8862. if (!totalCoverageEl || !totalGapEl) return;
  8863. // 从 v4.7 隐藏节点取数(它们是 v4.7 的"老兼容"节点,calculate 写入)
  8864. const _total = parseFloat(totalCoverageEl.textContent.replace(/[^0-9.]/g, '')) || 0;
  8865. const _gap = parseFloat(totalGapEl.textContent.replace(/[^0-9.]/g, '')) || 0;
  8866. const _ready = Math.max(0, _total - _gap);
  8867. const score = _total > 0 ? Math.round((_ready / _total) * 100) : 0;
  8868. // 5.2 [v0.1.3] 三环渲染 · 由当前 perspective 驱动(替换原单环)
  8869. v01RenderRings(window.V01_CURRENT_PERSPECTIVE || 'layers');
  8870. // 5.3 3 KPI
  8871. // 保障缺口(取 v4.7 Hero totalGapHero)
  8872. const heroGapEl = document.getElementById('totalGapHero');
  8873. const v01Gap = document.getElementById('v01KpiGap');
  8874. if (heroGapEl && v01Gap) v01Gap.textContent = heroGapEl.textContent;
  8875. // 保障杠杆
  8876. const levEl = document.getElementById('leverage');
  8877. const v01Lev = document.getElementById('v01KpiLeverage');
  8878. if (levEl && v01Lev) v01Lev.textContent = levEl.textContent;
  8879. // 实际年成本
  8880. const costEl = document.getElementById('totalAnnualPremium');
  8881. const v01Cost = document.getElementById('v01KpiCost');
  8882. if (costEl && v01Cost) v01Cost.textContent = costEl.textContent;
  8883. // 副文案 · 占收入比
  8884. const costSubEl = document.getElementById('totalAnnualPremiumSub');
  8885. const v01CostSub = document.getElementById('v01KpiCostSub');
  8886. if (costSubEl && v01CostSub) {
  8887. const m = costSubEl.textContent.match(/(\d+\.?\d*)%/);
  8888. v01CostSub.textContent = m ? '占总财富 ' + m[1] + '%' : '年缴 / 收入';
  8889. }
  8890. // 保障缺口副文案
  8891. const v01GapSub = document.getElementById('v01KpiGapSub');
  8892. if (v01GapSub && _total > 0) {
  8893. const gapPct = ((_gap / _total) * 100).toFixed(0);
  8894. v01GapSub.textContent = '7 险种 · 缺 ' + gapPct + '%';
  8895. }
  8896. // 5.4 mini 三轨数字
  8897. const triFull = document.getElementById('triFullTotal');
  8898. const triAff = document.getElementById('triAffTotal');
  8899. const triCustom = document.getElementById('triCustomTotal');
  8900. if (triFull) document.getElementById('v01MiniTriFull').textContent = triFull.textContent;
  8901. if (triAff) document.getElementById('v01MiniTriAff').textContent = triAff.textContent;
  8902. if (triCustom) document.getElementById('v01MiniTriCustom').textContent = triCustom.textContent;
  8903. // 5.5 [v0.1.6] mini 应急储备健康度 · 替换原 mini 杠杆(避免与 3 KPI 重复)
  8904. // 算法:流动资产 / 月生活费 = 应急金倍数(月)· 行业建议 6-12 月
  8905. function _gv2(id) {
  8906. const el = document.getElementById(id);
  8907. if (!el) return 0;
  8908. const txt = (el.value !== undefined ? el.value : el.textContent || '0').replace(/[^\d.]/g, '');
  8909. const num = parseFloat(txt);
  8910. return isNaN(num) ? 0 : num;
  8911. }
  8912. const liquidWan = _gv2('liquidAssets');
  8913. const salaryWan = _gv2('salary');
  8914. const monthlyExpWan = salaryWan * 0.45 / 12; // 简化:salary × 45% 生活费比 / 12
  8915. const emergencyMonths = monthlyExpWan > 0 ? (liquidWan / monthlyExpWan) : 0;
  8916. const emergNumEl = document.getElementById('v01EmergencyNum');
  8917. const emergFillEl = document.getElementById('v01EmergencyFill');
  8918. const emergFootEl = document.getElementById('v01EmergencyFoot');
  8919. if (emergNumEl) emergNumEl.textContent = emergencyMonths.toFixed(1);
  8920. if (emergFillEl) {
  8921. // bar 锚点 0-24 月范围(24 月=100%)
  8922. const fillPct = Math.min(100, (emergencyMonths / 24) * 100);
  8923. emergFillEl.style.width = fillPct + '%';
  8924. }
  8925. if (emergFootEl) {
  8926. let status = '';
  8927. if (emergencyMonths >= 12) status = '✓ 充裕';
  8928. else if (emergencyMonths >= 6) status = '⚠ 基本应急';
  8929. else if (emergencyMonths >= 3) status = '🔸 偏低';
  8930. else status = '🔴 不足';
  8931. emergFootEl.textContent = '流动资产 ¥' + liquidWan + '万 / 月生活费 ¥' + monthlyExpWan.toFixed(1) + '万 · ' + status;
  8932. }
  8933. // 5.6 mini 风险金字塔(简化:7 险种垂直条)
  8934. v01RenderMiniPyramid();
  8935. // 5.7 mini 现金流(简化:Y0-Y29 30 年单向柱)
  8936. v01RenderMiniCashflow();
  8937. // 5.8 一句话建议
  8938. v01UpdateCoach(score);
  8939. }
  8940. function v01RenderMiniPyramid() {
  8941. const svg = document.getElementById('v01MiniPyramid');
  8942. if (!svg) return;
  8943. // 从 v4.7 隐藏 DOM 读 7 险种的 need / existing
  8944. const segs = [
  8945. { id: 'acc', label: '意外', color: '#9B7C3A' },
  8946. { id: 'med', label: '医疗', color: '#C4973A' },
  8947. { id: 'ci', label: '重疾', color: '#A61C2B' },
  8948. { id: 'life',label: '定寿', color: '#7A3FA0' },
  8949. { id: 'retire', label: '养老', color: '#3D6F8C' },
  8950. { id: 'edu', label: '教育', color: '#5DB890' },
  8951. { id: 'wl', label: '终身寿', color: '#7A5A8E' }
  8952. ];
  8953. const barW = 22, gap = 6, baseY = 100, maxH = 80;
  8954. let html = '<g>';
  8955. let totalReady = 0, totalAll = 0;
  8956. segs.forEach(function(s, idx){
  8957. // 尝试从 v4.7 DOM 取 "已有 / 缺口 / 总额" 数字
  8958. const calcEl = document.getElementById(s.id + 'Calc');
  8959. const existEl = document.getElementById(s.id + 'Existing');
  8960. const amountEl = document.getElementById(s.id + 'Amount');
  8961. let need = 0, existing = 0;
  8962. if (amountEl) need = parseFloat(amountEl.textContent.replace(/[^0-9.]/g, '')) || 0;
  8963. if (existEl) existing = parseFloat(existEl.textContent.replace(/[^0-9.]/g, '')) || 0;
  8964. const ratio = need > 0 ? Math.min(1, existing / need) : 0;
  8965. totalReady += existing;
  8966. totalAll += need;
  8967. const x = 10 + idx * (barW + gap);
  8968. const fillH = ratio * maxH;
  8969. // 背景条(总需求高度 maxH)
  8970. html += '<rect x="' + x + '" y="' + (baseY - maxH) + '" width="' + barW + '" height="' + maxH + '" fill="rgba(255,255,255,.06)" rx="2"/>';
  8971. // 填充条(已配齐)
  8972. html += '<rect x="' + x + '" y="' + (baseY - fillH) + '" width="' + barW + '" height="' + fillH + '" fill="' + s.color + '" rx="2"/>';
  8973. // label
  8974. html += '<text x="' + (x + barW/2) + '" y="' + (baseY + 12) + '" text-anchor="middle" font-size="8" fill="rgba(201,168,76,.7)">' + s.label + '</text>';
  8975. });
  8976. html += '</g>';
  8977. svg.innerHTML = html;
  8978. // foot 更新
  8979. const foot = document.getElementById('v01PyramidFoot');
  8980. if (foot) {
  8981. const fillRatio = totalAll > 0 ? Math.round((totalReady / totalAll) * 100) : 0;
  8982. foot.textContent = '7 险种水位 · ' + fillRatio + '% 已配齐';
  8983. }
  8984. }
  8985. /* === 7. mini 现金流 Canvas 渲染 · 简化版 30 年单向柱 === */
  8986. function v01RenderMiniCashflow() {
  8987. const canvas = document.getElementById('v01MiniCashflow');
  8988. if (!canvas) return;
  8989. const ctx = canvas.getContext('2d');
  8990. const W = canvas.width, H = canvas.height;
  8991. ctx.clearRect(0, 0, W, H);
  8992. // [v0.1.1] 双主题色 · 浅色用深金 / 深色用亮金
  8993. const isLight = document.body.classList.contains('theme-light');
  8994. const barColor = isLight ? '#9B7C3A' : '#C9A84C';
  8995. const axisColor = isLight ? 'rgba(155,124,58,.25)' : 'rgba(201,168,76,.2)';
  8996. const labelColor = isLight ? 'rgba(122,96,40,.6)' : 'rgba(201,168,76,.5)';
  8997. const emptyColor = isLight ? 'rgba(122,96,40,.5)' : 'rgba(245,230,184,.4)';
  8998. // [v0.1.5 修复] 从 v4.7 隐藏 DOM 取保费 · 文本格式 "¥35,000" 需去掉非数字字符
  8999. // 原 bug:parseFloat("¥35,000") = NaN(被 ¥ 拦截)→ 整个 Canvas 空白
  9000. function _parsePremium(id) {
  9001. const el = document.getElementById(id);
  9002. if (!el) return 0;
  9003. const txt = (el.textContent || '0').replace(/[^\d.]/g, ''); // 去除 ¥ , 万 等非数字字符
  9004. const num = parseFloat(txt);
  9005. return isNaN(num) ? 0 : num;
  9006. }
  9007. const accP = _parsePremium('accPremium') / 10000;
  9008. const medP = _parsePremium('medPremium') / 10000;
  9009. const ciP = _parsePremium('ciPremium') / 10000;
  9010. const lifeP = _parsePremium('lifePremium') / 10000;
  9011. const retP = _parsePremium('retirePremium') / 10000;
  9012. const eduP = _parsePremium('eduPremium') / 10000;
  9013. const wlP = _parsePremium('wlPremium') / 10000;
  9014. const total = accP + medP + ciP + lifeP + retP + eduP + wlP;
  9015. if (total <= 0) {
  9016. ctx.fillStyle = emptyColor;
  9017. ctx.font = '11px Inter, sans-serif';
  9018. ctx.textAlign = 'center';
  9019. ctx.fillText('请选择画像或填写数据', W/2, H/2);
  9020. return;
  9021. }
  9022. // 30 个柱(Y0-Y29)
  9023. const YEARS = 30;
  9024. const barW = (W - 16) / YEARS - 1;
  9025. const maxY = Math.max(accP + medP + ciP + lifeP + retP + eduP + wlP, 1);
  9026. const peakH = H - 20;
  9027. for (let y = 0; y < YEARS; y++) {
  9028. let amount = accP + medP; // 终身续保
  9029. if (y < 20) amount += ciP + lifeP + eduP + wlP;
  9030. if (y < 5) amount += retP; // 养老金前 5 年(简化假设)
  9031. const h = (amount / maxY) * peakH;
  9032. const x = 8 + y * (barW + 1);
  9033. ctx.fillStyle = barColor;
  9034. ctx.fillRect(x, H - 12 - h, barW, h);
  9035. }
  9036. // X 轴
  9037. ctx.strokeStyle = axisColor;
  9038. ctx.beginPath();
  9039. ctx.moveTo(0, H - 12);
  9040. ctx.lineTo(W, H - 12);
  9041. ctx.stroke();
  9042. // labels
  9043. ctx.fillStyle = labelColor;
  9044. ctx.font = '9px Inter, sans-serif';
  9045. ctx.textAlign = 'left';
  9046. ctx.fillText('Y0', 10, H - 2);
  9047. ctx.fillText('Y15', W/2 - 6, H - 2);
  9048. ctx.fillText('Y30', W - 18, H - 2);
  9049. // foot 更新
  9050. const foot = document.getElementById('v01CashflowFoot');
  9051. if (foot) foot.textContent = '年缴峰值 ¥' + maxY.toFixed(0) + '万 · 30 年累计 ¥' + (total*20).toFixed(0) + '万';
  9052. }
  9053. function v01UpdateCoach(score) {
  9054. const text = document.getElementById('v01CoachText');
  9055. if (!text) return;
  9056. // 取 9 画像 id
  9057. const pid = (sessionStorage.getItem('cy_persona_id') || '').toLowerCase();
  9058. const yearsToRetireEl = document.getElementById('lifeNeed'); // 用 lifeNeed 作存在性 sentinel
  9059. if (!yearsToRetireEl || !yearsToRetireEl.textContent || yearsToRetireEl.textContent.indexOf('-') === 0) {
  9060. text.innerHTML = '请在右上角选择一个客户画像,或点击「⚙ 现场调参」录入客户信息,系统将自动生成保障诊断。';
  9061. return;
  9062. }
  9063. const age = parseInt((document.getElementById('age')||{}).value || 35);
  9064. const retireAge = parseInt((document.getElementById('retireAge')||{}).value || 60);
  9065. const yearsToRetire = Math.max(0, retireAge - age);
  9066. // 识别主缺口
  9067. const gaps = [
  9068. { id: 'ci', label: '重疾', val: parseFloat((document.getElementById('ciGap')||{}).textContent.replace(/[^0-9.]/g, '') || 0) },
  9069. { id: 'life', label: '定期寿险', val: parseFloat((document.getElementById('lifeGap')||{}).textContent.replace(/[^0-9.]/g, '') || 0) },
  9070. { id: 'retire', label: '养老金', val: parseFloat((document.getElementById('retireGap')||{}).textContent.replace(/[^0-9.]/g, '') || 0) },
  9071. { id: 'edu', label: '教育金', val: parseFloat((document.getElementById('eduGap')||{}).textContent.replace(/[^0-9.]/g, '') || 0) },
  9072. { id: 'wl', label: '终身寿险', val: parseFloat((document.getElementById('wlGap')||{}).textContent.replace(/[^0-9.]/g, '') || 0) }
  9073. ].sort(function(a,b){ return b.val - a.val; });
  9074. const mainGap = gaps[0];
  9075. // 模板选择
  9076. let template = '';
  9077. const scoreStrong = '<strong>' + score + ' 分</strong>';
  9078. const mainGapStrong = '<strong>' + mainGap.label + '</strong>';
  9079. if (yearsToRetire <= 10 && yearsToRetire > 0) {
  9080. // 准退休模板
  9081. const retireGap = gaps.find(function(g){ return g.id === 'retire'; });
  9082. template = '您的保障完整度 ' + scoreStrong + ',主要漏洞在 ' + mainGapStrong + '。' +
  9083. '准退休窗口仅剩 <strong>' + yearsToRetire + ' 年</strong>,' +
  9084. '建议<strong>趸交 / 短缴启动</strong>(5 年缴年金),抢在 60 岁停售前锁定。';
  9085. } else if (pid === 'cross_border' || (document.getElementById('hasUSPerson') && document.getElementById('hasUSPerson').value === 'yes')) {
  9086. // 跨境美籍
  9087. template = '您的保障完整度 ' + scoreStrong + ',跨境美籍家族需重点关注 <strong>境外 PPLI + 遗产税敞口</strong>。' +
  9088. mainGapStrong + '缺口 ¥' + mainGap.val.toFixed(0) + ' 万,建议优先用境外 IUL/PPLI 杠杆配置。';
  9089. } else if (pid === 'uhnw_succession') {
  9090. // UHNW 传承
  9091. template = '您的保障完整度 ' + scoreStrong + ',作为传承型家族,核心在 <strong>境内信托 + 境外 PPLI 双轨</strong>。' +
  9092. mainGapStrong + '缺口 ¥' + (mainGap.val/10000).toFixed(2) + ' 亿,建议 3-5 张保单分批配置 + 跨代传承架构。';
  9093. } else if (pid === 'two_child' || pid === 'middle_3') {
  9094. // 中产带子女
  9095. const eduGap = gaps.find(function(g){ return g.id === 'edu'; });
  9096. if (eduGap && eduGap.val > 100) {
  9097. template = '您的保障完整度 ' + scoreStrong + ',作为中产家庭,<strong>教育金 ¥' + eduGap.val.toFixed(0) + ' 万</strong>是首要补齐项。' +
  9098. '每月 ¥' + ((eduGap.val * 0.025) / 12).toFixed(1) + ' 万即可锁定 ' + (18 - age + 4) + ' 年后的支出。';
  9099. } else {
  9100. template = '您的保障完整度 ' + scoreStrong + ',主要漏洞在 ' + mainGapStrong + '。' +
  9101. '建议先补齐 ' + mainGap.label + ' ¥' + mainGap.val.toFixed(0) + ' 万,再考虑储蓄型升级。';
  9102. }
  9103. } else if (pid === 'single_lady' || pid === 'single_mom' || pid === 'dink') {
  9104. // 单身/丁克
  9105. template = '您的保障完整度 ' + scoreStrong + ',作为单身/丁克结构,<strong>重疾 + 医疗 + 养老</strong>是核心三件套。' +
  9106. mainGapStrong + '缺口 ¥' + mainGap.val.toFixed(0) + ' 万,优先补齐。';
  9107. } else if (pid === 'entrepreneur') {
  9108. // 创业者
  9109. template = '您的保障完整度 ' + scoreStrong + ',作为创业者,<strong>个人担保 + 家庭隔离</strong>是核心。' +
  9110. '建议优先补 ' + mainGapStrong + '(¥' + mainGap.val.toFixed(0) + ' 万),用于覆盖经营贷个人连带责任风险。';
  9111. } else {
  9112. // 默认
  9113. template = '您的保障完整度 ' + scoreStrong + ',主要漏洞在 ' + mainGapStrong + '(¥' + mainGap.val.toFixed(0) + ' 万)。' +
  9114. '建议优先补齐这一险种,然后再考虑储蓄型 / 传承型升级。';
  9115. }
  9116. text.innerHTML = template;
  9117. }
  9118. </script>
  9119. <script id="fav-module-js">
  9120. /* [2026-07-12 移植自 FAV v0.1] 家族保单 + 生命周期 + 水位金字塔 · 数据源改接 IC 实时节点 */
  9121. (function(){
  9122. 'use strict';
  9123. const PYRAMID_SEGS = [
  9124. { pk:'wl', label:'终身寿险', rtier:'high', polygon:'240,70 317,205 163,205', grad:'favL1', labelX:240, labelY:150, pctY:190, yT:70, yB:205 },
  9125. { 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 },
  9126. { 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 },
  9127. { 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 },
  9128. { 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 },
  9129. { 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 },
  9130. { 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 }
  9131. ];
  9132. // 风险三分元数据(capsule 颜色呼应金字塔层色 · 从底到顶讲"先保命→再保钱→后传承")
  9133. const RTIER_META = {
  9134. base: { name:'基础层 · 损失性风险', short:'基础', desc:'保命 · 意外/医疗/重疾', c:'#D54E42', bg:'rgba(213,78,66,.08)', bd:'rgba(213,78,66,.35)' },
  9135. mid: { name:'中端层 · 支出性风险', short:'中端', desc:'保钱 · 定寿/教育/养老', c:'#C48A1E', bg:'rgba(196,138,30,.10)', bd:'rgba(196,138,30,.38)' },
  9136. high: { name:'高端层 · 传承隔离', short:'高端', desc:'传承 · 终身寿', c:'#7A3FA0', bg:'rgba(122,63,160,.09)', bd:'rgba(122,63,160,.35)' }
  9137. };
  9138. const PYRAMID_GRADS = [
  9139. { id:'favL1', light:'#9B61C2', main:'#7A3FA0', dark:'#4A1F70' },
  9140. { id:'favL2', light:'#6FC192', main:'#4FA672', dark:'#2D7044' },
  9141. { id:'favL3', light:'#F2D366', main:'#E5BB3D', dark:'#B58A21' },
  9142. { id:'favL4', light:'#F0A55B', main:'#E48A35', dark:'#B26420' },
  9143. { id:'favL5', light:'#E5746A', main:'#D54E42', dark:'#962C24' }
  9144. ];
  9145. const STAGE_META = {
  9146. accumulate:{ en:'Stage 1 · Protect & Accumulate', name:'保护与积累阶段', note:'覆盖家庭责任、收入中断、退休储备与生活品质' },
  9147. legacy:{ en:'Stage 2 · Retirement, Care & Legacy', name:'退休支持、长期护理及财富传承', note:'承接退休现金流、长寿与失能风险、财富传承与信托架构' }
  9148. };
  9149. function fmtWan(n){ return (n||0).toLocaleString('zh-CN'); }
  9150. 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; }
  9151. var WATER_ON = true;
  9152. function _g(id){ var el=document.getElementById(id); return el?(parseFloat(el.textContent.replace(/[^0-9.]/g,''))||0):0; }
  9153. function _v(id,d){ var el=document.getElementById(id); if(!el)return d||''; return el.value!==undefined?el.value:(el.textContent||'').trim(); }
  9154. function _n(id){ return parseFloat(_v(id))||0; }
  9155. function buildFAVFamilyFromIC(){
  9156. var surname = _v('surname')||'客户';
  9157. var age=_n('age'), gender=_v('gender'), marriage=_v('marriage');
  9158. var childCount=_n('childCount');
  9159. var childAges=[_n('childAge1'),_n('childAge2'),_n('childAge3')].filter(function(a){return a>0;});
  9160. var hasMed = _v('existingMed')==='1';
  9161. var SPEC=[
  9162. {pk:'acc', need:'意外险', stage:'accumulate', A:'accAmount', E:'accExisting'},
  9163. {pk:'med', need:'医疗险', stage:'accumulate', A:'medAmount', E:'medExisting'},
  9164. {pk:'ci', need:'重疾险', stage:'accumulate', A:'ciAmount', E:'ciExisting'},
  9165. {pk:'life', need:'定期寿险', stage:'accumulate', A:'lifeAmount', E:'lifeExisting'},
  9166. {pk:'edu', need:'教育年金', stage:'accumulate', A:'eduAmount', E:'eduExisting'},
  9167. {pk:'retire',need:'养老年金', stage:'legacy', A:'retireAmount',E:'retireExisting'},
  9168. {pk:'wl', need:'终身寿险', stage:'legacy', A:'wlAmount', E:'wlExisting'}
  9169. ];
  9170. var needs = SPEC.map(function(s){
  9171. var req=_g(s.A);
  9172. var cov = s.pk==='med' ? (hasMed?800:0) : _g(s.E);
  9173. return {need:s.need, pk:s.pk, stage:s.stage, req:req, cov:cov, ext:false};
  9174. });
  9175. var genderLabel = gender==='F'?'女':gender==='M'?'男':'';
  9176. var members=[{id:'avg',name:'家族总览',short:'家族总览',desc:'显示家庭全部保单记录'}];
  9177. members.push({id:'principal',name:surname+'(主理人'+(age?' '+age+'岁':'')+(genderLabel?' '+genderLabel:'')+')',short:'主理人',desc:'主理人为被保险人/投保人的保单'});
  9178. if(marriage==='married'){ members.push({id:'spouse',name:'配偶',short:'配偶',desc:'配偶相关保单'}); }
  9179. childAges.forEach(function(a,i){ members.push({id:'child'+(i+1),name:'子女'+(i+1)+'('+a+'岁)',short:'子女'+(i+1),desc:'未成年子女为受益人的保单'}); });
  9180. 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:'子女相关保单'}); } }
  9181. var lcMap={acc:'积累',med:'积累',ci:'积累',life:'积累',edu:'积累',retire:'传承',wl:'传承'};
  9182. var policies=[];
  9183. needs.forEach(function(n){
  9184. if(n.cov>0){
  9185. policies.push({member:'principal', mname:'主理人', type:n.need, insurer:'(现有保单)', cov:n.cov, insd:surname+'(主理人)', bene:'家庭成员', trust:false, lc:lcMap[n.pk]||'—'});
  9186. }
  9187. });
  9188. return { name:surname+'氏家庭', plan_kind:'legacy', needs:needs, members:members, policies:policies };
  9189. }
  9190. var _FAV = null;
  9191. var _CUR_MEMBER = 'avg';
  9192. function activeNeeds(fam){ return fam.plan_kind==='legacy' ? fam.needs : fam.needs.filter(function(n){return !n.ext;}); }
  9193. function gapRow(n, dotColor){
  9194. var gap=n.req-n.cov;
  9195. var pct=Math.min(100, n.req>0?Math.round(n.cov/n.req*100):0);
  9196. var ok=gap<=0;
  9197. var dot=dotColor?('<span class="dot-tier" style="background:'+dotColor+'"></span>'):'';
  9198. var extTag=n.ext?('<span class="tag tag-ext">'+(n.ext_label||'传承套')+'</span>'):'';
  9199. return '<div class="gap-row"><div class="gap-top">'+
  9200. '<span class="gap-name">'+dot+n.need+' '+extTag+'</span>'+
  9201. '<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>'+
  9202. '</div><div class="gap-bar"><div class="gap-fill" style="width:0%" data-w="'+pct+'"></div></div></div>';
  9203. }
  9204. 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); }); }
  9205. function buildPyramidSVG(needsByPk){
  9206. let defs = '';
  9207. PYRAMID_GRADS.forEach(g=>{
  9208. defs += `<linearGradient id="${g.id}" x1="0" y1="0" x2="0" y2="1">
  9209. <stop offset="0%" stop-color="${g.light}"/><stop offset="6%" stop-color="${g.main}"/><stop offset="100%" stop-color="${g.dark}"/>
  9210. </linearGradient>`;
  9211. // 底色渐变(水位 ON 时未注水部分的浅色"空槽")
  9212. defs += `<linearGradient id="${g.id}_bg" x1="0" y1="0" x2="0" y2="1">
  9213. <stop offset="0%" stop-color="${g.main}" stop-opacity="0.12"/><stop offset="100%" stop-color="${g.dark}" stop-opacity="0.22"/>
  9214. </linearGradient>`;
  9215. });
  9216. PYRAMID_SEGS.forEach(s=>{ defs += `<clipPath id="favClip_${s.pk}"><polygon points="${s.polygon}"/></clipPath>`; });
  9217. defs += `<filter id="favPyrShadow" x="-10%" y="-10%" width="120%" height="120%">
  9218. <feGaussianBlur in="SourceAlpha" stdDeviation="4"/><feOffset dx="0" dy="5"/>
  9219. <feComponentTransfer><feFuncA type="linear" slope="0.28"/></feComponentTransfer>
  9220. <feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge></filter>`;
  9221. // 单层水位矩形:ON=实际覆盖率涨水动画 · OFF=满色基线
  9222. const waterRect = (s, cov)=>{
  9223. const fillH = (s.yB - s.yT) * cov;
  9224. const waterY = s.yB - fillH;
  9225. if(!WATER_ON){
  9226. const fullH = s.yB - s.yT;
  9227. return `<rect x="0" y="${s.yT}" width="480" height="${fullH}" fill="url(#${s.grad})" clip-path="url(#favClip_${s.pk})"/>`;
  9228. }
  9229. if(fillH<=0) return '';
  9230. return `<rect x="0" y="${s.yB}" width="480" height="0" fill="url(#${s.grad})" clip-path="url(#favClip_${s.pk})">
  9231. <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"/>
  9232. <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"/>
  9233. </rect>`;
  9234. };
  9235. let layers = '<g filter="url(#favPyrShadow)">';
  9236. PYRAMID_SEGS.forEach(s=>{
  9237. const n = needsByPk[s.pk];
  9238. const cov = n ? Math.min(1, n.cov/n.req) : 0;
  9239. const pct = Math.round(cov*100);
  9240. const pctTxt = (n && n.cov>=n.req) ? '已覆盖' : pct+'%';
  9241. // 底槽(水位 ON 时才铺,作为"未注满"的浅色对照)
  9242. if(WATER_ON) layers += `<polygon points="${s.polygon}" fill="url(#${s.grad}_bg)" stroke="rgba(0,0,0,0.06)" stroke-width="0.6"/>`;
  9243. layers += waterRect(s, cov);
  9244. 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>`;
  9245. 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>`;
  9246. });
  9247. layers += '</g>';
  9248. return `<svg viewBox="0 0 480 440" class="fav-pyramid-svg"><defs>${defs}</defs>
  9249. <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>
  9250. ${layers}</svg>`;
  9251. }
  9252. function favRenderMemberPills(){
  9253. var fam=_FAV; var box=document.getElementById('favMemberPills'); if(!box)return;
  9254. box.innerHTML='<span class="label">查看成员:</span>'+fam.members.map(function(m){
  9255. return '<button class="m-pill'+(m.id===_CUR_MEMBER?' active':'')+'" onclick="window.favSwitchMember(\''+m.id+'\')">'+m.short+'</button>';
  9256. }).join('');
  9257. }
  9258. function favRenderPolicies(){
  9259. var fam=_FAV; var rows = _CUR_MEMBER==='avg'?fam.policies:fam.policies.filter(function(p){return p.member===_CUR_MEMBER;});
  9260. var body=document.getElementById('favPolicyBody'); if(!body)return;
  9261. if(!rows.length){ body.innerHTML='<tr><td colspan="7" style="text-align:center;color:var(--text-muted);padding:24px">该成员暂无保单记录</td></tr>'; return; }
  9262. body.innerHTML=rows.map(function(p){
  9263. 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>';
  9264. }).join('');
  9265. }
  9266. window.favSwitchMember=function(id){
  9267. _CUR_MEMBER=id; favRenderMemberPills(); favRenderPolicies();
  9268. var m=_FAV.members.find(function(x){return x.id===id;});
  9269. var d=document.getElementById('favMemberDesc'); if(d&&m) d.innerHTML='📋 当前查看:<b>'+m.name+'</b> · '+m.desc;
  9270. };
  9271. function favRenderLifecycle(){
  9272. var fam=_FAV; var needs=activeNeeds(fam);
  9273. var html=['accumulate','legacy'].map(function(sk){
  9274. var s=STAGE_META[sk];
  9275. var stageNeeds=needs.filter(function(n){return n.stage===sk;});
  9276. var body='<div class="gap-list">'+stageNeeds.map(function(n){return gapRow(n, pkColor(n.pk));}).join('')+'</div>';
  9277. 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>';
  9278. }).join('');
  9279. var box=document.getElementById('favLcBody'); if(box){ box.innerHTML='<div class="lc-track">'+html+'</div>'; animateGaps(); }
  9280. }
  9281. function favRenderPyramid(){
  9282. var fam=_FAV; var pyrNeeds=fam.needs.filter(function(n){return n.pk;});
  9283. var byPk={}; pyrNeeds.forEach(function(n){byPk[n.pk]=n;});
  9284. var rows=['high','mid','base'].map(function(rt){
  9285. var t=RTIER_META[rt];
  9286. var segsInTier=PYRAMID_SEGS.filter(function(s){return s.rtier===rt;});
  9287. var inner=segsInTier.map(function(s){var n=byPk[s.pk];return n?gapRow(n,pkColor(s.pk)):'';}).join('');
  9288. if(!inner)return '';
  9289. 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>';
  9290. }).join('');
  9291. var waterLabel=WATER_ON?'💧 水位·实际覆盖':'💧 水位·满色对照';
  9292. var box=document.getElementById('favPyrBody'); if(!box)return;
  9293. 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>';
  9294. animateGaps();
  9295. }
  9296. window.favToggleWater=function(){ WATER_ON=!WATER_ON; favRenderPyramid(); };
  9297. // [2026-07-12] 供 IC 现有金字塔三层行点击展开:返回某风险层(high/mid/base)各险种明细缺口条 HTML
  9298. window.favTierDetailHTML=function(rtier){
  9299. var fam = buildFAVFamilyFromIC();
  9300. var byPk={}; fam.needs.forEach(function(n){ if(n.pk) byPk[n.pk]=n; });
  9301. var segsInTier = PYRAMID_SEGS.filter(function(s){ return s.rtier===rtier; });
  9302. var inner = segsInTier.map(function(s){ var n=byPk[s.pk]; return n?gapRow(n, pkColor(s.pk)):''; }).join('');
  9303. return inner ? '<div class="gap-list">'+inner+'</div>' : '<div class="fav-note">该层暂无险种数据</div>';
  9304. };
  9305. window.favUpdateAll=function(){
  9306. _FAV = buildFAVFamilyFromIC();
  9307. _CUR_MEMBER='avg';
  9308. favRenderMemberPills(); favRenderPolicies(); favRenderLifecycle();
  9309. var d=document.getElementById('favMemberDesc'); if(d) d.innerHTML='📋 当前查看:<b>家族总览</b> · 显示家庭全部保单记录';
  9310. };
  9311. })();
  9312. </script>
  9313. <!-- [2026-07-12 移植] 三环解释弹窗 popover (脱离 #result, 不被 Tab 引擎抓取) -->
  9314. <div class="v01-ring-popover-overlay" id="v01RingPopover" onclick="v01ClosePopover(event)">
  9315. <div class="v01-ring-popover" onclick="event.stopPropagation()">
  9316. <button class="v01-pop-close" onclick="v01ClosePopover()">×</button>
  9317. <div class="v01-pop-icon" id="v01PopIcon">◆</div>
  9318. <div class="v01-pop-label" id="v01PopLabel">视角 · 维度</div>
  9319. <div class="v01-pop-title" id="v01PopTitle">维度名</div>
  9320. <div class="v01-pop-score-row">
  9321. <div class="v01-pop-score-num" id="v01PopScoreNum">—</div>
  9322. <div class="v01-pop-score-unit">/100</div>
  9323. <div class="v01-pop-score-status" id="v01PopScoreStatus"></div>
  9324. </div>
  9325. <div class="v01-pop-section">
  9326. <div class="v01-pop-section-label">📐 计算公式</div>
  9327. <div class="v01-pop-formula" id="v01PopFormula">—</div>
  9328. </div>
  9329. <div class="v01-pop-section">
  9330. <div class="v01-pop-section-label">💡 含义</div>
  9331. <div class="v01-pop-text" id="v01PopText">—</div>
  9332. </div>
  9333. <div class="v01-pop-actions">
  9334. <!-- [v0.1 + 2026-06-27] popup 内"📚 教学版 v4.7"按钮已删除 -->
  9335. <button class="v01-pop-action-btn" onclick="v01ClosePopover()">关闭</button>
  9336. </div>
  9337. </div>
  9338. </div>
  9339. </body>
  9340. </html>