prototype.html 187 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882
  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, viewport-fit=cover, interactive-widget=resizes-content" />
  6. <meta name="theme-color" media="(prefers-color-scheme: light)" content="#ffffff" />
  7. <meta name="theme-color" media="(prefers-color-scheme: dark)" content="#0d1117" />
  8. <title>浠艾福 · 页面重新设计 · 高保真原型</title>
  9. <style>
  10. /* =========================================================
  11. 浠艾福 Redesign — Design Tokens (v4.0)
  12. 方向:Calm Premium Wellness
  13. - 以白色/浅中性为底,五维色彩仅作强调色
  14. - 内联 SVG 图标取代 emoji
  15. - 克制的动效:ease-out 入场、spring 抽屉、reduced-motion 降级
  16. ========================================================= */
  17. :root {
  18. /* 品牌中性(暖色基底,呼应 flash 页) */
  19. --bg: #FFF7F1;
  20. --bg-soft: #FBEDE1;
  21. --surface: #FFFFFF;
  22. --surface-2: #FFFDFB;
  23. --ink: #3D2B1F;
  24. --ink-2: #7A6650;
  25. --ink-3: #B49A83;
  26. --line: #F2E7DA;
  27. --line-strong: #E8D9C7;
  28. /* 品牌主色(行动/关键按钮)——暖橙,沿用 flash 页 */
  29. --brand: #F97316;
  30. --brand-ink: #7C2D12;
  31. --brand-soft: #FFF1E6;
  32. /* 五维强调色(严格沿用 flash 页取值) */
  33. --dim-body: #FF8C42; /* 身 · 主动健康 */
  34. --dim-body-soft: #FFEAD9;
  35. --dim-mind: #FF6B9D; /* 心 · 大爱相随 */
  36. --dim-mind-soft: #FFE0EC;
  37. --dim-wisdom: #6366F1; /* 智 · 赋能未来 */
  38. --dim-wisdom-soft: #E9E9FE;
  39. --dim-action: #10B981; /* 行 · 人际和谐 */
  40. --dim-action-soft: #DEF7EF;
  41. --dim-wealth: #F59E0B; /* 富 · 利他创富 */
  42. --dim-wealth-soft: #FEF0D6;
  43. /* 语义 */
  44. --ok: #10B981;
  45. --warn: #F59E0B;
  46. --danger: #EF5350;
  47. /* 圆角 */
  48. --r-sm: 10px;
  49. --r-md: 16px;
  50. --r-lg: 22px;
  51. --r-xl: 28px;
  52. --r-pill: 999px;
  53. /* 阴影 —— 轻、暖 */
  54. --sh-1: 0 1px 2px rgba(124,45,18,0.04), 0 2px 8px rgba(124,45,18,0.05);
  55. --sh-2: 0 4px 16px rgba(124,45,18,0.07);
  56. --sh-3: 0 12px 40px rgba(124,45,18,0.12);
  57. --sh-brand: 0 6px 20px rgba(249,115,22,0.30);
  58. /* 动效 */
  59. --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  60. --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  61. --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  62. --t-fast: 160ms;
  63. --t-base: 240ms;
  64. --t-slow: 360ms;
  65. /* 字号基线(移动端 ≥14px 正文) */
  66. --fs-xs: 11px;
  67. --fs-sm: 12px;
  68. --fs-base: 14px;
  69. --fs-md: 15px;
  70. --fs-lg: 17px;
  71. --fs-xl: 20px;
  72. --fs-2xl: 26px;
  73. --fs-3xl: 32px;
  74. --tab-h: 64px;
  75. }
  76. * { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
  77. html { -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
  78. body {
  79. font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  80. background: #F3E9DD;
  81. color: var(--ink);
  82. -webkit-font-smoothing: antialiased;
  83. display: flex;
  84. align-items: center;
  85. justify-content: center;
  86. min-height: 100dvh;
  87. padding: 24px 16px;
  88. }
  89. button, [role="button"], .tap { touch-action: manipulation; user-select: none; -webkit-user-select: none; cursor: pointer; }
  90. input, textarea, select { font-size: 16px; font-family: inherit; }
  91. svg { display: block; }
  92. /* ===== 演示外壳(Preview Shell,非产品布局) ===== */
  93. .stage {
  94. width: 100%;
  95. max-width: 408px;
  96. background: var(--bg);
  97. border-radius: 44px;
  98. box-shadow: 0 30px 80px rgba(20,30,55,0.28);
  99. overflow: hidden;
  100. position: relative;
  101. height: min(880px, 92vh);
  102. display: flex;
  103. flex-direction: column;
  104. border: 10px solid #0E1320;
  105. }
  106. .notch {
  107. position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  108. width: 132px; height: 26px; background: #0E1320; border-radius: 0 0 16px 16px; z-index: 60;
  109. }
  110. .statusbar {
  111. height: 44px; flex: none; display: flex; align-items: center; justify-content: space-between;
  112. padding: 0 26px; font-size: 13px; font-weight: 600; color: var(--ink);
  113. padding-top: 8px;
  114. }
  115. .statusbar .sb-right { display: flex; align-items: center; gap: 6px; }
  116. /* ===== App 视图容器 ===== */
  117. .app { flex: 1; position: relative; overflow: hidden; display: flex; flex-direction: column; }
  118. .screen-scroll {
  119. flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  120. overscroll-behavior: contain; padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 16px);
  121. }
  122. .screen { display: none; animation: screenIn var(--t-base) var(--ease-out) both; }
  123. .screen.active { display: block; }
  124. @keyframes screenIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
  125. /* ===== 顶部栏(每页) ===== */
  126. .topbar {
  127. padding: calc(env(safe-area-inset-top, 0px) + 6px) 18px 10px;
  128. display: flex; align-items: center; justify-content: space-between; gap: 12px;
  129. background: var(--surface);
  130. position: sticky; top: 0; z-index: 20;
  131. border-bottom: 1px solid var(--line);
  132. }
  133. .topbar .tb-left { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  134. .tb-greet { font-size: var(--fs-sm); color: var(--ink-3); display: flex; align-items: center; gap: 5px; }
  135. .tb-title { font-size: var(--fs-xl); font-weight: 700; letter-spacing: 0.2px; }
  136. .tb-right { display: flex; align-items: center; gap: 10px; }
  137. .icon-btn {
  138. width: 38px; height: 38px; border-radius: 50%; background: var(--bg-soft);
  139. display: flex; align-items: center; justify-content: center; color: var(--ink-2);
  140. position: relative; transition: transform var(--t-fast) var(--ease-out), background var(--t-fast);
  141. }
  142. .icon-btn:active { transform: scale(0.92); background: var(--line); }
  143. .icon-btn .badge {
  144. position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%;
  145. background: var(--danger); border: 2px solid var(--surface);
  146. }
  147. /* 成员切换 chips */
  148. .member-switch { display: flex; gap: 6px; align-items: center; }
  149. .mchip {
  150. display: flex; align-items: center; gap: 6px; padding: 5px 10px 5px 5px; border-radius: var(--r-pill);
  151. background: var(--bg-soft); border: 1.5px solid transparent; transition: all var(--t-fast) var(--ease-out);
  152. }
  153. .mchip.on { background: var(--brand-soft); border-color: var(--brand); }
  154. .mchip:active { transform: scale(0.95); }
  155. .mchip .ava { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 700; }
  156. .mchip .nm { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }
  157. /* ===== 通用卡片/区块 ===== */
  158. .pad { padding: 0 16px; }
  159. .section { margin-top: 16px; }
  160. .sec-head { display: flex; align-items: center; justify-content: space-between; padding: 0 16px; margin-bottom: 10px; }
  161. .sec-title { font-size: var(--fs-md); font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 6px; }
  162. .sec-more { font-size: var(--fs-sm); color: var(--brand); font-weight: 600; }
  163. .card {
  164. background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-1);
  165. padding: 16px; margin: 0 16px 14px;
  166. }
  167. .card.flush { margin: 0 0 0 0; border-radius: 0; box-shadow: none; background: transparent; padding: 0; }
  168. /* ===== 能量英雄模块(首页签名 · 暖桃橙,呼应 flash 页) ===== */
  169. .energy-hero {
  170. margin: 14px 16px 0; background: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 55%, #FED7AA 100%);
  171. border-radius: var(--r-xl); padding: 18px; color: #7C2D12; position: relative; overflow: hidden;
  172. box-shadow: var(--sh-2);
  173. }
  174. .energy-hero::after {
  175. content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px;
  176. background: radial-gradient(circle, rgba(249,115,22,0.30), transparent 70%); border-radius: 50%;
  177. }
  178. .eh-top { display: flex; justify-content: space-between; align-items: flex-start; }
  179. .eh-label { font-size: var(--fs-sm); color: rgba(124,45,18,0.6); }
  180. .eh-score { font-size: var(--fs-3xl); font-weight: 800; line-height: 1; margin-top: 2px; color: #7C2D12; }
  181. .eh-score small { font-size: var(--fs-base); font-weight: 600; color: rgba(124,45,18,0.55); margin-left: 4px; }
  182. .eh-sub { font-size: var(--fs-xs); color: rgba(124,45,18,0.5); margin-top: 6px; }
  183. .eh-link { font-size: var(--fs-sm); color: #7C2D12; background: rgba(124,45,18,0.10); padding: 6px 12px; border-radius: var(--r-pill); font-weight: 600; transition: transform var(--t-fast) var(--ease-out); }
  184. .eh-link:active { transform: scale(0.95); }
  185. .ring-wrap { display: flex; align-items: center; gap: 16px; margin-top: 14px; }
  186. .ring { width: 132px; height: 132px; flex: none; position: relative; }
  187. .ring .ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
  188. .ring .rc-val { font-size: var(--fs-2xl); font-weight: 800; color: #7C2D12; }
  189. .ring .rc-lab { font-size: var(--fs-xs); color: rgba(124,45,18,0.6); }
  190. .dim-bars { flex: 1; display: flex; flex-direction: column; gap: 9px; }
  191. .dbar { display: flex; align-items: center; gap: 8px; }
  192. .dbar .dl { font-size: var(--fs-xs); width: 30px; color: rgba(124,45,18,0.8); flex: none; }
  193. .dbar .dt { flex: 1; height: 7px; background: rgba(124,45,18,0.12); border-radius: var(--r-pill); overflow: hidden; }
  194. .dbar .df { height: 100%; border-radius: var(--r-pill); transition: width var(--t-slow) var(--ease-out); }
  195. .dbar .dv { font-size: var(--fs-xs); width: 22px; text-align: right; color: #7C2D12; font-weight: 600; }
  196. /* ===== Next Best Action ===== */
  197. .nba {
  198. margin: 14px 16px 0; border-radius: var(--r-lg); padding: 14px 16px; display: flex; align-items: center; gap: 13px;
  199. background: var(--surface); box-shadow: var(--sh-1); position: relative; overflow: hidden;
  200. border-left: 4px solid var(--brand);
  201. }
  202. .nba:active { transform: scale(0.99); }
  203. .nba .nba-ic { width: 42px; height: 42px; border-radius: 13px; display: flex; align-items: center; justify-content: center; flex: none; }
  204. .nba .nba-info { flex: 1; min-width: 0; }
  205. .nba .nba-t { font-size: var(--fs-md); font-weight: 700; }
  206. .nba .nba-s { font-size: var(--fs-sm); color: var(--ink-2); margin-top: 2px; }
  207. .nba .nba-go { font-size: var(--fs-sm); font-weight: 700; color: var(--brand); flex: none; }
  208. /* ===== 任务行 / 挑战 ===== */
  209. .row {
  210. display: flex; align-items: center; gap: 12px; padding: 13px 0;
  211. }
  212. .row + .row { border-top: 1px solid var(--line); }
  213. .row .rk { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex: none; }
  214. .row .ri { flex: 1; min-width: 0; }
  215. .row .rt { font-size: var(--fs-base); font-weight: 600; }
  216. .row .rm { font-size: var(--fs-sm); color: var(--ink-3); margin-top: 2px; }
  217. .pill-btn {
  218. flex: none; padding: 7px 14px; border-radius: var(--r-pill); background: var(--brand); color: #fff;
  219. font-size: var(--fs-sm); font-weight: 700; border: none; transition: transform var(--t-fast) var(--ease-out), opacity var(--t-fast);
  220. }
  221. .pill-btn:active { transform: scale(0.94); }
  222. .pill-btn.done { background: var(--dim-action-soft); color: var(--ok); }
  223. /* 家庭动态 */
  224. .feed-item { display: flex; gap: 11px; padding: 11px 0; align-items: flex-start; }
  225. .feed-item + .feed-item { border-top: 1px solid var(--line); }
  226. .feed-dot { width: 30px; height: 30px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; background: var(--bg-soft); }
  227. .feed-item .fi-t { font-size: var(--fs-base); color: var(--ink); line-height: 1.4; }
  228. .feed-item .fi-t b { font-weight: 700; }
  229. .feed-item .fi-time { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 3px; }
  230. /* 推荐横滑 */
  231. .hscroll { display: flex; gap: 12px; overflow-x: auto; padding: 2px 16px 4px; overscroll-behavior: contain; scrollbar-width: none; }
  232. .hscroll::-webkit-scrollbar { display: none; }
  233. .rec-card { flex: none; width: 168px; background: var(--surface); border-radius: var(--r-md); box-shadow: var(--sh-1); overflow: hidden; }
  234. .rec-card:active { transform: scale(0.98); }
  235. .rec-cover { height: 96px; }
  236. .rec-body { padding: 10px; }
  237. .rec-cat { font-size: var(--fs-xs); font-weight: 700; padding: 2px 7px; border-radius: var(--r-pill); display: inline-block; }
  238. .rec-tt { font-size: var(--fs-base); font-weight: 600; margin-top: 7px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  239. .rec-meta { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 6px; }
  240. /* ===== TabBar(自定义) ===== */
  241. .tabbar {
  242. position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
  243. background: rgba(255,255,255,0.92); backdrop-filter: saturate(1.4) blur(14px);
  244. border-top: 1px solid var(--line); display: flex; align-items: stretch; z-index: 40;
  245. padding-bottom: env(safe-area-inset-bottom, 0px);
  246. }
  247. .tab {
  248. flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  249. color: var(--ink-3); transition: color var(--t-fast); position: relative;
  250. }
  251. .tab .t-ic { transition: transform var(--t-fast) var(--ease-out); }
  252. .tab.on { color: var(--brand); }
  253. .tab.on .t-ic { transform: translateY(-1px); }
  254. .tab .t-tx { font-size: 10.5px; font-weight: 600; }
  255. .tab-center {
  256. flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; position: relative;
  257. }
  258. .tab-center .c-btn {
  259. width: 52px; height: 52px; border-radius: 50%; margin-top: -22px; background: linear-gradient(135deg, #FF8C42, #FF6B9D);
  260. display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: var(--sh-brand);
  261. transition: transform var(--t-fast) var(--ease-out);
  262. }
  263. .tab-center:active .c-btn { transform: scale(0.9) rotate(-8deg); }
  264. .tab-center .c-tx { font-size: 10px; font-weight: 700; color: var(--brand); }
  265. /* ===== 五维 底部抽屉 ===== */
  266. .sheet-mask { position: absolute; inset: 0; background: rgba(16,22,38,0.42); opacity: 0; visibility: hidden; transition: opacity var(--t-base) var(--ease-out), visibility var(--t-base); z-index: 50; }
  267. .sheet-mask.show { opacity: 1; visibility: visible; }
  268. .sheet {
  269. position: absolute; left: 0; right: 0; bottom: 0; z-index: 55; background: var(--surface);
  270. border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 10px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  271. transform: translateY(100%); transition: transform var(--t-slow) var(--ease-drawer);
  272. box-shadow: var(--sh-3); max-height: 82%; overflow-y: auto; overscroll-behavior: contain;
  273. }
  274. .sheet.show { transform: translateY(0); }
  275. .sheet-grip { width: 38px; height: 4px; background: var(--line-strong); border-radius: 4px; margin: 4px auto 14px; }
  276. .sheet-title { font-size: var(--fs-xl); font-weight: 800; text-align: center; }
  277. .sheet-sub { text-align: center; font-size: var(--fs-sm); color: var(--ink-3); margin-top: 4px; margin-bottom: 16px; }
  278. .dim-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  279. .dim-tile {
  280. border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 8px;
  281. border: 1.5px solid transparent; transition: transform var(--t-fast) var(--ease-out), border-color var(--t-fast);
  282. }
  283. .dim-tile:active { transform: scale(0.97); border-color: var(--line-strong); }
  284. .dim-tile .dt-ic { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #fff; }
  285. .dim-tile .dt-nm { font-size: var(--fs-md); font-weight: 700; }
  286. .dim-tile .dt-ds { font-size: var(--fs-xs); color: var(--ink-2); line-height: 1.4; }
  287. .dim-tile .dt-sc { font-size: var(--fs-sm); font-weight: 700; margin-top: 2px; }
  288. .dim-tile .dt-track { height: 6px; background: var(--bg-soft); border-radius: var(--r-pill); overflow: hidden; }
  289. .dim-tile .dt-fill { height: 100%; border-radius: var(--r-pill); }
  290. /* ===== 健康页 ===== */
  291. .seg { display: flex; gap: 6px; padding: 4px; background: var(--bg-soft); border-radius: var(--r-pill); margin: 14px 16px 0; }
  292. .seg .sg { flex: 1; text-align: center; padding: 9px 0; border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); transition: all var(--t-fast) var(--ease-out); }
  293. .seg .sg.on { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }
  294. .radar-card { margin: 14px 16px 0; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 16px; text-align: center; }
  295. .radar-card svg { margin: 0 auto; }
  296. .data-row { display: flex; gap: 12px; margin: 14px 16px 0; }
  297. .data-col { flex: 1; background: var(--surface); border-radius: var(--r-md); box-shadow: var(--sh-1); padding: 14px; }
  298. .data-col .dc-t { font-size: var(--fs-base); font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
  299. /* ===== 成长页 ===== */
  300. .ms-card { margin: 14px 16px 0; background: linear-gradient(135deg, #FFFFFF, #FFF6EE); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 16px; }
  301. .ms-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
  302. .ms-it { background: var(--surface); border-radius: var(--r-md); padding: 14px 8px; text-align: center; box-shadow: var(--sh-1); }
  303. .ms-it .mv { font-size: var(--fs-xl); font-weight: 800; }
  304. .ms-it .ml { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 3px; }
  305. .today-prog { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  306. .tp-item { background: var(--surface); border-radius: var(--r-md); padding: 13px; box-shadow: var(--sh-1); display: flex; align-items: center; gap: 10px; transition: transform var(--t-fast) var(--ease-out); }
  307. .tp-item:active { transform: scale(0.97); }
  308. .tp-item .tp-ic { width: 36px; height: 36px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex: none; }
  309. .tp-item .tp-l { font-size: var(--fs-sm); font-weight: 600; }
  310. .tp-item .tp-st { font-size: var(--fs-xs); margin-top: 2px; font-weight: 600; }
  311. .tp-st.pend { color: var(--brand); }
  312. .tp-st.done { color: var(--ok); }
  313. /* ===== 我的页 ===== */
  314. .id-card { margin: 14px 16px 0; background: linear-gradient(135deg, #FF8C42, #FF6B9D); border-radius: var(--r-xl); padding: 18px; color: #fff; display: flex; align-items: center; gap: 14px; box-shadow: var(--sh-2); }
  315. .id-ava { width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,0.18); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 800; flex: none; border: 2px solid rgba(255,255,255,0.35); }
  316. .id-meta { flex: 1; min-width: 0; }
  317. .id-nm { font-size: var(--fs-xl); font-weight: 800; display: flex; align-items: center; gap: 8px; }
  318. .id-lv { font-size: var(--fs-xs); font-weight: 700; background: rgba(255,255,255,0.2); padding: 2px 8px; border-radius: var(--r-pill); }
  319. .id-sub { font-size: var(--fs-sm); color: rgba(255,255,255,0.75); margin-top: 5px; }
  320. .id-pts { text-align: right; flex: none; }
  321. .id-pts .pv { font-size: var(--fs-xl); font-weight: 800; }
  322. .id-pts .pl { font-size: var(--fs-xs); color: rgba(255,255,255,0.7); }
  323. .ach-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
  324. .ach { background: var(--surface); border-radius: var(--r-md); padding: 14px 6px; text-align: center; box-shadow: var(--sh-1); transition: transform var(--t-fast) var(--ease-out); }
  325. .ach:active { transform: scale(0.96); }
  326. .ach .ai { width: 38px; height: 38px; border-radius: 12px; margin: 0 auto 8px; display: flex; align-items: center; justify-content: center; }
  327. .ach .av { font-size: var(--fs-md); font-weight: 800; }
  328. .ach .al { font-size: 10px; color: var(--ink-3); margin-top: 2px; }
  329. .menu-list { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden; }
  330. .menu-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; transition: background var(--t-fast); }
  331. .menu-row:active { background: var(--bg-soft); }
  332. .menu-row + .menu-row { border-top: 1px solid var(--line); }
  333. .menu-row .mr-ic { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex: none; }
  334. .menu-row .mr-tx { flex: 1; font-size: var(--fs-base); font-weight: 600; }
  335. .menu-row .mr-ar { color: var(--ink-3); }
  336. /* 家庭成员条 */
  337. .fam-strip { display: flex; gap: 14px; overflow-x: auto; padding: 2px 16px 6px; overscroll-behavior: contain; scrollbar-width: none; }
  338. .fam-strip::-webkit-scrollbar { display: none; }
  339. .fam-it { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: none; }
  340. .fam-av { width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px; font-weight: 700; position: relative; }
  341. .fam-av.add { background: var(--bg-soft); color: var(--ink-3); border: 1.5px dashed var(--line-strong); }
  342. .fam-tag { position: absolute; bottom: -2px; right: -2px; font-size: 8px; font-weight: 700; color: #fff; border-radius: var(--r-pill); padding: 1px 5px; }
  343. .fam-nm { font-size: var(--fs-xs); color: var(--ink-2); font-weight: 600; }
  344. /* ===== 登录页 ===== */
  345. .login { flex: 1; display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top,0px) + 50px) 28px 28px; }
  346. .login .lg-logo { width: 76px; height: 76px; border-radius: 22px; background: linear-gradient(135deg, #FF8C42, #FF6B9D); display: flex; align-items: center; justify-content: center; color: #fff; margin-bottom: 22px; box-shadow: var(--sh-brand); }
  347. .login .lg-h { font-size: var(--fs-3xl); font-weight: 800; letter-spacing: 1px; }
  348. .login .lg-s { font-size: var(--fs-md); color: var(--ink-2); margin-top: 8px; line-height: 1.5; }
  349. .login .lg-fields { margin-top: 32px; display: flex; flex-direction: column; gap: 12px; }
  350. .field { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; display: flex; align-items: center; gap: 10px; transition: border-color var(--t-fast); }
  351. .field:focus-within { border-color: var(--brand); }
  352. .field input { flex: 1; border: none; outline: none; background: transparent; color: var(--ink); font-size: var(--fs-base); }
  353. .field .fc-ic { color: var(--ink-3); flex: none; }
  354. .lg-btn { margin-top: 22px; background: var(--brand); color: #fff; border: none; border-radius: var(--r-md); padding: 16px; font-size: var(--fs-lg); font-weight: 700; box-shadow: var(--sh-brand); transition: transform var(--t-fast) var(--ease-out); }
  355. .lg-btn:active { transform: scale(0.98); }
  356. .lg-alt { margin-top: 16px; text-align: center; font-size: var(--fs-sm); color: var(--ink-3); }
  357. .lg-alt b { color: var(--brand); font-weight: 700; }
  358. .lg-terms { margin-top: auto; text-align: center; font-size: var(--fs-xs); color: var(--ink-3); line-height: 1.6; padding-bottom: 10px; }
  359. /* ===== 状态:骨架 / 空 / 错误 ===== */
  360. .skeleton { background: linear-gradient(90deg, #F6E7D7 25%, #FCEFDF 50%, #F6E7D7 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
  361. @keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
  362. .empty-state { text-align: center; padding: 48px 24px; }
  363. .empty-state .es-ic { width: 72px; height: 72px; border-radius: 50%; background: var(--bg-soft); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; color: var(--ink-3); }
  364. .empty-state .es-t { font-size: var(--fs-md); font-weight: 700; }
  365. .empty-state .es-s { font-size: var(--fs-sm); color: var(--ink-3); margin-top: 6px; line-height: 1.5; }
  366. .empty-state .es-btn { margin-top: 18px; display: inline-block; background: var(--brand); color: #fff; padding: 11px 22px; border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 700; }
  367. /* Toast */
  368. .toast { position: absolute; left: 50%; bottom: calc(var(--tab-h) + 24px); transform: translate(-50%, 20px); background: #1A2133; color: #fff; font-size: var(--fs-sm); font-weight: 600; padding: 11px 18px; border-radius: var(--r-pill); opacity: 0; pointer-events: none; transition: transform var(--t-base) var(--ease-out), opacity var(--t-base); z-index: 70; box-shadow: var(--sh-3); max-width: 80%; text-align: center; }
  369. .toast.show { opacity: 1; transform: translate(-50%, 0); }
  370. /* 演示切换条 */
  371. .demo-bar { position: fixed; top: 16px; right: 16px; z-index: 200; background: #1A2133; border-radius: var(--r-pill); padding: 6px; display: flex; gap: 4px; box-shadow: var(--sh-3); }
  372. .demo-bar button { border: none; background: transparent; color: #fff; font-size: var(--fs-xs); font-weight: 700; padding: 8px 14px; border-radius: var(--r-pill); opacity: 0.6; }
  373. .demo-bar button.on { background: var(--brand); opacity: 1; }
  374. /* 入场 stagger */
  375. .stagger > * { opacity: 0; transform: translateY(8px); animation: itemIn var(--t-base) var(--ease-out) forwards; }
  376. .stagger > *:nth-child(1) { animation-delay: 20ms; }
  377. .stagger > *:nth-child(2) { animation-delay: 60ms; }
  378. .stagger > *:nth-child(3) { animation-delay: 100ms; }
  379. .stagger > *:nth-child(4) { animation-delay: 140ms; }
  380. .stagger > *:nth-child(5) { animation-delay: 180ms; }
  381. .stagger > *:nth-child(6) { animation-delay: 220ms; }
  382. @keyframes itemIn { to { opacity: 1; transform: translateY(0); } }
  383. /* ===== 闪屏(还原原 flash 页暖色基因) ===== */
  384. #splash {
  385. position: absolute; inset: 0; z-index: 9999;
  386. display: flex; align-items: center; justify-content: center;
  387. background: linear-gradient(160deg, #FFF7ED 0%, #FFEDD5 50%, #FED7AA 100%);
  388. overflow: hidden;
  389. transition: opacity .5s var(--ease-out), visibility .5s var(--ease-out);
  390. }
  391. #splash.hide { opacity: 0; visibility: hidden; }
  392. .sp-bg { position: absolute; inset: 0; pointer-events: none; }
  393. .sp-c { position: absolute; border-radius: 50%; opacity: .12; }
  394. .sp-c1 { width: 200px; height: 200px; background: #FF8C42; top: -50px; right: -40px; animation: sp-float1 4s ease-in-out infinite; }
  395. .sp-c2 { width: 140px; height: 140px; background: #FF6B9D; bottom: 40px; left: -30px; animation: sp-float2 5s ease-in-out infinite; }
  396. .sp-c3 { width: 90px; height: 90px; background: #6366F1; top: 50%; right: -20px; animation: sp-float3 6s ease-in-out infinite; }
  397. @keyframes sp-float1 { 0%,100%{transform:translateY(0) scale(1)} 50%{transform:translateY(-15px) scale(1.05)} }
  398. @keyframes sp-float2 { 0%,100%{transform:translateY(0) scale(1)} 50%{transform:translateY(10px) scale(1.08)} }
  399. @keyframes sp-float3 { 0%,100%{transform:translateY(0) rotate(0)} 50%{transform:translateY(-10px) rotate(10deg)} }
  400. .sp-body { display: flex; flex-direction: column; align-items: center; animation: sp-body-in .8s cubic-bezier(.16,1,.3,1) both; padding: 0 24px; }
  401. @keyframes sp-body-in { from { opacity:0; transform: translateY(20px) scale(.96);} to {opacity:1; transform: none;} }
  402. .sp-logo { width: 80px; height: 80px; border-radius: 20px; background: rgba(255,255,255,.95); display:flex; align-items:center; justify-content:center; color:#F97316; margin-bottom: 14px; box-shadow: 0 8px 32px rgba(249,115,22,.25); animation: sp-pulse 2.5s ease-in-out infinite; }
  403. @keyframes sp-pulse { 0%,100%{box-shadow:0 8px 32px rgba(249,115,22,.25)} 50%{box-shadow:0 8px 48px rgba(249,115,22,.45)} }
  404. .sp-name { font-size: 32px; font-weight: 800; color: #7C2D12; letter-spacing: 5px; }
  405. .sp-en { font-size: 11px; color: rgba(124,45,18,.5); letter-spacing: 3px; margin-top: 2px; }
  406. .sp-id { font-size: 14px; font-weight: 600; color: rgba(124,45,18,.85); letter-spacing: 1px; margin-top: 16px; text-align: center; line-height: 1.5; }
  407. .sp-dims { display: flex; flex-direction: row; gap: 14px; margin-top: 18px; }
  408. .sp-dim { display:flex; flex-direction:column; align-items:center; gap:6px; animation: sp-dim-in .5s ease both; }
  409. .sp-dc { width: 40px; height: 40px; border-radius: 50%; display:flex; align-items:center; justify-content:center; color:#fff; font-size:18px; font-weight:700; box-shadow: 0 4px 12px rgba(124,45,18,.12); }
  410. .sp-dim:nth-child(1){animation-delay:.1s} .sp-dim:nth-child(2){animation-delay:.2s} .sp-dim:nth-child(3){animation-delay:.3s} .sp-dim:nth-child(4){animation-delay:.4s} .sp-dim:nth-child(5){animation-delay:.5s}
  411. @keyframes sp-dim-in { from{opacity:0; transform:translateY(8px) scale(.8)} to{opacity:1; transform:none} }
  412. .sp-tag { font-size: 13px; color: rgba(124,45,18,.7); letter-spacing: 2px; margin-top: 16px; text-align:center; }
  413. .sp-dots { position:absolute; bottom: 70px; left:0; right:0; display:flex; justify-content:center; gap:6px; }
  414. .sp-dots span { width: 7px; height: 7px; border-radius:50%; background: rgba(249,115,22,.6); animation: sp-dot 1.4s ease-in-out infinite both; }
  415. .sp-dots span:nth-child(1){animation-delay:-.32s} .sp-dots span:nth-child(2){animation-delay:-.16s} .sp-dots span:nth-child(3){animation-delay:0s}
  416. @keyframes sp-dot { 0%,80%,100%{transform:scale(.6);opacity:.4} 40%{transform:scale(1);opacity:1} }
  417. .sp-enter { position:absolute; bottom: 34px; left:0; right:0; text-align:center; font-size:12px; color: rgba(124,45,18,.5); letter-spacing:2px; }
  418. /* ===== 通用:Task 页返回栏(隐藏 TabBar 的二级页) ===== */
  419. .nav-bar {
  420. padding: calc(env(safe-area-inset-top, 0px) + 6px) 12px 10px;
  421. display: flex; align-items: center; gap: 10px;
  422. background: var(--surface); position: sticky; top: 0; z-index: 20;
  423. border-bottom: 1px solid var(--line);
  424. }
  425. .nav-bar .nb-back { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--ink); background: var(--bg-soft); flex: none; transition: transform var(--t-fast) var(--ease-out); }
  426. .nav-bar .nb-back:active { transform: scale(0.9); }
  427. .nav-bar .nb-t { font-size: var(--fs-lg); font-weight: 800; flex: 1; min-width: 0; }
  428. .nav-bar .nb-a { font-size: var(--fs-sm); color: var(--brand); font-weight: 600; flex: none; }
  429. /* ===== 五维能量总览(深读 · 全屏) ===== */
  430. .ov-hero {
  431. margin: 14px 16px 0; padding: 18px; border-radius: var(--r-xl); position: relative; overflow: hidden;
  432. background: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 55%, #FED7AA 100%);
  433. box-shadow: var(--sh-2);
  434. }
  435. .ov-hero::after {
  436. content: ""; position: absolute; left: -30px; bottom: -50px; width: 150px; height: 150px; border-radius: 50%;
  437. background: radial-gradient(circle, rgba(255,107,157,0.28), transparent 70%);
  438. }
  439. .ov-score { display: flex; align-items: flex-end; gap: 10px; position: relative; }
  440. .ov-score .os-n { font-size: 44px; font-weight: 800; line-height: 1; color: #7C2D12; }
  441. .ov-score .os-u { font-size: var(--fs-sm); color: rgba(124,45,18,0.6); padding-bottom: 5px; }
  442. .ov-delta { margin-left: auto; font-size: var(--fs-sm); font-weight: 700; color: var(--ok); background: rgba(16,185,129,0.14); padding: 4px 10px; border-radius: var(--r-pill); }
  443. .ov-delta.down { color: var(--danger); background: rgba(239,83,80,0.12); }
  444. .ov-cap { font-size: var(--fs-sm); color: rgba(124,45,18,0.65); margin-top: 6px; position: relative; }
  445. .ov-radar { display: flex; justify-content: center; padding: 18px 0 6px; position: relative; }
  446. .ov-legend { display: flex; flex-wrap: wrap; gap: 10px 14px; justify-content: center; margin-top: 10px; position: relative; }
  447. .ov-lg { display: flex; align-items: center; gap: 5px; font-size: var(--fs-xs); color: rgba(124,45,18,0.75); font-weight: 600; }
  448. .ov-lg i { width: 8px; height: 8px; border-radius: 2px; display: block; }
  449. /* 趋势折线 */
  450. .trend-card { margin: 14px 16px 0; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 16px; }
  451. .trend-tabs { display: flex; gap: 6px; background: var(--bg-soft); padding: 3px; border-radius: var(--r-pill); margin-bottom: 14px; }
  452. .trend-tabs .tt { flex: 1; text-align: center; padding: 7px 0; border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); transition: all var(--t-fast) var(--ease-out); }
  453. .trend-tabs .tt.on { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }
  454. .trend-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
  455. .trend-legend .tl { display: flex; align-items: center; gap: 5px; font-size: var(--fs-xs); color: var(--ink-2); font-weight: 600; }
  456. .trend-legend .tl i { width: 14px; height: 3px; border-radius: 2px; display: block; }
  457. /* 家人对比 */
  458. .cmp-list { display: flex; flex-direction: column; }
  459. .cmp-row { display: flex; align-items: center; gap: 11px; padding: 11px 0; }
  460. .cmp-row + .cmp-row { border-top: 1px solid var(--line); }
  461. .cmp-av { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: var(--fs-sm); font-weight: 700; flex: none; }
  462. .cmp-info { flex: 1; min-width: 0; }
  463. .cmp-nm { display: flex; align-items: baseline; gap: 6px; }
  464. .cmp-nm .cn { font-size: var(--fs-base); font-weight: 600; }
  465. .cmp-nm .cr { font-size: var(--fs-xs); color: var(--ink-3); }
  466. .cmp-bar { height: 7px; background: var(--bg-soft); border-radius: var(--r-pill); margin-top: 6px; overflow: hidden; }
  467. .cmp-bar .cf { height: 100%; border-radius: var(--r-pill); transition: width var(--t-slow) var(--ease-out); }
  468. .cmp-sc { font-size: var(--fs-md); font-weight: 800; flex: none; width: 34px; text-align: right; }
  469. /* 建议卡 */
  470. .adv-card { display: flex; gap: 11px; padding: 13px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--sh-1); transition: transform var(--t-fast) var(--ease-out); }
  471. .adv-card:active { transform: scale(0.98); }
  472. .adv-card + .adv-card { margin-top: 10px; }
  473. .adv-ic { width: 36px; height: 36px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex: none; }
  474. .adv-tx { flex: 1; min-width: 0; }
  475. .adv-t { font-size: var(--fs-base); font-weight: 600; }
  476. .adv-s { font-size: var(--fs-sm); color: var(--ink-2); margin-top: 3px; line-height: 1.45; }
  477. .adv-pri { font-size: var(--fs-xs); font-weight: 700; padding: 2px 7px; border-radius: var(--r-pill); flex: none; align-self: flex-start; }
  478. /* ===== 维度详情(Task 页) ===== */
  479. .dim-hero { margin: 14px 16px 0; border-radius: var(--r-xl); padding: 18px; position: relative; overflow: hidden; box-shadow: var(--sh-2); }
  480. .dim-hero .dh-top { display: flex; align-items: center; gap: 12px; position: relative; }
  481. .dim-hero .dh-ic { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; color: #fff; flex: none; }
  482. .dim-hero .dh-nm { font-size: var(--fs-xl); font-weight: 800; }
  483. .dim-hero .dh-ds { font-size: var(--fs-sm); opacity: 0.8; margin-top: 2px; }
  484. .dim-hero .dh-sc { margin-left: auto; text-align: right; }
  485. .dim-hero .dh-sc .n { font-size: var(--fs-2xl); font-weight: 800; line-height: 1; }
  486. .dim-hero .dh-sc .l { font-size: var(--fs-xs); opacity: 0.75; margin-top: 2px; }
  487. .sub-score { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 16px; position: relative; }
  488. .sub-score .ss { background: rgba(255,255,255,0.55); border-radius: var(--r-md); padding: 11px 12px; }
  489. .sub-score .ss .sl { font-size: var(--fs-xs); opacity: 0.78; font-weight: 600; }
  490. .sub-score .ss .sv { font-size: var(--fs-lg); font-weight: 800; margin-top: 3px; }
  491. .sub-score .ss .sv small { font-size: var(--fs-xs); font-weight: 600; opacity: 0.7; margin-left: 2px; }
  492. .metric-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
  493. .metric-row + .metric-row { border-top: 1px solid var(--line); }
  494. .metric-row .mi { flex: 1; min-width: 0; }
  495. .metric-row .mn { font-size: var(--fs-base); font-weight: 600; display: flex; align-items: center; gap: 6px; }
  496. .metric-row .mv { font-size: var(--fs-md); font-weight: 800; flex: none; }
  497. .metric-row .mr { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 2px; }
  498. .tag-ref { font-size: var(--fs-xs); font-weight: 700; padding: 2px 7px; border-radius: var(--r-pill); flex: none; }
  499. .tag-ref.hi { background: rgba(239,83,80,0.12); color: var(--danger); }
  500. .tag-ref.mid { background: rgba(245,158,11,0.14); color: #B45309; }
  501. .tag-ref.ok { background: var(--dim-action-soft); color: var(--ok); }
  502. /* ===== 报告上传流程 ===== */
  503. .up-steps { display: flex; align-items: center; gap: 6px; padding: 16px 18px 6px; }
  504. .up-step { display: flex; align-items: center; gap: 6px; flex: none; }
  505. .up-step .us-n { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; background: var(--bg-soft); color: var(--ink-3); flex: none; }
  506. .up-step .us-t { font-size: var(--fs-xs); color: var(--ink-3); font-weight: 600; }
  507. .up-step.on .us-n { background: var(--brand); color: #fff; }
  508. .up-step.on .us-t { color: var(--brand-ink); }
  509. .up-step.done .us-n { background: var(--dim-action); color: #fff; }
  510. .up-step.done .us-t { color: var(--ink-2); }
  511. .up-step-line { flex: 1; height: 2px; background: var(--line); border-radius: 2px; min-width: 12px; }
  512. .up-step-line.done { background: var(--dim-action); }
  513. .up-zone { margin: 14px 16px 0; border: 2px dashed var(--line-strong); border-radius: var(--r-lg); padding: 30px 20px; text-align: center; transition: border-color var(--t-fast), background var(--t-fast); }
  514. .up-zone:active { border-color: var(--brand); background: var(--brand-soft); }
  515. .up-zone .uz-ic { width: 60px; height: 60px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
  516. .up-zone .uz-t { font-size: var(--fs-md); font-weight: 700; }
  517. .up-zone .uz-s { font-size: var(--fs-sm); color: var(--ink-3); margin-top: 6px; line-height: 1.5; }
  518. .up-btns { display: flex; gap: 10px; margin-top: 18px; }
  519. .up-btns .ub { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 13px; font-size: var(--fs-base); font-weight: 600; transition: transform var(--t-fast) var(--ease-out); }
  520. .up-btns .ub:active { transform: scale(0.97); }
  521. .up-btns .ub.pri { background: var(--brand); color: #fff; border-color: var(--brand); }
  522. .up-preview { margin: 14px 16px 0; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-1); background: var(--surface); }
  523. .up-thumb { height: 168px; background: linear-gradient(135deg, #FFF3E6, #FFE2C7); position: relative; display: flex; align-items: center; justify-content: center; }
  524. .up-thumb .paper { width: 118px; height: 148px; background: #fff; border-radius: 6px; box-shadow: 0 6px 18px rgba(124,45,18,0.16); padding: 12px 10px; }
  525. .up-thumb .paper .pl { height: 6px; border-radius: 3px; background: #F2E7DA; margin-bottom: 7px; }
  526. .up-thumb .paper .pl.t { width: 56%; background: #E8D9C7; height: 8px; }
  527. .up-thumb .badge-ok { position: absolute; right: 12px; top: 12px; background: var(--dim-action); color: #fff; font-size: var(--fs-xs); font-weight: 700; padding: 4px 10px; border-radius: var(--r-pill); display: flex; align-items: center; gap: 4px; }
  528. .up-meta { padding: 14px; }
  529. .up-fname { font-size: var(--fs-base); font-weight: 600; display: flex; align-items: center; gap: 7px; }
  530. .up-fmeta { font-size: var(--fs-sm); color: var(--ink-3); margin-top: 4px; }
  531. .ocr-box { margin: 14px 16px 0; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 16px; }
  532. .ocr-bar { height: 6px; background: var(--bg-soft); border-radius: var(--r-pill); overflow: hidden; margin-top: 12px; }
  533. .ocr-bar .of { height: 100%; background: linear-gradient(90deg, var(--brand), #FF6B9D); border-radius: var(--r-pill); transition: width var(--t-slow) var(--ease-out); }
  534. .ocr-step { display: flex; align-items: center; gap: 9px; padding: 9px 0; font-size: var(--fs-sm); }
  535. .ocr-step .os-ic { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; background: var(--bg-soft); color: var(--ink-3); }
  536. .ocr-step.done .os-ic { background: var(--dim-action); color: #fff; }
  537. .ocr-step.run .os-ic { background: var(--brand-soft); color: var(--brand); }
  538. .ocr-step .os-t { color: var(--ink-2); }
  539. .ocr-step.done .os-t, .ocr-step.run .os-t { color: var(--ink); font-weight: 600; }
  540. .spin { animation: spin 1s linear infinite; transform-origin: center; }
  541. @keyframes spin { to { transform: rotate(360deg); } }
  542. .fix-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; }
  543. .fix-row + .fix-row { border-top: 1px solid var(--line); }
  544. .fix-row .fi { flex: 1; min-width: 0; }
  545. .fix-row .fn { font-size: var(--fs-sm); color: var(--ink-2); margin-bottom: 6px; }
  546. .fix-row .fv { font-size: var(--fs-md); font-weight: 800; }
  547. .fix-row .fw { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 2px; }
  548. .low-conf { background: rgba(245,158,11,0.14); color: #B45309; font-size: var(--fs-xs); font-weight: 700; padding: 2px 7px; border-radius: var(--r-pill); }
  549. .up-actions { padding: 6px 16px calc(20px + env(safe-area-inset-bottom, 0px)); }
  550. .btn-primary { width: 100%; background: var(--brand); color: #fff; border: none; border-radius: var(--r-md); padding: 16px; font-size: var(--fs-lg); font-weight: 700; box-shadow: var(--sh-brand); transition: transform var(--t-fast) var(--ease-out), opacity var(--t-fast); }
  551. .btn-primary:active { transform: scale(0.98); }
  552. .btn-primary:disabled { background: var(--line-strong); box-shadow: none; color: var(--ink-3); }
  553. .btn-ghost { width: 100%; background: transparent; color: var(--ink-2); border: none; padding: 14px; font-size: var(--fs-base); font-weight: 600; margin-top: 4px; }
  554. /* ===== 成长报告卡 / 分享卡 ===== */
  555. .rpt-tabs { display: flex; gap: 8px; margin: 14px 16px 0; }
  556. .rpt-tabs .rtt { flex: 1; text-align: center; padding: 11px 0; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--sh-1); font-size: var(--fs-base); font-weight: 700; color: var(--ink-2); transition: all var(--t-fast) var(--ease-out); }
  557. .rpt-tabs .rtt.on { background: var(--brand); color: #fff; box-shadow: var(--sh-brand); }
  558. .share-card {
  559. margin: 14px 16px 0; border-radius: var(--r-xl); padding: 20px; position: relative; overflow: hidden;
  560. background: linear-gradient(150deg, #FFF7ED 0%, #FFEDD5 52%, #FED7AA 100%);
  561. box-shadow: var(--sh-2);
  562. }
  563. .share-card::before { content: ""; position: absolute; right: -46px; top: -46px; width: 168px; height: 168px; border-radius: 50%; background: radial-gradient(circle, rgba(255,107,157,0.30), transparent 70%); }
  564. .share-card::after { content: ""; position: absolute; left: -40px; bottom: -60px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, rgba(99,102,241,0.18), transparent 70%); }
  565. .sc-brand { display: flex; align-items: center; gap: 8px; position: relative; }
  566. .sc-brand .scb-ic { width: 30px; height: 30px; border-radius: 9px; background: rgba(255,255,255,0.9); color: var(--brand); display: flex; align-items: center; justify-content: center; }
  567. .sc-brand .scb-tx { font-size: var(--fs-sm); font-weight: 800; color: #7C2D12; letter-spacing: 0.5px; }
  568. .sc-title { font-size: var(--fs-xl); font-weight: 800; color: #7C2D12; margin-top: 14px; position: relative; line-height: 1.3; }
  569. .sc-sub { font-size: var(--fs-sm); color: rgba(124,45,18,0.7); margin-top: 5px; position: relative; }
  570. .sc-dims { display: flex; gap: 8px; margin-top: 18px; position: relative; }
  571. .sc-dim { flex: 1; background: rgba(255,255,255,0.62); border-radius: var(--r-md); padding: 10px 6px; text-align: center; }
  572. .sc-dim .sd-n { font-size: var(--fs-md); font-weight: 800; }
  573. .sc-dim .sd-l { font-size: var(--fs-xs); color: rgba(124,45,18,0.6); margin-top: 2px; font-weight: 600; }
  574. .sc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(124,45,18,0.14); position: relative; }
  575. .sc-foot .sf-l { font-size: var(--fs-xs); color: rgba(124,45,18,0.6); }
  576. .sc-foot .sf-r { font-size: var(--fs-xs); font-weight: 700; color: #7C2D12; }
  577. .badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
  578. .bg-item { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 16px 10px; text-align: center; transition: transform var(--t-fast) var(--ease-out); position: relative; overflow: hidden; }
  579. .bg-item:active { transform: scale(0.96); }
  580. .bg-item.locked { opacity: 0.55; }
  581. .bg-ring { width: 62px; height: 62px; border-radius: 50%; margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; color: #fff; position: relative; }
  582. .bg-ring::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1.5px dashed var(--line-strong); }
  583. .bg-item.locked .bg-ring::after { border-color: var(--ink-3); }
  584. .bg-nm { font-size: var(--fs-sm); font-weight: 700; }
  585. .bg-dt { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 3px; line-height: 1.4; }
  586. .bg-lock { position: absolute; right: 8px; top: 8px; color: var(--ink-3); }
  587. .share-actions { display: flex; gap: 10px; margin: 16px 16px 0; }
  588. .share-actions .sa { flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 14px; border-radius: var(--r-md); font-size: var(--fs-base); font-weight: 700; transition: transform var(--t-fast) var(--ease-out); }
  589. .share-actions .sa:active { transform: scale(0.97); }
  590. .share-actions .sa.pri { background: var(--brand); color: #fff; box-shadow: var(--sh-brand); }
  591. .share-actions .sa.sec { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }
  592. /* ===== 成果 / 成就(突出成果 + 驱动继续完成) ===== */
  593. .ach-hero {
  594. margin: 14px 16px 0; border-radius: var(--r-xl); padding: 18px; position: relative; overflow: hidden;
  595. background: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 55%, #FED7AA 100%);
  596. box-shadow: var(--sh-2); color: #7C2D12;
  597. }
  598. .ach-hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle, rgba(255,140,66,0.32), transparent 70%); }
  599. .ach-hero .ah-t { font-size: var(--fs-md); font-weight: 800; position: relative; }
  600. .ach-hero .ah-s { font-size: var(--fs-sm); color: rgba(124,45,18,0.65); margin-top: 4px; position: relative; line-height: 1.5; }
  601. .ah-ring-wrap { display: flex; align-items: center; gap: 18px; margin-top: 16px; position: relative; }
  602. .ah-ring { width: 116px; height: 116px; flex: none; position: relative; }
  603. .ah-ring .ah-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
  604. .ah-ring .ah-c .n { font-size: var(--fs-2xl); font-weight: 800; line-height: 1; }
  605. .ah-ring .ah-c .l { font-size: var(--fs-xs); color: rgba(124,45,18,0.6); margin-top: 2px; }
  606. .ah-stats { flex: 1; display: flex; flex-direction: column; gap: 10px; }
  607. .ah-stat { display: flex; align-items: center; gap: 8px; }
  608. .ah-stat .as-v { font-size: var(--fs-lg); font-weight: 800; min-width: 52px; }
  609. .ah-stat .as-l { font-size: var(--fs-xs); color: rgba(124,45,18,0.6); }
  610. .ah-stat .as-bar { flex: 1; height: 6px; background: rgba(124,45,18,0.12); border-radius: var(--r-pill); overflow: hidden; }
  611. .ah-stat .as-bar i { display: block; height: 100%; background: var(--brand); border-radius: var(--r-pill); transition: width var(--t-slow) var(--ease-out); }
  612. /* 连续打卡火苗条 */
  613. .streak { display: flex; gap: 6px; margin-top: 14px; position: relative; }
  614. .streak .sd { flex: 1; text-align: center; }
  615. .streak .sd .dot { width: 100%; height: 30px; border-radius: 9px; background: rgba(255,255,255,0.55); display: flex; align-items: center; justify-content: center; color: rgba(124,45,18,0.35); }
  616. .streak .sd.done .dot { background: var(--brand); color: #fff; box-shadow: 0 3px 8px rgba(249,115,22,0.35); }
  617. .streak .sd.today .dot { outline: 2px solid var(--brand); outline-offset: 2px; }
  618. .streak .sd .dl { font-size: 9.5px; color: rgba(124,45,18,0.55); margin-top: 4px; font-weight: 600; }
  619. /* 任务:完成态 + 继续驱动 */
  620. .task-item { display: flex; align-items: center; gap: 12px; padding: 13px 0; position: relative; }
  621. .task-item + .task-item { border-top: 1px solid var(--line); }
  622. .task-item .tk-ck {
  623. width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none;
  624. display: flex; align-items: center; justify-content: center; background: transparent;
  625. transition: all var(--t-base) var(--ease-out);
  626. }
  627. .task-item .tk-ck:active { transform: scale(0.88); }
  628. .task-item.done .tk-ck { background: var(--ok); border-color: var(--ok); }
  629. .task-item .tk-bd { flex: 1; min-width: 0; }
  630. .task-item .tk-t { font-size: var(--fs-base); font-weight: 600; transition: color var(--t-base); }
  631. .task-item.done .tk-t { color: var(--ink-3); text-decoration: line-through; }
  632. .task-item .tk-m { font-size: var(--fs-sm); color: var(--ink-3); margin-top: 3px; display: flex; align-items: center; gap: 6px; }
  633. .task-item .tk-pts { font-size: var(--fs-xs); font-weight: 800; color: var(--brand); background: var(--brand-soft); padding: 2px 8px; border-radius: var(--r-pill); flex: none; }
  634. .task-item.done .tk-pts { color: var(--ok); background: var(--dim-action-soft); }
  635. /* 完成后高亮 */
  636. @keyframes taskPop { 0% { background: rgba(16,185,129,0.16); } 100% { background: transparent; } }
  637. .task-item.just-done { animation: taskPop 1.1s var(--ease-out); }
  638. /* 成果解锁横幅(完成任务后浮现) */
  639. .unlock-toast {
  640. position: absolute; left: 16px; right: 16px; top: 60px; z-index: 65;
  641. display: flex; align-items: center; gap: 11px; padding: 13px 15px; border-radius: var(--r-lg);
  642. background: linear-gradient(135deg, #FFF7ED, #FFEDD5); color: #7C2D12;
  643. box-shadow: var(--sh-3); border: 1.5px solid rgba(249,115,22,0.4);
  644. transform: translateY(-16px); opacity: 0; pointer-events: none;
  645. transition: transform var(--t-slow) var(--ease-drawer), opacity var(--t-base);
  646. }
  647. .unlock-toast.show { transform: translateY(0); opacity: 1; }
  648. .unlock-toast .ut-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
  649. .unlock-toast .ut-t { font-size: var(--fs-base); font-weight: 800; }
  650. .unlock-toast .ut-s { font-size: var(--fs-sm); color: rgba(124,45,18,0.7); margin-top: 2px; }
  651. /* 分享卡:可截图样式加强 */
  652. .share-card.hero-share { padding: 24px 20px; }
  653. .sc-streak { display: inline-flex; align-items: center; gap: 5px; background: rgba(255,255,255,0.7); color: #7C2D12; font-size: var(--fs-xs); font-weight: 800; padding: 4px 11px; border-radius: var(--r-pill); margin-top: 12px; position: relative; }
  654. .sc-ach { display: flex; gap: 8px; margin-top: 14px; position: relative; }
  655. .sc-ach-item { flex: 1; text-align: center; background: rgba(255,255,255,0.55); border-radius: var(--r-md); padding: 9px 4px; }
  656. .sc-ach-item .n { font-size: var(--fs-sm); font-weight: 800; color: #7C2D12; }
  657. .sc-ach-item .l { font-size: 10px; color: rgba(124,45,18,0.55); margin-top: 2px; }
  658. /* 成就徽章(放大 + 解锁动画) */
  659. .bg-item .bg-ring svg { transition: transform var(--t-base) var(--ease-out); }
  660. .bg-item:active .bg-ring svg { transform: scale(1.12) rotate(-6deg); }
  661. @keyframes badgeUnlock { 0% { transform: scale(0.6) rotate(-20deg); opacity: 0; } 60% { transform: scale(1.12) rotate(6deg); } 100% { transform: scale(1) rotate(0); opacity: 1; } }
  662. .bg-item.just-unlocked .bg-ring { animation: badgeUnlock .7s var(--ease-out); }
  663. /* ===== 肠道问卷 / 9.9 陪跑 / D7 报告 ===== */
  664. .qz-wrap { padding: 0 20px calc(24px + env(safe-area-inset-bottom, 0px)); }
  665. .qz-prog { display: flex; align-items: center; gap: 8px; padding: 18px 20px 10px; }
  666. .qz-prog .qp-bar { flex: 1; height: 5px; background: var(--bg-soft); border-radius: var(--r-pill); overflow: hidden; }
  667. .qz-prog .qp-bar i { display: block; height: 100%; background: var(--brand); border-radius: var(--r-pill); transition: width var(--t-base) var(--ease-out); }
  668. .qz-prog .qp-tx { font-size: var(--fs-xs); color: var(--ink-3); font-weight: 600; flex: none; }
  669. .qz-q { padding: 14px 0; }
  670. .qz-q .qq-dim { font-size: var(--fs-xs); font-weight: 700; color: var(--brand); letter-spacing: 0.5px; }
  671. .qz-q .qq-t { font-size: var(--fs-lg); font-weight: 700; margin-top: 6px; line-height: 1.45; }
  672. .qz-opts { margin-top: 14px; display: flex; flex-direction: column; gap: 9px; }
  673. .qz-opt {
  674. display: flex; align-items: center; gap: 11px; padding: 14px 16px; border-radius: var(--r-md);
  675. background: var(--surface); border: 1.5px solid var(--line); cursor: pointer;
  676. transition: all var(--t-fast) var(--ease-out);
  677. }
  678. .qz-opt:active { transform: scale(0.98); }
  679. .qz-opt.on { border-color: var(--brand); background: var(--brand-soft); }
  680. .qz-opt .qo-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; display: flex; align-items: center; justify-content: center; }
  681. .qz-opt.on .qo-dot { border-color: var(--brand); }
  682. .qz-opt .qo-dot::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: transparent; }
  683. .qz-opt.on .qo-dot::after { background: var(--brand); }
  684. .qz-opt .qo-t { flex: 1; font-size: var(--fs-base); font-weight: 600; }
  685. .qz-opt .qo-s { font-size: var(--fs-sm); color: var(--ink-3); flex: none; }
  686. /* 风险结果页 */
  687. .risk-hero { margin: 14px 16px 0; border-radius: var(--r-xl); padding: 20px; text-align: center; position: relative; overflow: hidden; box-shadow: var(--sh-2); }
  688. .risk-hero.low { background: linear-gradient(135deg, #EAF3DE, #C0DD97); }
  689. .risk-hero.mid { background: linear-gradient(135deg, #FFF7ED, #FED7AA); }
  690. .risk-hero.high { background: linear-gradient(135deg, #FCEBEB, #F7C1C1); }
  691. .risk-hero .rh-score { font-size: 46px; font-weight: 800; line-height: 1; }
  692. .risk-hero .rh-unit { font-size: var(--fs-base); font-weight: 600; opacity: 0.7; margin-top: 4px; }
  693. .risk-hero .rh-lv { display: inline-block; margin-top: 12px; background: rgba(255,255,255,0.8); font-size: var(--fs-md); font-weight: 800; padding: 5px 16px; border-radius: var(--r-pill); }
  694. .risk-hero .rh-tip { font-size: var(--fs-sm); margin-top: 10px; opacity: 0.8; }
  695. .risk-factors { margin: 14px 16px 0; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 16px; }
  696. .rf-title { font-size: var(--fs-md); font-weight: 700; margin-bottom: 12px; }
  697. .rf-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; }
  698. .rf-row + .rf-row { border-top: 1px solid var(--line); }
  699. .rf-row .rf-d { font-size: var(--fs-sm); color: var(--ink-2); flex: 1; }
  700. .rf-row .rf-b { width: 56px; height: 6px; background: var(--bg-soft); border-radius: var(--r-pill); overflow: hidden; flex: none; }
  701. .rf-row .rf-b i { display: block; height: 100%; border-radius: var(--r-pill); }
  702. .rf-row .rf-s { font-size: var(--fs-sm); font-weight: 700; width: 26px; text-align: right; flex: none; }
  703. /* 9.9 陪跑 7 天 */
  704. .prep-card { margin: 14px 16px 0; border-radius: var(--r-xl); padding: 18px; background: linear-gradient(135deg, #FFF7ED, #FFEDD5); box-shadow: var(--sh-2); color: #7C2D12; position: relative; overflow: hidden; }
  705. .prep-card .pc-t { font-size: var(--fs-lg); font-weight: 800; }
  706. .prep-card .pc-s { font-size: var(--fs-sm); color: rgba(124,45,18,0.7); margin-top: 6px; line-height: 1.5; }
  707. .prep-price { margin-top: 14px; display: flex; align-items: flex-end; gap: 10px; }
  708. .prep-price .pp-n { font-size: 38px; font-weight: 800; line-height: 1; }
  709. .prep-price .pp-u { font-size: var(--fs-sm); color: rgba(124,45,18,0.7); padding-bottom: 5px; }
  710. .prep-list { margin: 14px 16px 0; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 6px 16px; }
  711. .prep-item { display: flex; align-items: center; gap: 11px; padding: 12px 0; }
  712. .prep-item + .prep-item { border-top: 1px solid var(--line); }
  713. .prep-item .pi-ic { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex: none; }
  714. /* 7 天打卡格 */
  715. .d7-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 7px; margin-top: 14px; }
  716. .d7-cell { aspect-ratio: 1; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; font-size: var(--fs-xs); font-weight: 700; background: rgba(255,255,255,0.55); color: rgba(124,45,18,0.4); }
  717. .d7-cell.done { background: var(--brand); color: #fff; }
  718. .d7-cell.today { outline: 2px solid var(--brand); outline-offset: 2px; color: #7C2D12; }
  719. .d7-ach { display: flex; gap: 9px; margin-top: 16px; }
  720. .d7-ach .da { flex: 1; background: rgba(255,255,255,0.62); border-radius: var(--r-md); padding: 11px 6px; text-align: center; }
  721. .d7-ach .da .v { font-size: var(--fs-lg); font-weight: 800; }
  722. .d7-ach .da .l { font-size: var(--fs-xs); color: rgba(124,45,18,0.65); margin-top: 2px; font-weight: 600; }
  723. /* 变化曲线(报告内) */
  724. .trend-box { margin: 14px 16px 0; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 16px; }
  725. .tb-row { padding: 12px 0; }
  726. .tb-row + .tb-row { border-top: 1px solid var(--line); }
  727. .tb-head { display: flex; align-items: baseline; justify-content: space-between; }
  728. .tb-name { font-size: var(--fs-base); font-weight: 700; }
  729. .tb-val { font-size: var(--fs-sm); font-weight: 800; }
  730. .tb-spark { display: flex; align-items: flex-end; gap: 4px; height: 34px; margin-top: 9px; }
  731. .tb-spark i { flex: 1; background: var(--brand-soft); border-radius: 3px 3px 0 0; min-height: 4px; }
  732. .tb-spark i.last { background: var(--brand); }
  733. .tb-note { font-size: var(--fs-sm); color: var(--ink-2); margin-top: 9px; line-height: 1.5; }
  734. /* 发现卡(报告) */
  735. .find-card { margin: 14px 16px 0; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 15px; }
  736. .find-card .fc-h { display: flex; gap: 9px; align-items: flex-start; }
  737. .find-card .fc-ic { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex: none; }
  738. .find-card .fc-t { font-size: var(--fs-base); font-weight: 700; line-height: 1.4; }
  739. .find-card .fc-obs { font-size: var(--fs-sm); color: var(--ink-2); margin-top: 9px; line-height: 1.6; }
  740. .find-card .fc-tip { margin-top: 10px; background: var(--brand-soft); border-radius: var(--r-sm); padding: 10px 12px; font-size: var(--fs-sm); color: var(--brand-ink); line-height: 1.55; font-weight: 600; }
  741. /* 准备度 */
  742. .chk-row { display: flex; align-items: center; gap: 11px; padding: 11px 0; }
  743. .chk-row + .chk-row { border-top: 1px solid var(--line); }
  744. .chk-row .ck-ic { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; }
  745. .chk-row.done .ck-ic { background: var(--ok); color: #fff; }
  746. .chk-row.todo .ck-ic { background: var(--bg-soft); color: var(--ink-3); }
  747. .chk-row .ck-t { flex: 1; font-size: var(--fs-base); font-weight: 600; }
  748. .chk-row .ck-n { font-size: var(--fs-xs); color: var(--ink-3); }
  749. /* 缺口对照 */
  750. .gap-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  751. .gap-col { border-radius: var(--r-md); padding: 13px; }
  752. .gap-col .gc-h { font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.5px; margin-bottom: 9px; }
  753. .gap-col.know { background: var(--dim-action-soft); }
  754. .gap-col.know .gc-h { color: var(--ok); }
  755. .gap-col.unk { background: var(--bg-soft); }
  756. .gap-col.unk .gc-h { color: var(--ink-3); }
  757. .gap-col li { font-size: var(--fs-sm); line-height: 1.7; list-style: none; }
  758. /* 检测行动卡 */
  759. .buy-card { margin: 14px 16px 0; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-2); overflow: hidden; }
  760. .buy-hd { padding: 16px; background: linear-gradient(135deg, #FFF7ED, #FFEDD5); color: #7C2D12; }
  761. .buy-hd .bh-t { font-size: var(--fs-lg); font-weight: 800; }
  762. .buy-hd .bh-p { display: flex; align-items: baseline; gap: 8px; margin-top: 8px; }
  763. .buy-hd .bh-n { font-size: 30px; font-weight: 800; }
  764. .buy-hd .bh-u { font-size: var(--fs-sm); color: rgba(124,45,18,0.7); }
  765. .buy-hd .bh-o { font-size: var(--fs-sm); text-decoration: line-through; opacity: 0.6; margin-left: 4px; }
  766. .buy-bd { padding: 6px 16px 16px; }
  767. .buy-line { display: flex; align-items: center; gap: 9px; padding: 11px 0; font-size: var(--fs-sm); }
  768. .buy-line + .buy-line { border-top: 1px solid var(--line); }
  769. .buy-line .bl-t { flex: 1; color: var(--ink-2); }
  770. .buy-line .bl-v { font-weight: 800; }
  771. .installment { margin: 10px 16px 0; background: var(--brand-soft); border-radius: var(--r-md); padding: 13px 15px; display: flex; align-items: center; gap: 11px; }
  772. .installment .in-n { font-size: var(--fs-md); font-weight: 800; color: var(--brand-ink); }
  773. .installment .in-t { font-size: var(--fs-sm); color: var(--brand-ink); opacity: 0.85; margin-top: 2px; }
  774. .why-now { margin: 14px 16px 0; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 15px; }
  775. .why-now .wn-i { display: flex; gap: 10px; padding: 9px 0; align-items: flex-start; }
  776. .why-now .wn-n { width: 20px; height: 20px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; margin-top: 1px; }
  777. .why-now .wn-t { font-size: var(--fs-sm); line-height: 1.55; color: var(--ink-2); }
  778. .why-now .wn-t b { color: var(--ink); }
  779. .report-hd { padding: 22px 20px 6px; text-align: center; }
  780. .report-hd .rph-big { font-size: 52px; font-weight: 800; line-height: 1; color: #7C2D12; }
  781. .report-hd .rph-sub { font-size: var(--fs-base); color: rgba(124,45,18,0.75); margin-top: 8px; }
  782. .report-hero { margin: 14px 16px 0; border-radius: var(--r-xl); padding: 20px; background: linear-gradient(135deg, #FFF7ED, #FED7AA); box-shadow: var(--sh-2); position: relative; overflow: hidden; }
  783. .report-hero .rp-t { font-size: var(--fs-xl); font-weight: 800; color: #7C2D12; }
  784. .report-hero .rp-s { font-size: var(--fs-sm); color: rgba(124,45,18,0.72); margin-top: 8px; line-height: 1.6; }
  785. .legal { padding: 16px 20px calc(24px + env(safe-area-inset-bottom, 0px)); font-size: var(--fs-xs); color: var(--ink-3); line-height: 1.6; text-align: center; }
  786. @media (prefers-reduced-motion: reduce) {
  787. * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  788. .screen, .stagger > * { animation: none !important; opacity: 1 !important; transform: none !important; }
  789. .sp-c, .sp-logo, .sp-body, .sp-dim, .sp-dots span { animation: none !important; }
  790. }
  791. @media (max-width: 360px) {
  792. .ring { width: 116px; height: 116px; }
  793. .ring-wrap { gap: 12px; }
  794. }
  795. </style>
  796. </head>
  797. <body>
  798. <!-- 演示态切换 -->
  799. <div class="demo-bar">
  800. <button id="db-in" class="on">已登录</button>
  801. <button id="db-out">未登录</button>
  802. </div>
  803. <div class="stage">
  804. <div class="notch"></div>
  805. <div class="statusbar">
  806. <span id="clock">9:41</span>
  807. <span class="sb-right">
  808. <svg width="17" height="12" viewBox="0 0 17 12" fill="currentColor"><rect x="0" y="7" width="3" height="5" rx="1"/><rect x="4.5" y="4.5" width="3" height="7.5" rx="1"/><rect x="9" y="2" width="3" height="10" rx="1"/><rect x="13.5" y="0" width="3" height="12" rx="1"/></svg>
  809. <svg width="16" height="12" viewBox="0 0 16 12" fill="none" stroke="currentColor" stroke-width="1.3"><path d="M8 2.4c2.2-1.8 5.3-1.4 6.6 1 .9 1.7.3 4-1.3 5.2C11.2 10.4 9.5 11 8 11 6.5 11 4.8 10.4 2.7 8.6 1.1 7.4.5 5.2 1.4 3.5 2.7 1.1 5.8.6 8 2.4Z"/></svg>
  810. <svg width="24" height="12" viewBox="0 0 24 12" fill="currentColor"><rect x="1" y="1.5" width="19" height="9" rx="2.5"/><rect x="2.5" y="3" width="14" height="6" rx="1" fill="#fff"/><rect x="21" y="4" width="2" height="4" rx="1"/></svg>
  811. </span>
  812. </div>
  813. <div class="app">
  814. <!-- ============ 首页 / Root ============ -->
  815. <div class="screen active" id="screen-home">
  816. <div class="screen-scroll">
  817. <div class="topbar">
  818. <div class="tb-left">
  819. <span class="tb-greet"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="4.2"/><path d="M12 2v3M12 19v3M2 12h3M19 12h3M5 5l2 2M17 17l2 2M19 5l-2 2M7 17l-2 2"/></svg> 晚上好,林晓</span>
  820. <span class="tb-title">家庭主页</span>
  821. </div>
  822. <div class="tb-right">
  823. <div class="member-switch">
  824. <div class="mchip on" data-member="me" onclick="switchMember('me')"><span class="ava" style="background:#F97316">林</span><span class="nm">我</span></div>
  825. <div class="mchip" data-member="yu" onclick="switchMember('yu')"><span class="ava" style="background:#FF7A45">宇</span><span class="nm">小宇</span></div>
  826. </div>
  827. <div class="icon-btn" onclick="toast('暂无新消息')"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M18 8a6 6 0 1 0-12 0c0 7-3 9-3 9h18s-3-2-3-9"/><path d="M13.7 21a2 2 0 0 1-3.4 0"/></svg><span class="badge"></span></div>
  828. </div>
  829. </div>
  830. <!-- 能量英雄 -->
  831. <div class="energy-hero" onclick="openDim()">
  832. <div class="eh-top">
  833. <div>
  834. <div class="eh-label">全家五维能量</div>
  835. <div class="eh-score" id="eh-score">78<small>分</small></div>
  836. <div class="eh-sub" id="eh-sub">较上周 +4 · 身维度领先</div>
  837. </div>
  838. <div class="eh-link" onclick="event.stopPropagation();openOverview()">查看详情 ›</div>
  839. </div>
  840. <div class="ring-wrap">
  841. <div class="ring" id="hero-ring"></div>
  842. <div class="dim-bars" id="hero-bars"></div>
  843. </div>
  844. </div>
  845. <!-- Next Best Action -->
  846. <div class="nba" id="nba" onclick="openQuiz()">
  847. <div class="nba-ic" style="background:var(--dim-body-soft);color:var(--dim-body)"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="9"/><path d="M12 8v4M12 16h.01"/></svg></div>
  848. <div class="nba-info">
  849. <div class="nba-t" id="nba-t">先做五维健康筛查</div>
  850. <div class="nba-s" id="nba-s">肥胖 · 三高 · 痛风 · 便秘 · 腹泻 · 睡眠 · 过敏 · 免费</div>
  851. </div>
  852. <div class="nba-go">去评估 ›</div>
  853. </div>
  854. <div class="nba" onclick="openReport7()">
  855. <div class="nba-ic" style="background:var(--brand-soft);color:var(--brand)"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 19V5a2 2 0 0 1 2-2h12v18H6a2 2 0 0 1-2-2z"/><path d="M8 7h8M8 11h8M8 15h5"/></svg></div>
  856. <div class="nba-info">
  857. <div class="nba-t">查看 7 天准备报告</div>
  858. <div class="nba-s">示例:饮食结构 4→7 · 准备度 80%</div>
  859. </div>
  860. <div class="nba-go">看报告 ›</div>
  861. </div>
  862. <!-- 今日任务 -->
  863. <div class="section">
  864. <div class="sec-head"><span class="sec-title">今日任务</span><span class="sec-more" onclick="toast('进入任务中心')">全部 ›</span></div>
  865. <div class="card" id="task-card"></div>
  866. </div>
  867. <!-- 家庭挑战 -->
  868. <div class="section">
  869. <div class="sec-head"><span class="sec-title">家庭挑战</span><span class="sec-more" onclick="toast('管理挑战')">管理 ›</span></div>
  870. <div class="card" id="challenge-card"></div>
  871. </div>
  872. <!-- 家庭动态 -->
  873. <div class="section">
  874. <div class="sec-head"><span class="sec-title">家庭动态</span></div>
  875. <div class="card" id="feed-card"></div>
  876. </div>
  877. <!-- 推荐阅读 -->
  878. <div class="section">
  879. <div class="sec-head"><span class="sec-title">推荐阅读</span><span class="sec-more" onclick="toast('更多文章')">更多 ›</span></div>
  880. </div>
  881. <div class="hscroll" id="rec-scroll"></div>
  882. </div>
  883. </div>
  884. <!-- ============ 健康 / Root ============ -->
  885. <div class="screen" id="screen-health">
  886. <div class="screen-scroll">
  887. <div class="topbar">
  888. <div class="tb-left"><span class="tb-greet">科学管理全家健康</span><span class="tb-title">健康</span></div>
  889. <div class="tb-right"><div class="icon-btn" onclick="toast('健康洞察')"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 16v-5M12 8h.01"/><circle cx="12" cy="12" r="9"/></svg></div></div>
  890. </div>
  891. <div class="seg">
  892. <div class="sg on" onclick="setHealthSeg('body',this)">身体</div>
  893. <div class="sg" onclick="setHealthSeg('cognitive',this)">认知</div>
  894. <div class="sg" onclick="setHealthSeg('mental',this)">心理</div>
  895. <div class="sg" onclick="setHealthSeg('wealth',this)">财富</div>
  896. </div>
  897. <div class="radar-card" id="radar-card"></div>
  898. <div class="data-row">
  899. <div class="data-col">
  900. <div class="dc-t" style="cursor:pointer" onclick="openUpload('body')"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="var(--dim-body)" stroke-width="2"><path d="M12 3v18M3 12h18"/><circle cx="12" cy="12" r="9"/></svg> 上传报告</div>
  901. <div id="report-list"></div>
  902. </div>
  903. <div class="data-col">
  904. <div class="dc-t"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="var(--dim-wisdom)" stroke-width="2"><path d="M9 11l3 3 8-8"/><path d="M20 12v6a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h9"/></svg> 在线测评</div>
  905. <div id="quiz-list"></div>
  906. </div>
  907. </div>
  908. <div class="section"><div class="sec-head"><span class="sec-title">最近记录</span><span class="sec-more" onclick="toast('全部报告')">查看全部 ›</span></div></div>
  909. <div class="hscroll" id="health-rec"></div>
  910. </div>
  911. </div>
  912. <!-- ============ 成长 / Root ============ -->
  913. <div class="screen" id="screen-growth">
  914. <div class="screen-scroll">
  915. <div class="topbar">
  916. <div class="tb-left"><span class="tb-greet">看见改变正在发生</span><span class="tb-title">成长</span></div>
  917. <div class="tb-right"><div class="icon-btn" onclick="toast('成长档案')"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M4 19V5a2 2 0 0 1 2-2h12v18H6a2 2 0 0 1-2-2z"/><path d="M8 7h8M8 11h8M8 15h5"/></svg></div></div>
  918. </div>
  919. <div class="section">
  920. <div class="ach-hero">
  921. <div class="ah-t" id="ach-title">本周成果</div>
  922. <div class="ah-s" id="ach-sub">完成 12 项任务 · 连续打卡 12 天</div>
  923. <div class="ah-ring-wrap">
  924. <div class="ah-ring" id="ach-ring"></div>
  925. <div class="ah-stats">
  926. <div class="ah-stat"><span class="as-v" id="ach-task-v">12</span><span class="as-l">项任务</span><span class="as-bar"><i id="ach-task-b" style="width:60%"></i></span></div>
  927. <div class="ah-stat"><span class="as-v" style="color:var(--dim-wealth)">1,240</span><span class="as-l">成长分</span><span class="as-bar"><i id="ach-pt-b" style="width:72%;background:var(--dim-wealth)"></i></span></div>
  928. <div class="ah-stat"><span class="as-v" style="color:var(--dim-wisdom)">4</span><span class="as-l">枚徽章</span><span class="as-bar"><i id="ach-bg-b" style="width:40%;background:var(--dim-wisdom)"></i></span></div>
  929. </div>
  930. </div>
  931. <div class="streak" id="ach-streak"></div>
  932. </div>
  933. </div>
  934. <div class="section">
  935. <div class="nba" style="border-left-color:var(--dim-wealth);background:linear-gradient(135deg,#FFF7ED,#FFEDD5)" onclick="openReport()">
  936. <div class="nba-ic" style="background:rgba(255,255,255,0.7);color:var(--dim-wealth)">
  937. <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="16" rx="2"/><path d="M3 9h18M8 4v16"/></svg>
  938. </div>
  939. <div class="nba-info">
  940. <div class="nba-t" style="color:#7C2D12">本周成长报告已生成</div>
  941. <div class="nba-s" style="color:rgba(124,45,18,0.7)">五维里程碑 · 可保存分享给家人朋友</div>
  942. </div>
  943. <div class="nba-go" style="color:#7C2D12">查看 ›</div>
  944. </div>
  945. </div>
  946. <div class="section">
  947. <div class="sec-head"><span class="sec-title">今日成长</span><span class="sec-more" id="growth-date">10-06</span></div>
  948. <div class="card">
  949. <div class="today-prog" id="today-prog"></div>
  950. <div style="display:flex;justify-content:space-between;margin-top:14px;font-size:var(--fs-sm);color:var(--ink-2)">
  951. <span id="growth-done">已完成 3/5</span><span style="color:var(--dim-mind);font-weight:600">🔥 连续 12 天</span>
  952. </div>
  953. </div>
  954. </div>
  955. <div class="section">
  956. <div class="sec-head"><span class="sec-title">今日任务</span><span class="sec-more" onclick="toast('任务中心')">更多 ›</span></div>
  957. <div class="card" style="padding-top:4px;padding-bottom:4px">
  958. <div id="growth-tasks"></div>
  959. <div id="growth-next" style="display:none;margin-top:6px;padding:13px 0 4px;border-top:1px dashed var(--line-strong)">
  960. <div style="display:flex;align-items:center;gap:8px;font-size:var(--fs-sm);color:var(--ink-2);font-weight:600">
  961. <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="var(--brand)" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2l2.4 6.3L21 9.3l-5 4.4L17.5 21 12 17l-5.5 4L8 13.7l-5-4.4 6.6-1z"/></svg>
  962. 再完成 <b id="next-n" style="color:var(--brand)">1</b> 项解锁「本周全勤」
  963. </div>
  964. </div>
  965. </div>
  966. </div>
  967. <div class="section"><div class="sec-head"><span class="sec-title">家庭挑战</span></div></div>
  968. <div class="hscroll" id="growth-rec"></div>
  969. </div>
  970. </div>
  971. <!-- ============ 我的 / Root ============ -->
  972. <div class="screen" id="screen-profile">
  973. <div class="screen-scroll">
  974. <div class="topbar" style="background:transparent;border:none;position:relative">
  975. <div class="tb-left"><span class="tb-greet">照顾家庭,从照顾好自己开始</span><span class="tb-title">我的</span></div>
  976. <div class="tb-right"><div class="icon-btn" onclick="toast('设置')"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.6 1.6 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.6 1.6 0 0 0-2.7 1.1V21a2 2 0 1 1-4 0v-.1A1.6 1.6 0 0 0 7 19.4a1.6 1.6 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1A1.6 1.6 0 0 0 2.6 14H2.5a2 2 0 1 1 0-4h.1A1.6 1.6 0 0 0 4.6 7a1.6 1.6 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1A1.6 1.6 0 0 0 9 2.6V2.5a2 2 0 1 1 4 0v.1A1.6 1.6 0 0 0 17 4.6a1.6 1.6 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1A1.6 1.6 0 0 0 21.4 12H21.5a2 2 0 1 1 0 4h-.1a1.6 1.6 0 0 0-1.5 1z"/></svg></div></div>
  977. </div>
  978. <div class="id-card">
  979. <div class="id-ava">林</div>
  980. <div class="id-meta">
  981. <div class="id-nm">林晓 <span class="id-lv">黄金会员</span></div>
  982. <div class="id-sub">家长 · 家庭创建者</div>
  983. </div>
  984. <div class="id-pts"><div class="pv">2,480</div><div class="pl">积分</div></div>
  985. </div>
  986. <div class="fam-strip" style="margin-top:16px">
  987. <div class="fam-it"><div class="fam-av" style="background:#F97316">林<span class="fam-tag" style="background:#F97316">我</span></div><div class="fam-nm">林晓</div></div>
  988. <div class="fam-it"><div class="fam-av" style="background:#FF7A45">宇<span class="fam-tag" style="background:#FF7A45">子</span></div><div class="fam-nm">小宇</div></div>
  989. <div class="fam-it"><div class="fam-av" style="background:#F2588E">柚<span class="fam-tag" style="background:#F2588E">女</span></div><div class="fam-nm">小柚</div></div>
  990. <div class="fam-it"><div class="fam-av" style="background:#12B981">爷<span class="fam-tag" style="background:#12B981">父</span></div><div class="fam-nm">爷爷</div></div>
  991. <div class="fam-it" onclick="toast('添加成员')"><div class="fam-av add">+</div><div class="fam-nm">添加</div></div>
  992. </div>
  993. <div class="section">
  994. <div class="sec-head"><span class="sec-title">我的成就</span></div>
  995. <div class="card"><div class="ach-grid" id="ach-grid"></div></div>
  996. </div>
  997. <div class="section">
  998. <div class="sec-head"><span class="sec-title">我的订单</span><span class="sec-more" onclick="toast('全部订单')">全部 ›</span></div>
  999. <div class="card">
  1000. <div style="display:flex;justify-content:space-around;text-align:center">
  1001. <div class="tap" style="flex:1" onclick="toast('待付款')"><div style="font-size:var(--fs-lg);font-weight:800">1</div><div style="font-size:var(--fs-xs);color:var(--ink-3)">待付款</div></div>
  1002. <div class="tap" style="flex:1" onclick="toast('待发货')"><div style="font-size:var(--fs-lg);font-weight:800">0</div><div style="font-size:var(--fs-xs);color:var(--ink-3)">待发货</div></div>
  1003. <div class="tap" style="flex:1" onclick="toast('待收货')"><div style="font-size:var(--fs-lg);font-weight:800">2</div><div style="font-size:var(--fs-xs);color:var(--ink-3)">待收货</div></div>
  1004. <div class="tap" style="flex:1" onclick="toast('售后')"><div style="font-size:var(--fs-lg);font-weight:800">0</div><div style="font-size:var(--fs-xs);color:var(--ink-3)">售后</div></div>
  1005. </div>
  1006. </div>
  1007. </div>
  1008. <div class="section">
  1009. <div class="menu-list">
  1010. <div class="menu-row" onclick="toast('服务中心')"><div class="mr-ic" style="background:var(--dim-wisdom-soft);color:var(--dim-wisdom)"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 21h18M5 21V8l7-4 7 4v13"/><path d="M9 21v-6h6v6"/></svg></div><div class="mr-tx">服务中心</div><div class="mr-ar">›</div></div>
  1011. <div class="menu-row" onclick="toast('我的报告')"><div class="mr-ic" style="background:var(--dim-body-soft);color:var(--dim-body)"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><path d="M14 2v6h6"/></svg></div><div class="mr-tx">我的报告</div><div class="mr-ar">›</div></div>
  1012. <div class="menu-row" onclick="toast('财富中心')"><div class="mr-ic" style="background:var(--dim-wealth-soft);color:var(--dim-wealth)"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="9"/><path d="M12 7v10M9.5 9.5h4a1.5 1.5 0 0 1 0 3h-3a1.5 1.5 0 0 0 0 3h4"/></svg></div><div class="mr-tx">财富中心</div><div class="mr-ar">›</div></div>
  1013. <div class="menu-row" onclick="toast('设置')"><div class="mr-ic" style="background:var(--bg-soft);color:var(--ink-2)"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.6 1.6 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.6 1.6 0 0 0-2.7 1.1V21a2 2 0 1 1-4 0v-.1A1.6 1.6 0 0 0 7 19.4a1.6 1.6 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1A1.6 1.6 0 0 0 2.6 14H2.5a2 2 0 1 1 0-4h.1A1.6 1.6 0 0 0 4.6 7a1.6 1.6 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1A1.6 1.6 0 0 0 9 2.6V2.5a2 2 0 1 1 4 0v.1A1.6 1.6 0 0 0 17 4.6a1.6 1.6 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1A1.6 1.6 0 0 0 21.4 12H21.5a2 2 0 1 1 0 4h-.1a1.6 1.6 0 0 0-1.5 1z"/></svg></div><div class="mr-tx">设置</div><div class="mr-ar">›</div></div>
  1014. </div>
  1015. </div>
  1016. </div>
  1017. </div>
  1018. <!-- ============ 登录(未登录根) ============ -->
  1019. <div class="screen" id="screen-login" style="display:none">
  1020. <div class="login">
  1021. <div class="lg-logo"><svg width="34" height="34" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2l2.4 6.3L21 9.3l-5 4.4L17.5 21 12 17l-5.5 4L8 13.7l-5-4.4 6.6-1z"/></svg></div>
  1022. <div class="lg-h">浠艾福</div>
  1023. <div class="lg-s">您的专属家庭五维健康管家<br/>先看见,先了解,不等问题发生</div>
  1024. <div class="lg-fields">
  1025. <div class="field"><span class="fc-ic"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M4 4h16v16H4z"/><path d="M4 7l8 6 8-6"/></svg></span><input placeholder="手机号 / 邮箱" inputmode="email" autocomplete="username" /></div>
  1026. <div class="field"><span class="fc-ic"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="5" y="11" width="14" height="9" rx="2"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg></span><input placeholder="密码" type="password" autocomplete="current-password" /></div>
  1027. </div>
  1028. <button class="lg-btn" onclick="demoLogin()">登录 / 注册</button>
  1029. <div class="lg-alt">还没有账号?<b onclick="demoLogin()">免费体验 ›</b></div>
  1030. <div class="lg-terms">登录即代表同意《用户协议》与《隐私政策》<br/>亿图腾科技出品</div>
  1031. </div>
  1032. </div>
  1033. <!-- ============ 五维能量总览(深读 · 全屏,隐藏 TabBar) ============ -->
  1034. <div class="screen" id="screen-overview">
  1035. <div class="screen-scroll" style="padding-bottom:24px">
  1036. <div class="nav-bar">
  1037. <div class="nb-back" onclick="backTo('home')"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 5l-7 7 7 7"/></svg></div>
  1038. <div class="nb-t">五维能量总览</div>
  1039. <div class="nb-a" onclick="toast('切换到:本周')">本周</div>
  1040. </div>
  1041. <div class="ov-hero">
  1042. <div class="ov-score">
  1043. <div class="os-n" id="ov-n">76</div>
  1044. <div class="os-u">综合能量</div>
  1045. <div class="ov-delta" id="ov-delta">↑ 4 较上周</div>
  1046. </div>
  1047. <div class="ov-cap">全家 4 位成员 · 较上周整体向好,<b>行</b> 维度提升最明显</div>
  1048. <div class="ov-radar" id="ov-radar"></div>
  1049. <div class="ov-legend" id="ov-legend"></div>
  1050. </div>
  1051. <div class="trend-card">
  1052. <div class="trend-tabs" id="ov-trend-tabs">
  1053. <div class="tt on" data-range="week" onclick="setOvRange('week', this)">近 7 天</div>
  1054. <div class="tt" data-range="month" onclick="setOvRange('month', this)">近 30 天</div>
  1055. </div>
  1056. <div id="ov-trend"></div>
  1057. <div class="trend-legend" id="ov-trend-legend"></div>
  1058. </div>
  1059. <div class="sec-head section">
  1060. <div class="sec-title">家人对比</div>
  1061. <div class="sec-more" onclick="toast('查看全部成员')">全部 ›</div>
  1062. </div>
  1063. <div class="card cmp-list" id="ov-cmp"></div>
  1064. <div class="sec-head section">
  1065. <div class="sec-title">本月行动建议</div>
  1066. <div class="sec-more" onclick="toast('已生成专属计划')">生成计划 ›</div>
  1067. </div>
  1068. <div class="pad" id="ov-adv"></div>
  1069. </div>
  1070. </div>
  1071. <!-- ============ 维度详情(Task 页,隐藏 TabBar) ============ -->
  1072. <div class="screen" id="screen-dim">
  1073. <div class="screen-scroll" style="padding-bottom:24px">
  1074. <div class="nav-bar">
  1075. <div class="nb-back" onclick="backTo('home')"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 5l-7 7 7 7"/></svg></div>
  1076. <div class="nb-t" id="dim-nav-title">维度详情</div>
  1077. <div class="nb-a" onclick="toast('切换成员')">小宇</div>
  1078. </div>
  1079. <div id="dim-hero-slot"></div>
  1080. <div class="sec-head section">
  1081. <div class="sec-title">关键指标</div>
  1082. <div class="sec-more" onclick="openUpload('body')">上传报告 ›</div>
  1083. </div>
  1084. <div class="card" id="dim-metrics"></div>
  1085. <div class="sec-head section">
  1086. <div class="sec-title">本周趋势</div>
  1087. <div class="sec-more" onclick="toast('查看历史')">历史 ›</div>
  1088. </div>
  1089. <div class="trend-card" style="margin-top:0" id="dim-trend"></div>
  1090. <div class="sec-head section">
  1091. <div class="sec-title">今日建议动作</div>
  1092. </div>
  1093. <div class="pad" id="dim-actions"></div>
  1094. <div class="sec-head section">
  1095. <div class="sec-title">最近记录</div>
  1096. <div class="sec-more" onclick="openUpload('')">补充数据 ›</div>
  1097. </div>
  1098. <div class="card" id="dim-records"></div>
  1099. </div>
  1100. </div>
  1101. <!-- ============ 报告上传流程(Task 页) ============ -->
  1102. <div class="screen" id="screen-upload">
  1103. <div class="screen-scroll" style="padding-bottom:0">
  1104. <div class="nav-bar">
  1105. <div class="nb-back" onclick="closeUpload()"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 5l-7 7 7 7"/></svg></div>
  1106. <div class="nb-t">上传健康报告</div>
  1107. </div>
  1108. <div class="up-steps" id="up-steps"></div>
  1109. <!-- 步骤1 选择 -->
  1110. <div id="up-step-pick">
  1111. <div class="up-zone" onclick="pickFile()">
  1112. <div class="uz-ic"><svg width="26" height="26" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 16V4M7 9l5-5 5 5"/><path d="M4 20h16"/></svg></div>
  1113. <div class="uz-t">拍照或选择报告图片</div>
  1114. <div class="uz-s">支持体检报告、化验单、影像报告<br/>自动识别关键指标,识别后可修改</div>
  1115. </div>
  1116. <div class="up-btns" style="padding:0 16px">
  1117. <div class="ub pri" onclick="pickFile()"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 8h3l2-3h6l2 3h3v11H4z"/><circle cx="12" cy="13" r="3.4"/></svg>拍照</div>
  1118. <div class="ub" onclick="pickFile()"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="5" width="18" height="14" rx="2"/><path d="M3 15l5-4 4 3 3-2 6 4"/></svg>相册</div>
  1119. </div>
  1120. <div class="sec-head section"><div class="sec-title">已上传待确认</div></div>
  1121. <div class="card" id="up-pending"></div>
  1122. </div>
  1123. <!-- 步骤2 识别中 -->
  1124. <div id="up-step-ocr" style="display:none">
  1125. <div class="up-preview">
  1126. <div class="up-thumb">
  1127. <div class="paper">
  1128. <div class="pl t"></div><div class="pl"></div><div class="pl"></div><div class="pl" style="width:70%"></div><div class="pl"></div><div class="pl" style="width:60%"></div>
  1129. </div>
  1130. <div class="badge-ok"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><path d="M4 12l5 5 11-11"/></svg>已选</div>
  1131. </div>
  1132. <div class="up-meta">
  1133. <div class="up-fname"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="var(--ink-3)" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><path d="M14 2v6h6"/></svg>体检报告_20260928.jpg</div>
  1134. <div class="up-fmeta">2.4 MB · 等待识别解析</div>
  1135. </div>
  1136. </div>
  1137. <div class="ocr-box">
  1138. <div style="display:flex;align-items:center;gap:8px">
  1139. <div style="font-size:var(--fs-md);font-weight:700">正在智能识别</div>
  1140. <div style="margin-left:auto;font-size:var(--fs-sm);font-weight:800;color:var(--brand)" id="ocr-pct">0%</div>
  1141. </div>
  1142. <div class="ocr-bar"><div class="of" id="ocr-fill" style="width:0%"></div></div>
  1143. <div style="margin-top:10px" id="ocr-steps"></div>
  1144. </div>
  1145. </div>
  1146. <!-- 步骤3 确认 -->
  1147. <div id="up-step-fix" style="display:none">
  1148. <div class="ocr-box" style="margin-top:14px">
  1149. <div style="display:flex;align-items:center;gap:8px;margin-bottom:4px">
  1150. <div style="font-size:var(--fs-md);font-weight:700">识别结果确认</div>
  1151. <div style="margin-left:auto"><span class="low-conf">2 项需确认</span></div>
  1152. </div>
  1153. <div style="font-size:var(--fs-sm);color:var(--ink-3);line-height:1.5">已自动填入 6 项指标,标黄项置信度低,请核对</div>
  1154. </div>
  1155. <div class="card" id="up-fix-list"></div>
  1156. <div class="card" style="background:var(--brand-soft);box-shadow:none">
  1157. <div style="display:flex;gap:10px;align-items:flex-start">
  1158. <div style="color:var(--brand);flex:none;margin-top:1px"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M12 11v5M12 8h.01"/></svg></div>
  1159. <div>
  1160. <div style="font-size:var(--fs-base);font-weight:700;color:var(--brand-ink)">数据仅用于家庭健康参考</div>
  1161. <div style="font-size:var(--fs-sm);color:var(--brand-ink);opacity:.8;margin-top:4px;line-height:1.5">报告解读不构成医疗诊断,如有异常请及时就医</div>
  1162. </div>
  1163. </div>
  1164. </div>
  1165. </div>
  1166. <!-- 步骤4 完成 -->
  1167. <div id="up-step-done" style="display:none">
  1168. <div style="text-align:center;padding:40px 24px 20px">
  1169. <div style="width:88px;height:88px;border-radius:50%;background:var(--dim-action-soft);color:var(--ok);display:flex;align-items:center;justify-content:center;margin:0 auto 18px">
  1170. <svg width="44" height="44" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M4 12l5 5 11-11"/></svg>
  1171. </div>
  1172. <div style="font-size:var(--fs-xl);font-weight:800">报告已归档</div>
  1173. <div style="font-size:var(--fs-sm);color:var(--ink-2);margin-top:8px;line-height:1.6">已识别 6 项指标并计入「身」维度<br/>综合能量 <b style="color:var(--ok)">+3 分</b></div>
  1174. </div>
  1175. <div class="card" id="up-done-list"></div>
  1176. </div>
  1177. </div>
  1178. <div class="up-actions" id="up-actions"></div>
  1179. </div>
  1180. <!-- ============ 成长报告与分享(Task 页) ============ -->
  1181. <div class="screen" id="screen-report">
  1182. <div class="screen-scroll" style="padding-bottom:24px">
  1183. <div class="nav-bar">
  1184. <div class="nb-back" onclick="backTo('growth')"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 5l-7 7 7 7"/></svg></div>
  1185. <div class="nb-t">成长报告</div>
  1186. <div class="nb-a" onclick="toast('已保存为图片')">保存图片</div>
  1187. </div>
  1188. <div class="rpt-tabs" id="rpt-tabs">
  1189. <div class="rtt on" data-rp="week" onclick="setRptRange('week', this)">本周报告</div>
  1190. <div class="rtt" data-rp="month" onclick="setRptRange('month', this)">本月报告</div>
  1191. </div>
  1192. <div id="rpt-card-slot"></div>
  1193. <div class="share-actions" id="rpt-share"></div>
  1194. <div class="sec-head section">
  1195. <div class="sec-title">五维里程碑</div>
  1196. <div class="sec-more" onclick="toast('查看全部徽章')">全部 ›</div>
  1197. </div>
  1198. <div class="badge-grid" id="rpt-badges"></div>
  1199. <div class="sec-head section">
  1200. <div class="sec-title">本周亮点</div>
  1201. </div>
  1202. <div class="card" id="rpt-highlights"></div>
  1203. </div>
  1204. </div>
  1205. <!-- ============ 肠道问卷(0元入口) ============ -->
  1206. <div class="screen" id="screen-quiz">
  1207. <div class="screen-scroll" style="padding-bottom:0">
  1208. <div class="nav-bar">
  1209. <div class="nb-back" onclick="backTo('home')"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 5l-7 7 7 7"/></svg></div>
  1210. <div class="nb-t">肠道健康自评</div>
  1211. <div class="nb-a" onclick="toast('免费 · 不需要付费')">免费</div>
  1212. </div>
  1213. <div class="qz-prog">
  1214. <div class="qp-bar"><i id="qz-bar" style="width:0%"></i></div>
  1215. <div class="qp-tx" id="qz-idx">1 / 10</div>
  1216. </div>
  1217. <div class="qz-wrap">
  1218. <div class="qz-q">
  1219. <div class="qq-dim" id="qz-dim"></div>
  1220. <div class="qq-t" id="qz-title"></div>
  1221. <div class="qz-opts" id="qz-opts"></div>
  1222. </div>
  1223. </div>
  1224. <div class="up-actions" id="qz-actions"></div>
  1225. <div class="legal" id="legal-note" style="display:none;padding-top:14px">
  1226. 以下问题用于判断是否需要优先就医。本问卷为健康管理筛查参考,<b>不构成医疗诊断</b>。<br/>身体不适请到正规医疗机构就诊。
  1227. </div>
  1228. </div>
  1229. </div>
  1230. <!-- ============ 风险结果 + 9.9 陪跑转化 ============ -->
  1231. <div class="screen" id="screen-risk">
  1232. <div class="screen-scroll" style="padding-bottom:24px">
  1233. <div class="nav-bar">
  1234. <div class="nb-back" onclick="backTo('home')"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 5l-7 7 7 7"/></svg></div>
  1235. <div class="nb-t">你的肠道风险评估</div>
  1236. </div>
  1237. <div id="risk-slot"></div>
  1238. <div id="prep-slot"></div>
  1239. <div id="risk-actions"></div>
  1240. </div>
  1241. </div>
  1242. <!-- ============ 9.9 陪跑 7 天 ============ -->
  1243. <div class="screen" id="screen-prep">
  1244. <div class="screen-scroll" style="padding-bottom:24px">
  1245. <div class="nav-bar">
  1246. <div class="nb-back" onclick="backTo('home')"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 5l-7 7 7 7"/></svg></div>
  1247. <div class="nb-t">检测前 7 天准备</div>
  1248. <div class="nb-a" onclick="toast('9.9 未完成 3 天可退')">可退</div>
  1249. </div>
  1250. <div class="prep-card">
  1251. <div class="pc-t">检测前的肠道准备期</div>
  1252. <div class="pc-s">菌群检测有个前提:检测前 3–7 天不能有抗生素、不能大量摄入益生菌、饮食要稳定,否则数据会失真。<b>这 7 天需要有人带你调。</b></div>
  1253. <div class="prep-price"><span class="pp-n">9.9</span><span class="pp-u">元 · 7 天陪跑</span></div>
  1254. <div class="d7-grid" id="prep-d7"></div>
  1255. <div class="d7-ach">
  1256. <div class="da"><div class="v">6/7</div><div class="l">已完成</div></div>
  1257. <div class="da"><div class="v">4→7</div><div class="l">饮食结构</div></div>
  1258. <div class="da"><div class="v">80%</div><div class="l">准备度</div></div>
  1259. </div>
  1260. </div>
  1261. <div class="sec-head section"><div class="sec-title">这 7 天会做什么</div></div>
  1262. <div class="prep-list" id="prep-list"></div>
  1263. <div class="sec-head section">
  1264. <div class="sec-title">第 7 天你将拿到</div>
  1265. </div>
  1266. <div class="prep-list" id="prep-output"></div>
  1267. <div class="card" style="background:var(--brand-soft);box-shadow:none">
  1268. <div style="display:flex;gap:10px;align-items:flex-start">
  1269. <div style="color:var(--brand);flex:none;margin-top:1px"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M12 11v5M12 8h.01"/></svg></div>
  1270. <div>
  1271. <div style="font-size:var(--fs-base);font-weight:700;color:var(--brand-ink)">9.9 不打折,这是专业流程必需的一段</div>
  1272. <div style="font-size:var(--fs-sm);color:var(--brand-ink);opacity:.82;margin-top:4px;line-height:1.55">检测本身由你自费(¥1980,可分期),我们赠送的是检测前的准备、检测后的专家解读与 90 天干预方案</div>
  1273. </div>
  1274. </div>
  1275. </div>
  1276. </div>
  1277. </div>
  1278. <!-- ============ D7 报告(转化关键) ============ -->
  1279. <div class="screen" id="screen-report7">
  1280. <div class="screen-scroll" style="padding-bottom:0">
  1281. <div class="nav-bar">
  1282. <div class="nb-back" onclick="backTo('home')"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 5l-7 7 7 7"/></svg></div>
  1283. <div class="nb-t">你的第 7 天报告</div>
  1284. <div class="nb-a" onclick="toast('已保存为长图')">保存</div>
  1285. </div>
  1286. <!-- 屏1 成就 -->
  1287. <div class="report-hd">
  1288. <div class="rph-big">6/7</div>
  1289. <div class="rph-sub">你完成了 6 天的准备 · 超过 78% 的用户</div>
  1290. </div>
  1291. <div class="report-hero">
  1292. <div class="rp-t">检测这件事,七成功夫在检测之前</div>
  1293. <div class="rp-s">你这 7 天做的,正是那七成。<br/>把基础打好了,接下来才能看清肠道里的答案。</div>
  1294. <div class="d7-grid" style="margin-top:16px">
  1295. <div class="d7-cell done">一</div><div class="d7-cell done">二</div><div class="d7-cell done">三</div>
  1296. <div class="d7-cell done">四</div><div class="d7-cell done">五</div><div class="d7-cell done">六</div>
  1297. <div class="d7-cell" style="opacity:.35">日</div>
  1298. </div>
  1299. </div>
  1300. <!-- 屏2 数据 -->
  1301. <div class="sec-head section"><div class="sec-title">这 7 天的变化</div></div>
  1302. <div class="trend-box" id="d7-trend"></div>
  1303. <!-- 屏3 发现 -->
  1304. <div class="sec-head section"><div class="sec-title">3 个值得注意的模式</div></div>
  1305. <div id="d7-finds"></div>
  1306. <!-- 屏4 准备度 -->
  1307. <div class="sec-head section">
  1308. <div class="sec-title">检测准备度</div>
  1309. <div class="sec-more">4 / 5 项完成</div>
  1310. </div>
  1311. <div class="trend-box">
  1312. <div id="d7-checks"></div>
  1313. <div style="text-align:center;padding-top:14px;border-top:1px solid var(--line);margin-top:6px">
  1314. <div style="font-size:40px;font-weight:800;color:var(--brand)">80%</div>
  1315. <div style="font-size:var(--fs-sm);color:var(--ink-3);margin-top:2px;font-weight:600">准备度良好,可以检测了</div>
  1316. </div>
  1317. <div class="find-card" style="margin:12px 0 0;box-shadow:none;background:var(--bg-soft)">
  1318. <div class="fc-obs" style="margin-top:0">还差最后一步:<b>检测前 24 小时请保持饮食清淡</b>,不要聚餐、不要大量摄入高纤维食品。完成这步,你的检测数据会更可靠。</div>
  1319. </div>
  1320. </div>
  1321. <!-- 屏5 缺口 -->
  1322. <div class="sec-head section"><div class="sec-title">这 7 天解决了基础,但回答不了根本</div></div>
  1323. <div class="gap-2col" style="margin:0 16px">
  1324. <div class="gap-col know"><div class="gc-h">你已知道</div>
  1325. <li>饮食结构在改善</li><li>腹胀在减轻</li><li>作息开始规律</li></div>
  1326. <div class="gap-col unk"><div class="gc-h">你还不知道</div>
  1327. <li>菌群多样性水平</li><li>哪些菌在减少</li><li>肠道问题根源</li></div>
  1328. </div>
  1329. <div class="find-card">
  1330. <div class="fc-obs">说到底,这 7 天你做的是<b>改善环境</b>。但环境变好了,<b>里面住着的东西变没变?</b></div>
  1331. <div class="fc-tip">单靠调整饮食,你是在盲调。检测,是把盲调变成精准调整的第一步。</div>
  1332. </div>
  1333. <!-- 屏6 行动 -->
  1334. <div class="sec-head section"><div class="sec-title">为什么现在做最合适</div></div>
  1335. <div class="why-now">
  1336. <div class="wn-i"><div class="wn-n">1</div><div class="wn-t">这 7 天的改善<b>能被检测看见</b>——如果拖到下个月再看,这 7 天的效果就看不出来了</div></div>
  1337. <div class="wn-i"><div class="wn-n">2</div><div class="wn-t">准备度已达 <b>80%</b>——再晚,检测前干扰因素会降低数据准确性</div></div>
  1338. </div>
  1339. <div class="buy-card">
  1340. <div class="buy-hd">
  1341. <div class="bh-t">肠道菌群检测</div>
  1342. <div class="bh-p"><span class="bh-n">¥1980</span><span class="bh-u">检测机构收取</span><span class="bh-o">已抵扣 9.9</span></div>
  1343. </div>
  1344. <div class="buy-bd">
  1345. <div class="buy-line"><span class="bl-t">采样盒</span><span class="bl-v" style="color:var(--ok)">免邮寄送</span></div>
  1346. <div class="buy-line"><span class="bl-t">专业机构检测 + 报告</span><span class="bl-v">含</span></div>
  1347. <div class="buy-line"><span class="bl-t">专家逐项解读(30 分钟)</span><span class="bl-v" style="color:var(--ok)">我们赠送</span></div>
  1348. <div class="buy-line"><span class="bl-t">90 天干预方案</span><span class="bl-v" style="color:var(--ok)">我们赠送</span></div>
  1349. </div>
  1350. </div>
  1351. <div class="installment">
  1352. <div style="color:var(--brand);flex:none"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="5" width="20" height="14" rx="2"/><path d="M2 10h20"/></svg></div>
  1353. <div><div class="in-n">可分期 · ¥660 × 3 期</div><div class="in-t">月付约 20 元 / 天,不收利息</div></div>
  1354. </div>
  1355. <div class="card">
  1356. <div style="display:flex;align-items:center;gap:9px;padding:6px 0;font-size:var(--fs-sm)">
  1357. <span style="color:var(--ok)"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M4 12l5 5 11-11"/></svg></span>
  1358. <span style="color:var(--ink-2)">检测前随时可退 · 检测后 48 小时内可退</span>
  1359. </div>
  1360. <div style="display:flex;align-items:center;gap:9px;padding:6px 0;font-size:var(--fs-sm)">
  1361. <span style="color:var(--ok)"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M4 12l5 5 11-11"/></svg></span>
  1362. <span style="color:var(--ink-2)">不需要自己去医院,采样盒寄回家</span>
  1363. </div>
  1364. </div>
  1365. <div class="up-actions">
  1366. <button class="btn-primary" onclick="toast('进入检测预约')">立即预约检测</button>
  1367. <button class="btn-ghost" onclick="backTo('home')">再想想</button>
  1368. </div>
  1369. <div class="legal">本报告基于健康管理目的生成,不构成医疗诊断或治疗建议<br/>肠道菌群检测为健康管理参考,不用于疾病诊断</div>
  1370. </div>
  1371. </div>
  1372. <!-- 五维抽屉 -->
  1373. <div class="sheet-mask" id="dim-mask" onclick="closeDim()"></div>
  1374. <div class="sheet" id="dim-sheet">
  1375. <div class="sheet-grip"></div>
  1376. <div class="sheet-title">五维能量</div>
  1377. <div class="sheet-sub">身·心·智·行·富,看见全家看得见的健康闭环</div>
  1378. <div class="dim-grid" id="dim-grid"></div>
  1379. <div id="dim-more" style="display:none;margin-top:14px">
  1380. <button class="btn-primary" style="display:flex;align-items:center;justify-content:center;gap:7px" onclick="openOverviewFromSheet()">
  1381. <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 17l5-5 4 4 8-8"/><path d="M16 8h4v4"/></svg>
  1382. 展开五维总览
  1383. </button>
  1384. <div style="text-align:center;font-size:var(--fs-xs);color:var(--ink-3);margin-top:10px">雷达 · 趋势 · 家人对比 · 行动建议</div>
  1385. </div>
  1386. </div>
  1387. <!-- 自定义 TabBar -->
  1388. <div class="tabbar" id="tabbar">
  1389. <div class="tab on" data-tab="home" onclick="setTab('home')">
  1390. <span class="t-ic"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 10.5 12 3l9 7.5"/><path d="M5 9.5V20a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9.5"/><path d="M9.5 21v-6h5v6"/></svg></span>
  1391. <span class="t-tx">首页</span>
  1392. </div>
  1393. <div class="tab" data-tab="health" onclick="setTab('health')">
  1394. <span class="t-ic"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 20s-7-4.4-7-9.5A4 4 0 0 1 12 7a4 4 0 0 1 7 3.5C19 15.6 12 20 12 20z"/><path d="M5 12h3l2-3 2.5 4 1.5-2H20" stroke-width="1.6"/></svg></span>
  1395. <span class="t-tx">健康</span>
  1396. </div>
  1397. <div class="tab-center" onclick="openDim()">
  1398. <div class="c-btn"><svg width="26" height="26" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2l2.4 6.3L21 9.3l-5 4.4L17.5 21 12 17l-5.5 4L8 13.7l-5-4.4 6.6-1z"/></svg></div>
  1399. <div class="c-tx">五维</div>
  1400. </div>
  1401. <div class="tab" data-tab="growth" onclick="setTab('growth')">
  1402. <span class="t-ic"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 17l5-5 4 4 8-8"/><path d="M16 8h4v4"/></svg></span>
  1403. <span class="t-tx">成长</span>
  1404. </div>
  1405. <div class="tab" data-tab="profile" onclick="setTab('profile')">
  1406. <span class="t-ic"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="8" r="4"/><path d="M4 20c0-4 4-6 8-6s8 2 8 6"/></svg></span>
  1407. <span class="t-tx">我的</span>
  1408. </div>
  1409. </div>
  1410. <div class="toast" id="toast"></div>
  1411. <!-- 成果解锁横幅(完成任务/达成成就时浮现) -->
  1412. <div class="unlock-toast" id="unlock-toast">
  1413. <div class="ut-ic" id="unlock-ic"></div>
  1414. <div style="flex:1;min-width:0">
  1415. <div class="ut-t" id="unlock-t">成就解锁</div>
  1416. <div class="ut-s" id="unlock-s"></div>
  1417. </div>
  1418. <div onclick="openReport()" style="flex:none;font-size:var(--fs-sm);font-weight:800;color:#7C2D12">分享 ›</div>
  1419. </div>
  1420. <!-- 闪屏(还原原 flash 页暖色基因,作为进入 App 的第一屏) -->
  1421. <div id="splash" onclick="hideSplash()">
  1422. <div class="sp-bg">
  1423. <span class="sp-c sp-c1"></span>
  1424. <span class="sp-c sp-c2"></span>
  1425. <span class="sp-c sp-c3"></span>
  1426. </div>
  1427. <div class="sp-body">
  1428. <div class="sp-logo"><svg width="34" height="34" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2l2.4 6.3L21 9.3l-5 4.4L17.5 21 12 17l-5.5 4L8 13.7l-5-4.4 6.6-1z"/></svg></div>
  1429. <div class="sp-name">浠艾福</div>
  1430. <div class="sp-en">Care Family</div>
  1431. <div class="sp-id">看见全家 · 了解健康 · 主动管理</div>
  1432. <div class="sp-dims">
  1433. <div class="sp-dim"><span class="sp-dc" style="background:#FF8C42">身</span></div>
  1434. <div class="sp-dim"><span class="sp-dc" style="background:#FF6B9D">心</span></div>
  1435. <div class="sp-dim"><span class="sp-dc" style="background:#6366F1">智</span></div>
  1436. <div class="sp-dim"><span class="sp-dc" style="background:#10B981">行</span></div>
  1437. <div class="sp-dim"><span class="sp-dc" style="background:#F59E0B">富</span></div>
  1438. </div>
  1439. <div class="sp-tag">家里每个人的状态,你真的看见了?</div>
  1440. </div>
  1441. <div class="sp-dots"><span></span><span></span><span></span></div>
  1442. <div class="sp-enter">轻触进入</div>
  1443. </div>
  1444. </div>
  1445. </div>
  1446. <script>
  1447. /* ============ 数据(演示,已去个人化) ============ */
  1448. var DIMS = [
  1449. { code:'body', name:'身', desc:'主动健康', color:'var(--dim-body)', soft:'var(--dim-body-soft)', score:84 },
  1450. { code:'mind', name:'心', desc:'大爱相随', color:'var(--dim-mind)', soft:'var(--dim-mind-soft)', score:72 },
  1451. { code:'wisdom', name:'智', desc:'赋能未来', color:'var(--dim-wisdom)', soft:'var(--dim-wisdom-soft)', score:79 },
  1452. { code:'action', name:'行', desc:'人际和谐', color:'var(--dim-action)', soft:'var(--dim-action-soft)', score:68 },
  1453. { code:'wealth', name:'富', desc:'利他创富', color:'var(--dim-wealth)', soft:'var(--dim-wealth-soft)', score:75 }
  1454. ];
  1455. var TASKS = [
  1456. { title:'陪小宇完成 20 分钟跳绳', pts:10, dim:'body' },
  1457. { title:'小柚英语绘本阅读', pts:8, dim:'wisdom' },
  1458. { title:'家庭晚餐不玩手机', pts:5, dim:'action' }
  1459. ];
  1460. var CHALLENGES = [
  1461. { title:'21 天亲子共读', prog:14, total:21, dim:'wisdom' },
  1462. { title:'全家每周运动 3 次', prog:2, total:3, dim:'body' }
  1463. ];
  1464. var FEED = [
  1465. { icon:'check', color:'var(--dim-body)', text:'<b>小宇</b> 完成「跳绳打卡」 +10 分', time:'12 分钟前' },
  1466. { icon:'star', color:'var(--dim-wisdom)', text:'<b>小柚</b> 认知测评得分 85', time:'1 小时前' },
  1467. { icon:'heart', color:'var(--dim-mind)', text:'<b>爷爷</b> 完成今日情绪打卡', time:'今天 08:30' }
  1468. ];
  1469. var RECS = [
  1470. { cat:'主动健康', c:1, t:'孩子挑食怎么办?3 个温和的引导法', meta:'1.2万 阅读', bg:'var(--dim-body)' },
  1471. { cat:'赋能未来', c:2, t:'0-12 岁专注力培养路线图', meta:'8621 阅读', bg:'var(--dim-wisdom)' },
  1472. { cat:'人际和谐', c:3, t:'把“你怎么又…”换成这样说话', meta:'1.5万 阅读', bg:'var(--dim-action)' },
  1473. { cat:'大爱相随', c:4, t:'父母的情绪,是家的天气', meta:'2.3万 阅读', bg:'var(--dim-mind)' }
  1474. ];
  1475. var ACH = [
  1476. { ic:'coin', c:'var(--dim-wealth)', v:'2480', l:'积分' },
  1477. { ic:'flame', c:'var(--dim-mind)', v:'12', l:'连续打卡' },
  1478. { ic:'check', c:'var(--brand)', v:'48', l:'完成任务' },
  1479. { ic:'gift', c:'var(--dim-wealth)', v:'9', l:'获得奖励' },
  1480. { ic:'medal', c:'var(--dim-mind)', v:'6', l:'勋章' },
  1481. { ic:'book', c:'var(--dim-action)', v:'23', l:'成长记录' },
  1482. { ic:'target', c:'var(--brand)', v:'3', l:'挑战' },
  1483. { ic:'upload', c:'var(--dim-body)', v:'11', l:'报告' }
  1484. ];
  1485. var PROG = [
  1486. { ic:'diet', c:'var(--dim-body)', l:'饮食记录', done:true },
  1487. { ic:'run', c:'var(--dim-body)', l:'运动打卡', done:true },
  1488. { ic:'moon', c:'var(--dim-mind)', l:'睡眠记录', done:true },
  1489. { ic:'smile', c:'var(--dim-mind)', l:'情绪打卡', done:false },
  1490. { ic:'bulb', c:'var(--dim-wisdom)', l:'专注练习', done:false },
  1491. { ic:'people', c:'var(--dim-action)', l:'互动记录', done:false }
  1492. ];
  1493. /* ===== 新增:五维总览 / 维度详情 / 上传 / 报告 数据 ===== */
  1494. var TREND = {
  1495. week: {
  1496. labels: ['周一','周二','周三','周四','周五','周六','周日'],
  1497. lines: [
  1498. { name:'综合', color:'var(--brand)', data:[72,73,75,74,76,75,76] },
  1499. { name:'身', color:'var(--dim-body)', data:[80,81,82,81,84,83,84] },
  1500. { name:'心', color:'var(--dim-mind)', data:[68,70,69,71,72,71,72] }
  1501. ]
  1502. },
  1503. month: {
  1504. labels: ['1日','5日','10日','15日','20日','25日','30日'],
  1505. lines: [
  1506. { name:'综合', color:'var(--brand)', data:[70,71,73,72,74,75,76] },
  1507. { name:'身', color:'var(--dim-body)', data:[78,79,81,80,82,83,84] },
  1508. { name:'心', color:'var(--dim-mind)', data:[66,68,67,70,71,71,72] }
  1509. ]
  1510. }
  1511. };
  1512. var FAMILY = [
  1513. { name:'小宇', role:'儿子 · 10 岁', score:84, color:'var(--dim-body)', dim:'body' },
  1514. { name:'小柚', role:'女儿 · 7 岁', score:79, color:'var(--dim-wisdom)', dim:'wisdom' },
  1515. { name:'爷爷', role:'父亲 · 68 岁', score:68, color:'var(--dim-action)', dim:'action' },
  1516. { name:'妈妈', role:'本人', score:72, color:'var(--dim-mind)', dim:'mind' }
  1517. ];
  1518. var ADVICE = [
  1519. { dim:'action', icon:'people', pri:'高', priColor:'var(--danger)', priSoft:'rgba(239,83,80,0.12)', t:'本周家庭互动偏少', s:'「行」维度 4 天未记录互动,建议每天 15 分钟无手机陪伴对话' },
  1520. { dim:'mind', icon:'moon', pri:'中', priColor:'#B45309', priSoft:'rgba(245,158,11,0.14)', t:'爷爷睡眠时长不足', s:'近 7 天平均 6.2 小时,建议固定就寝时间并晚间减少摄入' },
  1521. { dim:'body', icon:'run', pri:'中', priColor:'#B45309', priSoft:'rgba(245,245,158,0.6)', t:'小宇运动量达标', s:'本周运动 4 次达标,保持每周 3 次以上的节奏' }
  1522. ];
  1523. var DIM_METRICS = {
  1524. body: [
  1525. { n:'BMI', v:'18.6', r:'正常范围 18.5-23.9', ref:'ok', unit:'' },
  1526. { n:'血压', v:'112/68', r:'低于 120/80 理想值', ref:'ok', unit:'mmHg' },
  1527. { n:'静息心率', v:'72', r:'略高于同龄均值 68', ref:'mid', unit:'bpm' },
  1528. { n:'维生素 D', v:'22.4', r:'低于建议下限 30', ref:'hi', unit:'ng/mL' }
  1529. ],
  1530. mind: [
  1531. { n:'情绪稳定性', v:'72', r:'较上周 +5', ref:'ok', unit:'分' },
  1532. { n:'平均睡眠', v:'6.8', r:'低于建议 7-9 小时', ref:'mid', unit:'小时' },
  1533. { n:'压力感知', v:'偏高', r:'近 3 次自评持续偏高', ref:'hi', unit:'' }
  1534. ]
  1535. };
  1536. var DIM_ACTIONS = {
  1537. body: [
  1538. { t:'每日 6000 步', s:'今日已 4200 步,还差 1800 步', ic:'run', c:'var(--dim-body)' },
  1539. { t:'早餐补充优质蛋白', s:'鸡蛋 1 个 + 豆浆 250ml', ic:'diet', c:'var(--dim-body)' },
  1540. { t:'晒太阳 15 分钟', s:'维生素 D 偏低,建议上午户外', ic:'bulb', c:'var(--dim-action)' }
  1541. ],
  1542. mind: [
  1543. { t:'记录今日情绪', s:'30 秒快速打卡', ic:'smile', c:'var(--dim-mind)' },
  1544. { t:'4-7-8 呼吸练习', s:'睡前 3 轮,改善入睡', ic:'moon', c:'var(--dim-mind)' },
  1545. { t:'亲子对话 15 分钟', s:'放下手机,专心倾听', ic:'people', c:'var(--dim-action)' }
  1546. ]
  1547. };
  1548. var DIM_RECORDS = {
  1549. body: [
  1550. { t:'跳绳打卡', m:'今天 17:20 · 200 个', ic:'run', c:'var(--dim-body)' },
  1551. { t:'饮食记录', m:'今天 12:10 · 3 餐已记录', ic:'diet', c:'var(--dim-body)' },
  1552. { t:'体检报告解析', m:'9-28 · 6 项指标已归档', ic:'upload', c:'var(--dim-body)' }
  1553. ],
  1554. mind: [
  1555. { t:'情绪打卡', m:'今天 08:30 · 心情平稳', ic:'smile', c:'var(--dim-mind)' },
  1556. { t:'睡眠记录', m:'今天 07:10 · 7 小时 20 分', ic:'moon', c:'var(--dim-mind)' },
  1557. { t:'冥想练习', m:'昨天 21:40 · 8 分钟', ic:'flame', c:'var(--dim-mind)' }
  1558. ]
  1559. };
  1560. var BADGES = [
  1561. { n:'连续打卡 7 天', d:'已完成', ic:'flame', c:'var(--dim-mind)', locked:false },
  1562. { n:'五维首次全测', d:'已完成', ic:'check', c:'var(--dim-body)', locked:false },
  1563. { n:'亲子共读 21 天', d:'14/21 天', ic:'book', c:'var(--dim-wisdom)', locked:false },
  1564. { n:'运动达人', d:'本周 4 次达标', ic:'run', c:'var(--dim-action)', locked:false },
  1565. { n:'健康档案师', d:'上传 10 份报告', ic:'upload', c:'var(--dim-body)', locked:true },
  1566. { n:'财富启蒙', d:'完成 5 课', ic:'coin', c:'var(--dim-wealth)', locked:true }
  1567. ];
  1568. var OCR_STEPS = [
  1569. { t:'图像预处理与矫正', ms:400 },
  1570. { t:'定位表格与字段区域', ms:600 },
  1571. { t:'识别文字与数值', ms:900 },
  1572. { t:'匹配健康指标库', ms:500 }
  1573. ];
  1574. var FIX_FIELDS = [
  1575. { n:'身高', v:'142', u:'cm', low:true },
  1576. { n:'体重', v:'37.6', u:'kg', low:true },
  1577. { n:'收缩压', v:'112', u:'mmHg', low:false },
  1578. { n:'舒张压', v:'68', u:'mmHg', low:false },
  1579. { n:'静息心率', v:'72', u:'bpm', low:false },
  1580. { n:'血红蛋白', v:'132', u:'g/L', low:false }
  1581. ];
  1582. function svgUse(icon, size) {
  1583. return '<svg width="'+size+'" height="'+size+'" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><use href="#i-'+icon+'"/></svg>';
  1584. }
  1585. /* ===== 五维能量环(5 段同心弧) ===== */
  1586. function buildRing(el, scores, size) {
  1587. var ns='http://www.w3.org/2000/svg';
  1588. var cx=size/2, cy=size/2;
  1589. var html='<svg width="'+size+'" height="'+size+'" viewBox="0 0 '+size+' '+size+'">';
  1590. var gap=7, maxR=size/2-6;
  1591. scores.forEach(function(d,i){
  1592. var r=maxR-i*(gap+8);
  1593. var c=2*Math.PI*r;
  1594. var frac=Math.max(0.04, d.score/100);
  1595. html+='<circle cx="'+cx+'" cy="'+cy+'" r="'+r+'" fill="none" stroke="rgba(255,255,255,0.12)" stroke-width="7"/>';
  1596. html+='<circle cx="'+cx+'" cy="'+cy+'" r="'+r+'" fill="none" stroke="'+d.color+'" stroke-width="7" stroke-linecap="round" '+
  1597. 'stroke-dasharray="'+(c*frac)+' '+(c-c*frac)+'" transform="rotate(-90 '+cx+' '+cy+')" style="transition:stroke-dasharray .6s cubic-bezier(.23,1,.32,1)"/>';
  1598. });
  1599. html+='</svg>';
  1600. html+='<div class="ring-center"><div class="rc-val">'+ (Math.round(scores.reduce(function(s,d){return s+d.score},0)/scores.length)) +'</div><div class="rc-lab">综合能量</div></div>';
  1601. el.innerHTML=html;
  1602. }
  1603. /* ===== 渲染各模块 ===== */
  1604. function renderHome() {
  1605. buildRing(document.getElementById('hero-ring'), DIMS, 132);
  1606. var bars='';
  1607. DIMS.forEach(function(d){
  1608. bars+='<div class="dbar"><span class="dl">'+d.name+'</span><div class="dt"><div class="df" style="width:'+d.score+'%;background:'+d.color+'"></div></div><span class="dv">'+d.score+'</span></div>';
  1609. });
  1610. document.getElementById('hero-bars').innerHTML=bars;
  1611. var tc=document.getElementById('task-card');
  1612. if (!TASKS.length) {
  1613. tc.innerHTML='<div class="empty-state"><div class="es-ic">'+svgUse('check',28)+'</div><div class="es-t">今日任务已清空</div><div class="es-s">去任务中心看看,保持成长节奏</div></div>';
  1614. } else {
  1615. tc.className='card stagger';
  1616. tc.innerHTML=TASKS.map(function(t){
  1617. return '<div class="row"><div class="rk" style="background:'+dimSoft(t.dim)+';color:'+dimColor(t.dim)+'">'+svgUse('target',18)+'</div>'+
  1618. '<div class="ri"><div class="rt">'+t.title+'</div><div class="rm">+'+t.pts+' 成长分</div></div>'+
  1619. '<button class="pill-btn" onclick="completeTask(this)">完成</button></div>';
  1620. }).join('');
  1621. }
  1622. var cc=document.getElementById('challenge-card');
  1623. cc.className='card stagger';
  1624. cc.innerHTML=CHALLENGES.map(function(ch){
  1625. var pct=Math.round(ch.prog/ch.total*100);
  1626. return '<div class="row"><div class="rk" style="background:'+dimSoft(ch.dim)+';color:'+dimColor(ch.dim)+'">'+svgUse('target',18)+'</div>'+
  1627. '<div class="ri"><div class="rt">'+ch.title+'</div><div class="rm">'+ch.prog+' / '+ch.total+' · '+pct+'%</div>'+
  1628. '<div style="flex:1;height:6px;background:var(--bg-soft);border-radius:99px;margin-left:8px;max-width:80px"><div style="height:100%;width:'+pct+'%;background:'+dimColor(ch.dim)+';border-radius:99px"></div></div></div>';
  1629. }).join('');
  1630. document.getElementById('feed-card').innerHTML=FEED.map(function(f){
  1631. return '<div class="feed-item"><div class="feed-dot" style="color:'+f.color+'">'+svgUse(f.icon,16)+'</div>'+
  1632. '<div style="flex:1"><div class="fi-t">'+f.text+'</div><div class="fi-time">'+f.time+'</div></div></div>';
  1633. }).join('');
  1634. document.getElementById('rec-scroll').innerHTML=RECS.map(function(r){
  1635. return '<div class="rec-card" onclick="toast(\'打开文章\')"><div class="rec-cover" style="background:linear-gradient(135deg,'+r.bg+','+r.bg+'99)"></div>'+
  1636. '<div class="rec-body"><span class="rec-cat" style="background:'+r.bg+'22;color:'+r.bg+'">'+r.cat+'</span>'+
  1637. '<div class="rec-tt">'+r.t+'</div><div class="rec-meta">'+r.meta+'</div></div></div>';
  1638. }).join('');
  1639. }
  1640. function renderHealth() {
  1641. // 简易雷达(六边形示意)
  1642. var size=240, cx=size/2, cy=size/2, R=size/2-30;
  1643. var labels=['生长','睡眠','视力','免疫','营养','运动'];
  1644. var vals=[84,72,78,80,70,82];
  1645. var n=labels.length, pts=[], pts2=[];
  1646. for (var i=0;i<n;i++){
  1647. var a=-Math.PI/2 + i*2*Math.PI/n;
  1648. pts.push((cx+Math.cos(a)*R).toFixed(1)+','+(cy+Math.sin(a)*R).toFixed(1));
  1649. pts2.push((cx+Math.cos(a)*R*vals[i]/100).toFixed(1)+','+(cy+Math.sin(a)*R*vals[i]/100).toFixed(1));
  1650. }
  1651. var grid='';
  1652. [0.25,0.5,0.75,1].forEach(function(f){
  1653. var p=[]; for(var i=0;i<n;i++){var a=-Math.PI/2+i*2*Math.PI/n; p.push((cx+Math.cos(a)*R*f).toFixed(1)+','+(cy+Math.sin(a)*R*f).toFixed(1));}
  1654. grid+='<polygon points="'+p.join(' ')+'" fill="none" stroke="#EAEDF4"/>';
  1655. });
  1656. var lbls='';
  1657. for(var i=0;i<n;i++){var a=-Math.PI/2+i*2*Math.PI/n; lbls+='<text x="'+(cx+Math.cos(a)*(R+16)).toFixed(1)+'" y="'+(cy+Math.sin(a)*(R+16)+4).toFixed(1)+'" font-size="10" fill="#B49A83" text-anchor="middle">'+labels[i]+'</text>';}
  1658. document.getElementById('radar-card').innerHTML=
  1659. '<svg width="'+size+'" height="'+size+'" viewBox="0 0 '+size+' '+size+'">'+grid+
  1660. '<polygon points="'+pts2.join(' ')+'" fill="rgba(255,140,66,0.18)" stroke="var(--dim-body)" stroke-width="2"/>'+
  1661. '<polygon points="'+pts.join(' ')+'" fill="none" stroke="#EAEDF4" stroke-width="1.5"/>'+lbls+'</svg>'+
  1662. '<div style="font-size:var(--fs-sm);color:var(--ink-2);margin-top:6px">身体维度 · 综合 78 分</div>';
  1663. document.getElementById('report-list').innerHTML=
  1664. '<div class="row" style="padding:10px 0"><div class="rk" style="background:var(--dim-body-soft);color:var(--dim-body)">'+svgUse('upload',16)+'</div><div class="ri"><div class="rt" style="font-size:var(--fs-sm)">体检报告</div><div class="rm">9-28 已解析</div></div></div>'+
  1665. '<div class="row" style="padding:10px 0"><div class="rk" style="background:var(--dim-wisdom-soft);color:var(--dim-wisdom)">'+svgUse('bulb',16)+'</div><div class="ri"><div class="rt" style="font-size:var(--fs-sm)">菌群检测</div><div class="rm">待确认</div></div></div>';
  1666. document.getElementById('quiz-list').innerHTML=
  1667. '<div class="row" style="padding:10px 0"><div class="ri"><div class="rt" style="font-size:var(--fs-sm)">认知能力测评</div></div><button class="pill-btn" onclick="toast(\'开始测评\')">开始</button></div>'+
  1668. '<div class="row" style="padding:10px 0"><div class="ri"><div class="rt" style="font-size:var(--fs-sm)">心理健康测评</div></div><button class="pill-btn" onclick="toast(\'开始测评\')">开始</button></div>';
  1669. document.getElementById('health-rec').innerHTML=RECS.slice(0,3).map(function(r){
  1670. return '<div class="rec-card" onclick="toast(\'查看报告\')"><div class="rec-cover" style="background:linear-gradient(135deg,'+r.bg+','+r.bg+'99)"></div><div class="rec-body"><span class="rec-cat" style="background:'+r.bg+'22;color:'+r.bg+'">'+r.cat+'</span><div class="rec-tt">'+r.t+'</div><div class="rec-meta">'+r.meta+'</div></div></div>';
  1671. }).join('');
  1672. }
  1673. /* ===== 成果状态(可累积,驱动继续完成) ===== */
  1674. var growthState={ doneTasks:{}, baseTasks:12, streak:12, pts:1240, unlocked:false };
  1675. var WEEK_DAYS=['一','二','三','四','五','六','日'];
  1676. function renderGrowth() {
  1677. document.getElementById('today-prog').innerHTML=PROG.map(function(p,i){
  1678. return '<div class="tp-item" onclick="toast(\''+(p.done?'已记录':'去记录')+'\')"><div class="tp-ic" style="background:'+p.c+'1a;color:'+p.c+'">'+svgUse(p.ic,18)+'</div>'+
  1679. '<div style="flex:1"><div class="tp-l">'+p.l+'</div><div class="tp-st '+(p.done?'done':'pend')+'">'+(p.done?'已完成':'去记录')+'</div></div></div>';
  1680. }).join('');
  1681. renderGrowthTasks();
  1682. renderGrowthRec();
  1683. renderAchievementHero();
  1684. }
  1685. function renderGrowthTasks(){
  1686. var html=TASKS.map(function(t,i){
  1687. var done=!!growthState.doneTasks[i];
  1688. return '<div class="task-item'+(done?' done just-done':'')+'" data-i="'+i+'">'+
  1689. '<button class="tk-ck" onclick="doCompleteTask('+i+', this)">'+(done?checkSvg():'')+'</button>'+
  1690. '<div class="tk-bd"><div class="tk-t">'+t.title+'</div>'+
  1691. '<div class="tk-m"><span>'+(done?'已完成 · 家人可看到':'小宇 · 待完成')+'</span></div></div>'+
  1692. '<div class="tk-pts">+'+t.pts+'</div></div>';
  1693. }).join('');
  1694. document.getElementById('growth-tasks').innerHTML=html;
  1695. // 已完成数量与"再完成N项"驱动
  1696. var doneN=Object.keys(growthState.doneTasks).length;
  1697. var total=TASKS.length;
  1698. var next=document.getElementById('growth-next');
  1699. if (doneN>0 && doneN<total){
  1700. next.style.display='block';
  1701. document.getElementById('next-n').textContent=(total-doneN);
  1702. } else if (doneN>=total){
  1703. next.style.display='block';
  1704. document.getElementById('next-n').textContent='0';
  1705. next.querySelector('div').lastChild.textContent=' 全部完成,成果已解锁 🎉';
  1706. } else {
  1707. next.style.display='none';
  1708. }
  1709. // 清理 just-done 动画类
  1710. setTimeout(function(){
  1711. document.querySelectorAll('#growth-tasks .just-done').forEach(function(el){ el.classList.remove('just-done'); });
  1712. }, 1200);
  1713. }
  1714. function checkSvg(){
  1715. return '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="3.4" stroke-linecap="round" stroke-linejoin="round"><path d="M4 12l5 5 11-11"/></svg>';
  1716. }
  1717. function doCompleteTask(i, btn){
  1718. if (growthState.doneTasks[i]) return;
  1719. growthState.doneTasks[i]=true;
  1720. var t=TASKS[i];
  1721. growthState.pts += t.pts;
  1722. renderGrowthTasks();
  1723. renderAchievementHero();
  1724. var doneN=Object.keys(growthState.doneTasks).length;
  1725. if (!growthState.unlocked && doneN>=2){
  1726. growthState.unlocked=true;
  1727. setTimeout(function(){ showUnlock('star','成就解锁 · 本周全勤','已连续完成 2 项任务,坚持就是复利'); }, 420);
  1728. } else {
  1729. toast('完成「'+t.title+'」 · 成长分 +'+t.pts);
  1730. }
  1731. }
  1732. function renderGrowthRec(){
  1733. document.getElementById('growth-rec').innerHTML=CHALLENGES.map(function(ch){
  1734. var pct=Math.round(ch.prog/ch.total*100);
  1735. return '<div class="rec-card" style="width:200px" onclick="toast(\'挑战详情\')"><div class="rec-cover" style="background:linear-gradient(135deg,'+dimColor(ch.dim)+','+dimColor(ch.dim)+'99);height:70px"></div>'+
  1736. '<div class="rec-body"><div class="rec-tt">'+ch.title+'</div><div class="rec-meta">'+ch.prog+'/'+ch.total+' · '+pct+'%</div></div></div>';
  1737. }).join('');
  1738. }
  1739. /* 成果环 + 连击 + 进度条 */
  1740. function renderAchievementHero(){
  1741. var total=growthState.baseTasks + Object.keys(growthState.doneTasks).length;
  1742. var pct=Math.min(1, growthState.baseTasks/total);
  1743. var size=116, sw=10, r=(size-sw)/2, c=2*Math.PI*r;
  1744. var ring='<svg width="'+size+'" height="'+size+'" viewBox="0 0 '+size+' '+size+'">'+
  1745. '<circle cx="'+size/2+'" cy="'+size/2+'" r="'+r+'" fill="none" stroke="rgba(124,45,18,0.12)" stroke-width="'+sw+'"/>'+
  1746. '<circle cx="'+size/2+'" cy="'+size/2+'" r="'+r+'" fill="none" stroke="var(--brand)" stroke-width="'+sw+'" stroke-linecap="round" stroke-dasharray="'+(c*pct).toFixed(1)+' '+(c-c*pct).toFixed(1)+'" transform="rotate(-90 '+size/2+' '+size/2+')" style="transition:stroke-dasharray .7s cubic-bezier(.23,1,.32,1)"/></svg>'+
  1747. '<div class="ah-c"><div class="n">'+growthState.baseTasks+'</div><div class="l">本周任务</div></div>';
  1748. var el=document.getElementById('ach-ring');
  1749. if (el) el.innerHTML=ring;
  1750. var taskPct=Math.min(100, growthState.baseTasks/16*100);
  1751. document.getElementById('ach-task-v').textContent=growthState.baseTasks;
  1752. document.getElementById('ach-task-b').style.width=taskPct+'%';
  1753. document.getElementById('ach-pt-b').style.width=Math.min(100, growthState.pts/1800*100)+'%';
  1754. document.getElementById('ach-bg-b').style.width=(growthState.unlocked? '53%':'40%')+'%';
  1755. document.getElementById('ach-sub').textContent='完成 '+growthState.baseTasks+' 项任务 · 连续打卡 '+growthState.streak+' 天';
  1756. document.getElementById('ach-title').textContent=growthState.unlocked?'本周成果 · 已解锁全勤':'本周成果';
  1757. // 连击 7 天
  1758. var sh='';
  1759. for (var i=0;i<7;i++){
  1760. var done=i<6 || (i===6 && true); // 今天待点亮
  1761. var cls=i===6? 'today' : (done?'done':'');
  1762. sh+='<div class="sd '+cls+'"><div class="dot">'+(i===6?svgUse('flame',15):(done?svgUse('check',15):''))+'</div><div class="dl">'+WEEK_DAYS[i]+'</div></div>';
  1763. }
  1764. document.getElementById('ach-streak').innerHTML=sh;
  1765. }
  1766. /* 解锁横幅 */
  1767. var unlockTimer;
  1768. function showUnlock(icon, title, sub){
  1769. document.getElementById('unlock-ic').innerHTML=svgUse(icon,20);
  1770. document.getElementById('unlock-t').textContent=title;
  1771. document.getElementById('unlock-s').textContent=sub;
  1772. var el=document.getElementById('unlock-toast');
  1773. el.classList.add('show');
  1774. clearTimeout(unlockTimer);
  1775. unlockTimer=setTimeout(function(){ el.classList.remove('show'); }, 2600);
  1776. }
  1777. function renderProfile() {
  1778. document.getElementById('ach-grid').innerHTML=ACH.map(function(a){
  1779. return '<div class="ach"><div class="ai" style="background:'+a.c+'1a;color:'+a.c+'">'+svgUse(a.ic,18)+'</div><div class="av">'+a.v+'</div><div class="al">'+a.l+'</div></div>';
  1780. }).join('');
  1781. }
  1782. function renderDimSheet() {
  1783. document.getElementById('dim-grid').innerHTML=DIMS.map(function(d){
  1784. return '<div class="dim-tile" style="background:'+d.soft+'" onclick="openDimFromSheet(\''+d.code+'\')">'+
  1785. '<div class="dt-ic" style="background:'+d.color+'">'+svgUse('star',20)+'</div>'+
  1786. '<div class="dt-nm">'+d.name+' · '+d.desc+'</div>'+
  1787. '<div class="dt-sc" style="color:'+d.color+'">'+d.score+' 分</div>'+
  1788. '<div class="dt-track"><div class="dt-fill" style="width:'+d.score+'%;background:'+d.color+'"></div></div></div>';
  1789. }).join('');
  1790. var more=document.getElementById('dim-more');
  1791. if (more) more.style.display='block';
  1792. }
  1793. function openDimFromSheet(code){
  1794. closeDim();
  1795. setTimeout(function(){ openDimDetail(code); }, 180);
  1796. }
  1797. function openOverviewFromSheet(){
  1798. closeDim();
  1799. setTimeout(function(){ openOverview(); }, 180);
  1800. }
  1801. function dimColor(code){ var d=DIMS.find(function(x){return x.code===code}); return d?d.color:'var(--brand)'; }
  1802. function dimSoft(code){ var d=DIMS.find(function(x){return x.code===code}); return d?d.soft:'var(--brand-soft)'; }
  1803. function dimByCode(code){ return DIMS.find(function(x){return x.code===code}) || DIMS[0]; }
  1804. /* ===== 肠道问卷 / 风险分级 / 9.9 陪跑 / D7 报告 ===== */
  1805. /* 红旗筛查(必答前置,命中即转就医) */
  1806. var REDFLAG=[
  1807. { t:'最近是否有便血、黑便,或大便带黏液、脓血?', opts:[{t:'没有',s:0},{t:'有',s:1}] },
  1808. { t:'近半年是否有非刻意的体重下降(超过 4 公斤)?', opts:[{t:'没有',s:0},{t:'有',s:1}] },
  1809. { t:'是否有过持续发热(体温超过 37.3℃)伴随排便异常?', opts:[{t:'没有',s:0},{t:'有',s:1}] },
  1810. { t:'是否存在夜间腹泻,或腹痛把你痛醒?', opts:[{t:'没有',s:0},{t:'有',s:1}] },
  1811. { t:'近一年是否出现过缺铁性贫血,或长期乏力头晕?', opts:[{t:'没有',s:0},{t:'有',s:1}] },
  1812. { t:'一级亲属是否有结直肠癌、炎症性肠病或肠易激综合征?', opts:[{t:'没有',s:0},{t:'有',s:1}] },
  1813. { t:'是否有胸痛、胸闷、心悸,或活动后气促?', opts:[{t:'没有',s:0},{t:'有',s:1}] },
  1814. { t:'是否出现过一侧肢体麻木无力、言语不清或口角歪斜?', opts:[{t:'没有',s:0},{t:'有',s:1}] },
  1815. { t:'是否已有心脑血管疾病、糖尿病或肾病的诊断?', opts:[{t:'没有',s:0},{t:'有',s:1}] }
  1816. ];
  1817. /* 基础信息 */
  1818. var BASIC={ gender:'', h:'', w:'', waist:'' };
  1819. /* 五大模块(条件跳转) */
  1820. var MODULES={
  1821. weight:{ name:'肥胖 / 体重', color:'var(--dim-body)', max:7, qs:[
  1822. { t:'近一年你的体重变化', opts:[{t:'基本稳定',s:0},{t:'上升 1–3 公斤',s:1},{t:'上升超过 4 公斤',s:2},{t:'减重后反弹',s:2}] },
  1823. { t:'是否尝试过减重', opts:[{t:'没有尝试',s:0},{t:'试过但没坚持',s:1},{t:'反复减反复反弹',s:2}] },
  1824. { t:'日常主要困扰', opts:[{t:'没有明显困扰',s:0},{t:'爬楼气喘',s:1},{t:'睡眠打鼾',s:2},{t:'关节不适',s:1},{t:'容易乏力',s:1}] }
  1825. ]},
  1826. consti:{ name:'便秘', color:'var(--dim-wealth)', max:8, qs:[
  1827. { t:'近 3 个月你的排便次数', opts:[{t:'每周不超过 2 次',s:2},{t:'每周 3–6 次',s:1},{t:'每天 1–2 次',s:0},{t:'每天超过 2 次',s:0}] },
  1828. { t:'粪便性状(参考布里斯托分型)', opts:[{t:'干球状或硬便',s:2},{t:'正常成形',s:0},{t:'稀软不成形',s:0}] },
  1829. { t:'排便时是否费力、有不尽感或梗阻感', opts:[{t:'从不',s:0},{t:'偶尔',s:1},{t:'经常',s:2}] },
  1830. { t:'是否需要手法辅助才能排出', opts:[{t:'不需要',s:0},{t:'偶尔',s:1},{t:'经常',s:2}] }
  1831. ]},
  1832. diarrhea:{ name:'腹泻', color:'var(--dim-mind)', max:10, qs:[
  1833. { t:'近 4 周你的每日排便次数', opts:[{t:'每天不超过 2 次',s:0},{t:'3 次',s:1},{t:'4 次以上',s:2},{t:'6 次以上',s:3}] },
  1834. { t:'粪便性状', opts:[{t:'正常成形',s:0},{t:'糊状',s:1},{t:'水样',s:2},{t:'油亮有油花',s:2}] },
  1835. { t:'是否伴有腹痛、里急后重或黏液', opts:[{t:'都没有',s:0},{t:'轻微腹痛',s:1},{t:'明显腹痛或里急后重',s:2},{t:'带黏液',s:1}] }
  1836. ]},
  1837. sleep:{ name:'睡眠', color:'var(--dim-wisdom)', max:8, qs:[
  1838. { t:'你的平均睡眠时长', opts:[{t:'7–9 小时',s:0},{t:'6–7 小时',s:1},{t:'不足 6 小时',s:2},{t:'超过 9 小时',s:1}] },
  1839. { t:'入睡是否困难(超过 30 分钟)', opts:[{t:'不困难',s:0},{t:'偶尔',s:1},{t:'几乎每晚',s:2}] },
  1840. { t:'夜间醒来次数', opts:[{t:'没有',s:0},{t:'1 次',s:1},{t:'2 次以上',s:2}] },
  1841. { t:'是否打鼾,或被告知呼吸暂停', opts:[{t:'都不',s:0},{t:'打鼾但无暂停',s:1},{t:'有呼吸暂停',s:2}] }
  1842. ]},
  1843. allergy:{ name:'过敏', color:'var(--dim-action)', max:8, qs:[
  1844. { t:'是否有湿疹、皮肤瘙痒或反复皮疹', opts:[{t:'没有',s:0},{t:'偶尔',s:1},{t:'反复',s:2}] },
  1845. { t:'是否有阵发喷嚏、鼻塞、清水鼻涕', opts:[{t:'没有',s:0},{t:'季节性',s:1},{t:'常年',s:2}] },
  1846. { t:'是否有过喘息或呼吸困难(非运动诱发)', opts:[{t:'没有',s:0},{t:'有过',s:2}] },
  1847. { t:'是否存在食物不耐受或食物过敏', opts:[{t:'没有',s:0},{t:'1 类食物',s:1},{t:'2 类以上',s:2}] }
  1848. ]},
  1849. bp:{ name:'血压', color:'var(--danger)', max:9, chronic:true, qs:[
  1850. { t:'是否被医生告知过血压偏高或高血压', opts:[{t:'没有',s:0},{t:'看过但未确诊',s:2},{t:'已确诊高血压',s:2}] },
  1851. { t:'近一年是否规律测量血压', opts:[{t:'每月固定测量',s:0},{t:'偶尔测',s:1},{t:'从不测',s:2}] },
  1852. { t:'最近一次血压大概是多少', opts:[{t:'正常或没测过',s:0},{t:'120–139 或 80–89',s:1},{t:'140–159 或 90–99',s:2},{t:'≥160 或 ≥100',s:3}] },
  1853. { t:'是否正在服用降压药', opts:[{t:'未被告知需服药',s:0},{t:'正在服药',s:2}] }
  1854. ]},
  1855. glu:{ name:'血糖', color:'var(--dim-wealth)', max:9, chronic:true, qs:[
  1856. { t:'是否被医生告知过血糖偏高或糖尿病', opts:[{t:'没有',s:0},{t:'看过但未确诊',s:2},{t:'已确诊',s:2}] },
  1857. { t:'近一年是否做过空腹血糖或糖化血红蛋白检查', opts:[{t:'每年都做',s:0},{t:'做过但不定期',s:1},{t:'从未做过',s:2}] },
  1858. { t:'已知空腹血糖是多少(mmol/L)', opts:[{t:'不知道或未测',s:0},{t:'低于 6.1',s:0},{t:'6.1–6.9',s:2},{t:'≥ 7.0',s:3}] },
  1859. { t:'是否正在服用降糖药或使用胰岛素', opts:[{t:'没有',s:0},{t:'有',s:2}] }
  1860. ]},
  1861. lip:{ name:'血脂', color:'var(--dim-action)', max:6, chronic:true, qs:[
  1862. { t:'近一年是否做过血脂四项检查', opts:[{t:'每年都做',s:0},{t:'做过但不定期',s:1},{t:'从未做过',s:2}] },
  1863. { t:'是否被告知血脂异常或胆固醇高', opts:[{t:'没有',s:0},{t:'看过但未确诊',s:1},{t:'已确诊',s:2}] },
  1864. { t:'已知结果', opts:[{t:'都正常',s:0},{t:'低密度脂蛋白偏高',s:2},{t:'甘油三酯偏高',s:2},{t:'总胆固醇偏高',s:1}] }
  1865. ]},
  1866. ua:{ name:'尿酸 / 痛风', color:'var(--dim-mind)', max:11, chronic:true, qs:[
  1867. { t:'是否被医生告知过尿酸偏高或痛风', opts:[{t:'没有',s:0},{t:'看过但未确诊',s:2},{t:'已确诊痛风',s:3}] },
  1868. { t:'已知血尿酸是多少(μmol/L)', opts:[{t:'不知道或未测',s:0},{t:'低于 420',s:0},{t:'420–479',s:2},{t:'≥ 480',s:3}] },
  1869. { t:'是否有过单侧关节红肿热痛发作(尤其足大拇指关节)', opts:[{t:'没有',s:0},{t:'有过 1 次',s:2},{t:'反复发作',s:3}] },
  1870. { t:'是否正在服用降尿酸药物', opts:[{t:'没有',s:0},{t:'有',s:2}] }
  1871. ]}
  1872. };
  1873. var qzState={ phase:'flag', i:0, flagPicks:[], modPicks:{}, active:[], done:false, result:null };
  1874. function qzPhaseList(){
  1875. if (qzState.phase==='flag') return REDFLAG;
  1876. if (qzState.phase==='basic') return [];
  1877. var m=MODULES[qzState.active[qzState.i]];
  1878. return m ? m.qs : [];
  1879. }
  1880. function curDimName(){
  1881. if (qzState.phase==='flag') return '安全筛查';
  1882. if (qzState.phase==='basic') return '基础信息';
  1883. var m=MODULES[qzState.active[qzState.i]];
  1884. return m ? m.name : '';
  1885. }
  1886. function renderQuiz(){
  1887. var wrap=document.getElementById('qz-wrap');
  1888. if (qzState.phase==='basic'){ renderBasic(); return; }
  1889. var list=qzPhaseList(), q=list[qzState.i];
  1890. var total=qzState.phase==='flag'?REDFLAG.length:MODULES[qzState.active[qzState.i]].qs.length;
  1891. var globalDone = qzState.phase==='flag'? qzState.i : qzState.i;
  1892. document.getElementById('qz-bar').style.width=(globalDone/total*100)+'%';
  1893. document.getElementById('qz-idx').textContent=(globalDone+1)+' / '+total;
  1894. var dimEl=document.getElementById('qz-dim');
  1895. dimEl.textContent = qzState.phase==='flag' ? '第一步 · 安全筛查(必答)' : ('维度 · '+curDimName());
  1896. dimEl.style.color = qzState.phase==='flag' ? 'var(--danger)' : 'var(--brand)';
  1897. document.getElementById('qz-title').textContent=q.t;
  1898. var picked = qzState.phase==='flag'? qzState.flagPicks[qzState.i] : (qzState.modPicks[qzState.active[qzState.i]]||[])[qzState.i];
  1899. document.getElementById('qz-opts').innerHTML=q.opts.map(function(o,oi){
  1900. return '<div class="qz-opt'+(picked===oi?' on':'')+'" data-oi="'+oi+'" onclick="pickQ('+oi+')">'+
  1901. '<span class="qo-dot"></span><span class="qo-t">'+o.t+'</span>'+(o.s>0?'<span class="qo-s">+'+o.s+'</span>':'')+'</div>';
  1902. }).join('');
  1903. var isLast = (qzState.i===total-1);
  1904. var acts=document.getElementById('qz-actions');
  1905. acts.innerHTML = isLast
  1906. ? '<button class="btn-primary" onclick="nextQ()">完成本组</button>'
  1907. : '<button class="btn-primary" disabled style="opacity:.45">请选择一项</button>';
  1908. if (picked!==undefined){ enableNext(acts, isLast); }
  1909. document.getElementById('legal-note').style.display = qzState.phase==='flag' ? 'block' : 'none';
  1910. }
  1911. function enableNext(acts, isLast){
  1912. var btn=acts.querySelector('.btn-primary');
  1913. btn.disabled=false; btn.style.opacity='1';
  1914. btn.textContent = isLast ? '完成本组' : '下一题';
  1915. btn.onclick=nextQ;
  1916. }
  1917. function renderBasic(){
  1918. document.getElementById('qz-bar').style.width='100%';
  1919. document.getElementById('qz-idx').textContent='基础信息';
  1920. var dimEl=document.getElementById('qz-dim');
  1921. dimEl.textContent='第二步 · 基础信息';
  1922. dimEl.style.color='var(--brand)';
  1923. document.getElementById('qz-title').innerHTML='为了让评估更准确,请填写基础信息';
  1924. var g=BASIC.gender;
  1925. document.getElementById('qz-opts').innerHTML=
  1926. '<div style="display:flex;gap:10px;margin-bottom:14px">'+
  1927. ['男','女'].map(function(x){ return '<div class="qz-opt'+(g===x?' on':'')+'" style="flex:1" onclick="pickGender(\''+x+'\')">'+
  1928. '<span class="qo-dot"></span><span class="qo-t">'+x+'</span></div>'; }).join('')+'</div>'+
  1929. '<div style="display:flex;gap:10px">'+
  1930. '<div class="field" style="flex:1"><span class="fc-ic">身高</span><input inputmode="decimal" placeholder="cm" value="'+BASIC.h+'" oninput="setBasic(\'h\',this.value)"/></div>'+
  1931. '<div class="field" style="flex:1"><span class="fc-ic">体重</span><input inputmode="decimal" placeholder="kg" value="'+BASIC.w+'" oninput="setBasic(\'w\',this.value)"/></div>'+
  1932. '<div class="field" style="flex:1"><span class="fc-ic">腰围</span><input inputmode="decimal" placeholder="cm" value="'+BASIC.waist+'" oninput="setBasic(\'waist\',this.value)"/></div>'+
  1933. '</div>'+
  1934. '<div style="font-size:var(--fs-xs);color:var(--ink-3);margin-top:10px;line-height:1.5">腰围请在肚脐水平量一圈。用于判断中心型肥胖(男 ≥90cm,女 ≥85cm)。</div>';
  1935. var acts=document.getElementById('qz-actions');
  1936. acts.innerHTML='<button class="btn-primary" onclick="decideModules()">继续</button>';
  1937. document.getElementById('legal-note').style.display='block';
  1938. }
  1939. function pickGender(x){ BASIC.gender=x; renderBasic(); }
  1940. function setBasic(k,v){ BASIC[k]=v; }
  1941. function pickQ(oi){
  1942. if (qzState.phase==='flag'){ qzState.flagPicks[qzState.i]=oi; }
  1943. else {
  1944. var k=qzState.active[qzState.i];
  1945. if(!qzState.modPicks[k]) qzState.modPicks[k]=[];
  1946. qzState.modPicks[k][qzState.i]=oi;
  1947. }
  1948. document.querySelectorAll('#qz-opts .qz-opt').forEach(function(el){ el.classList.toggle('on', +el.dataset.oi===oi); });
  1949. enableNext(document.getElementById('qz-actions'), false);
  1950. }
  1951. function nextQ(){
  1952. var list=qzPhaseList();
  1953. if (qzState.i<list.length-1){ qzState.i++; renderQuiz(); return; }
  1954. // 本组完成
  1955. if (qzState.phase==='flag'){
  1956. var hit=qzState.flagPicks.some(function(p){ return p===1; });
  1957. if (hit){ qzState.done=true; renderRedFlagHit(); return; }
  1958. qzState.phase='basic'; qzState.i=0; renderBasic(); return;
  1959. }
  1960. qzState.i++;
  1961. if (qzState.i<qzState.active.length){ renderQuiz(); }
  1962. else {
  1963. showRisk();
  1964. TASK_SCREENS.forEach(function(s){
  1965. var el=document.getElementById('screen-'+s);
  1966. if (el) el.classList.remove('active');
  1967. });
  1968. document.getElementById('screen-risk').classList.add('active');
  1969. }
  1970. }
  1971. function decideModules(){
  1972. var h=parseFloat(BASIC.h), w=parseFloat(BASIC.w), waist=parseFloat(BASIC.waist);
  1973. var bmi = (h>0 && w>0)? (w/((h/100)*(h/100))) : 0;
  1974. var waistBad = waist>0 && ((BASIC.gender==='男'&&waist>=90)||(BASIC.gender==='女'&&waist>=85));
  1975. var order=['weight','consti','diarrhea','sleep','allergy','bp','glu','lip','ua'];
  1976. qzState.active=order;
  1977. qzState.phase='module'; qzState.i=0; renderQuiz();
  1978. }
  1979. function modScore(key){
  1980. var m=MODULES[key], picks=qzState.modPicks[key]||[], n=0;
  1981. m.qs.forEach(function(q,i){ if(picks[i]!==undefined) n+=q.opts[picks[i]].s; });
  1982. return n;
  1983. }
  1984. function moduleLevel(key){
  1985. var m=MODULES[key], v=modScore(key), r=v/m.max;
  1986. if (r>=0.55) return {n:'需关注', c:'var(--danger)'};
  1987. if (r>=0.3) return {n:'中度', c:'var(--warn)'};
  1988. if (v>0) return {n:'轻度', c:'var(--dim-wealth)'};
  1989. return {n:'良好', c:'var(--ok)'};
  1990. }
  1991. function renderRedFlagHit(){
  1992. var hits=[];
  1993. REDFLAG.forEach(function(q,i){ if(qzState.flagPicks[i]===1) hits.push(q.t); });
  1994. var cardio = qzState.flagPicks[6]===1 || qzState.flagPicks[7]===1 || qzState.flagPicks[8]===1;
  1995. var dept = cardio ? '心内科 / 全科医学科' : '消化内科';
  1996. document.getElementById('qz-bar').style.width='100%';
  1997. document.getElementById('qz-idx').textContent='安全筛查';
  1998. document.getElementById('qz-dim').textContent='筛查结果';
  1999. document.getElementById('qz-dim').style.color='var(--danger)';
  2000. document.getElementById('qz-title').innerHTML='建议优先到正规医院就诊';
  2001. var h='<div class="card" style="border-left:4px solid var(--danger)">'+
  2002. '<div style="display:flex;gap:10px;align-items:flex-start;margin-bottom:12px">'+
  2003. '<span style="color:var(--danger);flex:none;margin-top:1px">'+svgUse('alert',18)+'</span>'+
  2004. '<div><div style="font-size:var(--fs-md);font-weight:800;color:var(--danger)">你描述的情况需要优先明确原因</div>'+
  2005. '<div style="font-size:var(--fs-sm);color:var(--ink-2);margin-top:6px;line-height:1.6">以下情况属于医学上建议优先就诊的信号,我们的服务不能替代医学诊断:</div></div></div>';
  2006. hits.forEach(function(t){
  2007. h+='<div style="display:flex;gap:8px;padding:8px 0;font-size:var(--fs-sm);color:var(--ink-2);line-height:1.5">'+
  2008. '<span style="color:var(--danger);flex:none">·</span><span>'+t+'</span></div>';
  2009. });
  2010. h+='<div style="margin-top:12px;padding-top:12px;border-top:1px solid var(--line);font-size:var(--fs-sm);color:var(--ink-2);line-height:1.6">'+
  2011. '建议挂<b>'+dept+'</b>。如症状明显或持续加重,请尽快就医。<br/>'+
  2012. '<span style="color:var(--ink-3);font-size:var(--fs-xs)">明确原因后,如果需要长期健康管理,我们再陪你做下一步。</span></div></div>';
  2013. document.getElementById('qz-opts').innerHTML=h;
  2014. document.getElementById('qz-actions').innerHTML='<button class="btn-primary" onclick="backTo(\'home\')">我知道了</button>';
  2015. document.getElementById('legal-note').style.display='block';
  2016. }
  2017. function showRisk(){
  2018. var keys=qzState.active.slice();
  2019. var chronicKeys=['bp','glu','lip','ua'];
  2020. var funcKeys=['weight','consti','diarrhea','sleep','allergy'];
  2021. function pick(list){ return list.map(function(k){ return {k:k, v:modScore(k), m:MODULES[k]}; }); }
  2022. // 功能性五维(决定商业转化)
  2023. var funcScored=pick(funcKeys).filter(function(x){ return x.v>0; })
  2024. .sort(function(a,b){ return b.v/b.m.max - a.v/a.m.max; });
  2025. // 慢病四维(管理状态,不参与商业决策)
  2026. var chronicScored=pick(chronicKeys).filter(function(x){ return x.v>0; })
  2027. .sort(function(a,b){ return b.v/b.m.max - a.v/a.m.max; });
  2028. var chronicHigh=chronicScored.filter(function(x){
  2029. var p=x.v/x.m.max; return p>=0.55 || x.v>=4;
  2030. });
  2031. var h=parseFloat(BASIC.h), w=parseFloat(BASIC.w);
  2032. var bmi=(h>0&&w>0)? (w/((h/100)*(h/100))) : 0;
  2033. var bmiTag = bmi>=28 ? {t:'肥胖症范畴', c:'var(--danger)'} : (bmi>=24? {t:'超重', c:'var(--warn)'} : null);
  2034. var hiN=0, midN=0;
  2035. funcScored.forEach(function(x){
  2036. var lv=moduleLevel(x.k);
  2037. if(lv.n==='需关注') hiN++;
  2038. else if(lv.n==='中度') midN++;
  2039. });
  2040. var overall = (hiN>=1||midN>=2)? 'high' : (midN>=1? 'mid' : 'low');
  2041. var conf = { low:{n:'低风险', s:'暂时不需要检测', t:'你的情况目前以作息和饮食调整为主。先做三件事,3 个月后我们提醒你复评。'},
  2042. mid:{n:'中风险', s:'建议做一次检测', t:'有几个维度需要注意。一次检测能帮你明确方向,少走弯路。'},
  2043. high:{n:'高风险', s:'建议尽快检测', t:'你的部分维度需要重点关注,建议尽早做一次检测看看具体方向。'} };
  2044. var c=conf[overall];
  2045. var top=funcScored.length? funcScored[0].m.name : '无明显异常';
  2046. var hero='<div class="risk-hero '+overall+'">'+
  2047. '<div class="rh-score" style="font-size:34px">'+c.n+'</div>'+
  2048. '<div class="rh-unit">'+c.s+'</div>'+
  2049. '<div class="rh-lv">优先关注:'+top+'</div>'+
  2050. '<div class="rh-tip">'+c.t+'</div></div>';
  2051. // 慢病优先提示(若有)
  2052. var chWarn='';
  2053. if (chronicHigh.length){
  2054. var names=chronicHigh.map(function(x){ return x.m.name; }).join('、');
  2055. chWarn='<div class="card" style="border-left:4px solid var(--danger)">'+
  2056. '<div style="display:flex;gap:10px;align-items:flex-start">'+
  2057. '<span style="color:var(--danger);flex:none;margin-top:1px">'+svgUse('alert',18)+'</span>'+
  2058. '<div><div style="font-size:var(--fs-md);font-weight:800;color:var(--danger)">你的 '+names+' 需要优先关注</div>'+
  2059. '<div style="font-size:var(--fs-sm);color:var(--ink-2);margin-top:6px;line-height:1.6">这几个维度的规范管理是「医生方案 + 生活方式」。<b>请遵医嘱定期随诊</b>,我们只能提供生活方式配合建议,不能替代治疗方案,也不建议自行调整用药。</div></div></div>'+
  2060. '<div style="margin-top:12px;padding-top:12px;border-top:1px solid var(--line)">'+
  2061. chronicHigh.map(function(x){
  2062. var q=x.m.qs, picks=qzState.modPicks[x.k]||[];
  2063. var tips=[];
  2064. q.forEach(function(qq,i){ if(picks[i]>0) tips.push(qq.opts[picks[i]].t); });
  2065. return '<div style="padding:6px 0;font-size:var(--fs-sm);color:var(--ink-2)"><b style="color:var(--ink)">'+x.m.name+':</b>'+tips.slice(0,2).join(';')+'</div>';
  2066. }).join('')+
  2067. '</div></div>';
  2068. }
  2069. // 九维得分(分两组)
  2070. function dimRows(list){
  2071. var out='';
  2072. list.forEach(function(k){
  2073. var m=MODULES[k], v=modScore(k), lv=moduleLevel(k);
  2074. var pct=Math.round(v/m.max*100);
  2075. out+='<div class="rf-row" onclick="toast(\''+m.name+':'+v+' 分 · '+lv.n+'\')">'+
  2076. '<span class="rf-d">'+m.name+(bmiTag&&k==='weight'&&bmiTag?'('+bmiTag.t+')':'')+'</span>'+
  2077. '<span class="rf-b"><i style="width:'+pct+'%;background:'+lv.c+'"></i></span>'+
  2078. '<span class="rf-s" style="color:'+lv.c+'">'+v+'</span></div>';
  2079. });
  2080. return out;
  2081. }
  2082. var fh='<div class="risk-factors"><div class="rf-title">消化 · 代谢 · 睡眠 · 过敏</div>'+dimRows(funcKeys)+'</div>'+
  2083. '<div class="risk-factors"><div class="rf-title">三高 · 尿酸(管理状态)</div>'+dimRows(chronicKeys)+
  2084. '<div style="font-size:var(--fs-xs);color:var(--ink-3);margin-top:12px;padding-top:10px;border-top:1px solid var(--line);line-height:1.55">'+
  2085. '这几项为已知的健康指标状态,<b>不能替代医生的诊断与方案</b>。指尖血糖仪测值不能作为糖尿病诊断依据,需静脉血浆血糖。</div></div>';
  2086. var note='<div class="card"><div style="display:flex;gap:10px;align-items:flex-start">'+
  2087. '<span style="color:var(--ink-3);flex:none;margin-top:1px">'+svgUse('shield',17)+'</span>'+
  2088. '<div><div style="font-size:var(--fs-sm);font-weight:700;color:var(--ink-2)">本评估为健康管理筛查参考</div>'+
  2089. '<div style="font-size:var(--fs-xs);color:var(--ink-3);margin-top:5px;line-height:1.6">不构成医疗诊断,也不替代医生的治疗方案。身体不适请到正规医疗机构就诊。</div></div></div></div>';
  2090. document.getElementById('risk-slot').innerHTML=hero+chWarn+fh+note;
  2091. qzState.result={overall:overall, topKey:funcScored.length?funcScored[0].k:'weight', chronic:chronicHigh.length>0};
  2092. renderPrepBlock(overall);
  2093. }
  2094. function renderPrepBlock(lv){
  2095. var slot=document.getElementById('prep-slot'), act=document.getElementById('risk-actions');
  2096. var chronic = qzState.result && qzState.result.chronic;
  2097. if (lv==='low'){
  2098. slot.innerHTML='<div class="card"><div style="display:flex;gap:10px;align-items:flex-start">'+
  2099. '<div style="color:var(--ok);flex:none;margin-top:1px"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 12l5 5 11-11"/></svg></div>'+
  2100. '<div><div style="font-size:var(--fs-base);font-weight:700">我们不建议你现在花钱做检测</div>'+
  2101. '<div style="font-size:var(--fs-sm);color:var(--ink-2);margin-top:5px;line-height:1.6">先按下面三件事做,3 个月后我们提醒你复评。</div></div></div>'+
  2102. '<div style="margin-top:12px;padding-top:12px;border-top:1px solid var(--line)">'+
  2103. prepRow('check','固定三餐时间,晚餐 7 点前结束')+
  2104. prepRow('leaf','每天一份发酵食品(无糖酸奶 / 泡菜)')+
  2105. prepRow('run','每周 3 次、每次 30 分钟快走')+
  2106. '</div></div>';
  2107. act.innerHTML='<div class="up-actions"><button class="btn-primary" onclick="toast(\'已加入 3 个月后复评提醒\')">3 个月后提醒我复评</button><button class="btn-ghost" onclick="backTo(\'home\')">返回首页</button></div>';
  2108. return;
  2109. }
  2110. var push = lv==='high'
  2111. ? '你的部分症状与肠道环境可能相关,检测能帮你明确主因。'
  2112. : '一次检测能帮你明确方向,少走弯路。';
  2113. // 慢病用户:弱化销售,强调配合
  2114. var head = chronic
  2115. ? '<div class="pc-t">配合医生方案的生活方式准备</div>'
  2116. : '<div class="pc-t">检测前的肠道准备期</div>';
  2117. var desc = chronic
  2118. ? '<div class="pc-s">你的血压 / 血糖 / 血脂 / 尿酸中有需要重点关注的项。<b>请先遵医嘱随诊</b>。这段时间我们能做的,是帮你把饮食与作息配合起来——这是生活方式管理,不是治疗。</div>'
  2119. : '<div class="pc-s">菌群检测有个前提:检测前 3–7 天不能有抗生素、不能大量摄入益生菌、饮食要稳定,否则数据会失真。<b>这 7 天需要有人带你调。</b></div>';
  2120. var priceNote = chronic
  2121. ? '<div style="font-size:var(--fs-xs);color:rgba(124,45,18,0.7);margin-top:8px;line-height:1.5">说明:我们<b>不建议</b>已确诊的用户自行调整用药或用检测替代复诊。检测与解读仅作参考。</div>'
  2122. : '';
  2123. slot.innerHTML='<div class="sec-head section"><div class="sec-title">'+(chronic?'建议:先配合医生,再做生活方式管理':'建议:检测前先做 7 天准备')+'</div></div>'+
  2124. '<div class="prep-card">'+head+desc+
  2125. '<div class="prep-price"><span class="pp-n">9.9</span><span class="pp-u">元 · 7 天陪跑</span></div>'+priceNote+'</div>'+
  2126. '<div class="card" style="margin-top:14px;background:var(--brand-soft);box-shadow:none">'+
  2127. '<div style="font-size:var(--fs-base);font-weight:700;color:var(--brand-ink)">'+(chronic?'遵医嘱是首要的':'检测本身由你自费(¥1980,可分期)')+'</div>'+
  2128. '<div style="font-size:var(--fs-sm);color:var(--brand-ink);opacity:.85;margin-top:6px;line-height:1.55">'+(chronic?'我们提供的是饮食与作息调整建议,配合你的既有治疗方案。':'我们赠送的是<b>检测前准备、检测后专家解读、90 天干预方案</b>。')+'</div></div>';
  2129. act.innerHTML='<div class="up-actions"><button class="btn-primary" onclick="openPrep()">9.9 元 · 开始 7 天准备</button>'+
  2130. '<button class="btn-ghost" onclick="toast(\'直接检测:¥1980,可分期\')">'+(chronic?'先去做正规复查':'跳过准备,直接预约检测')+'</button></div>';
  2131. }
  2132. function prepRow(ic,t){
  2133. return '<div class="prep-item"><span class="pi-ic" style="background:var(--dim-action-soft);color:var(--ok)">'+svgUse(ic,16)+'</span>'+
  2134. '<span style="flex:1;font-size:var(--fs-sm);font-weight:600">'+t+'</span></div>';
  2135. }
  2136. function renderPrepPage(){
  2137. var days=['一','二','三','四','五','六','日'];
  2138. var h='';
  2139. for(var i=0;i<7;i++){
  2140. h+='<div class="d7-cell'+(i<6?' done':'')+'">'+days[i]+'</div>';
  2141. }
  2142. document.getElementById('prep-d7').innerHTML=h;
  2143. var tasks=[
  2144. {ic:'diet',c:'var(--dim-body)',t:'记录三餐全貌 + 建立准备档案',s:'10 分钟'},
  2145. {ic:'target',c:'var(--dim-action)',t:'停用益生菌 / 补剂,改为发酵食品',s:'5 分钟'},
  2146. {ic:'leaf',c:'var(--dim-body)',t:'调整精制碳水,晚餐加一份蔬菜',s:'15 分钟'},
  2147. {ic:'smile',c:'var(--dim-mind)',t:'记录症状(腹胀 / 排便)与情绪',s:'5 分钟'},
  2148. {ic:'bulb',c:'var(--dim-wisdom)',t:'建立固定进餐时间',s:'10 分钟'},
  2149. {ic:'check',c:'var(--dim-action)',t:'复核是否误食抗生素类药物',s:'5 分钟'},
  2150. {ic:'upload',c:'var(--brand)',t:'生成准备度报告 + 支付检测',s:'10 分钟'}
  2151. ];
  2152. document.getElementById('prep-list').innerHTML=tasks.map(function(t){
  2153. return '<div class="prep-item"><span class="pi-ic" style="background:'+t.c+'1a;color:'+t.c+'">'+svgUse(t.ic,16)+'</span>'+
  2154. '<span style="flex:1"><span style="display:block;font-size:var(--fs-base);font-weight:600">'+t.t+'</span>'+
  2155. '<span style="display:block;font-size:var(--fs-xs);color:var(--ink-3);margin-top:2px">约 '+t.s+'</span></span></div>';
  2156. }).join('');
  2157. document.getElementById('prep-output').innerHTML=
  2158. '<div class="prep-item"><span class="pi-ic" style="background:var(--brand-soft);color:var(--brand)">'+svgUse('chart',16)+'</span><span style="flex:1;font-size:var(--fs-base);font-weight:600">7 天饮食结构分析 + 变化曲线</span></div>'+
  2159. '<div class="prep-item"><span class="pi-ic" style="background:var(--brand-soft);color:var(--brand)">'+svgUse('smile',16)+'</span><span style="flex:1;font-size:var(--fs-base);font-weight:600">症状与情绪趋势变化</span></div>'+
  2160. '<div class="prep-item"><span class="pi-ic" style="background:var(--brand-soft);color:var(--brand)">'+svgUse('target',16)+'</span><span style="flex:1;font-size:var(--fs-base);font-weight:600">检测前注意事项清单</span></div>'+
  2161. '<div class="prep-item"><span class="pi-ic" style="background:var(--brand-soft);color:var(--brand)">'+svgUse('bulb',16)+'</span><span style="flex:1;font-size:var(--fs-base);font-weight:600">五维能量基线档案</span></div>';
  2162. }
  2163. function renderD7(){
  2164. var trends=[
  2165. { n:'饮食结构评分', v:'4 → 7', col:'var(--brand)', data:[28,38,48,58,68,78,88], note:'精制碳水占比下降、膳食纤维上升,这对肠道环境是有益的调整。' },
  2166. { n:'腹胀发生频次', v:'每周 4 次 → 1 次', col:'var(--dim-mind)', data:[82,70,58,48,38,30,22], note:'腹胀频次明显下降,说明你的消化负担在减轻。' },
  2167. { n:'排便规律度', v:'不规律 → 基本规律', col:'var(--dim-action)', data:[24,32,44,56,68,78,86], note:'规律性改善通常与菌群多样性正相关,值得进一步了解原因。' }
  2168. ];
  2169. document.getElementById('d7-trend').innerHTML=trends.map(function(t){
  2170. return '<div class="tb-row"><div class="tb-head"><span class="tb-name">'+t.n+'</span>'+
  2171. '<span class="tb-val" style="color:'+t.col+'">'+t.v+'</span></div>'+
  2172. '<div class="tb-spark">'+t.data.map(function(d,i){ return '<i class="'+(i===t.data.length-1?'last':'')+'" style="height:'+d+'%;background:'+(i===t.data.length-1?t.col:'')+'"></i>'; }).join('')+'</div>'+
  2173. '<div class="tb-note">'+t.note+'</div></div>';
  2174. }).join('');
  2175. var finds=[
  2176. { ic:'chart', c:'var(--brand)', t:'你的症状与饮食结构高度相关',
  2177. obs:'你这 7 天里,饮食结构得分高的第 2、4、6 天,腹胀都没有出现;得分低的第 1、3 天,腹胀出现 2 次。',
  2178. tip:'这个规律在很多人身上都成立。想知道自己肠道里到底发生了什么,检测能给你答案。' },
  2179. { ic:'upload', c:'var(--dim-body)', t:'你的用药史可能影响菌群',
  2180. obs:'你在问卷中提到近 3 个月使用过抑酸类药物。这类药物会改变消化道环境,也可能影响菌群检测结果的准确性。',
  2181. tip:'这正是我们建议你先调 7 天再测的原因。你已经完成了大部分准备,只差最后一步。' },
  2182. { ic:'smile', c:'var(--dim-mind)', t:'情绪与肠道互相牵连',
  2183. obs:'你这 7 天里,情绪打卡与腹胀记录出现了 3 次同步波动。',
  2184. tip:'肠道与情绪是双向影响的。菌群状况可能是这条链路的关键一环。' }
  2185. ];
  2186. document.getElementById('d7-finds').innerHTML=finds.map(function(f){
  2187. return '<div class="find-card"><div class="fc-h">'+
  2188. '<span class="fc-ic" style="background:'+f.c+'1a;color:'+f.c+'">'+svgUse(f.ic,16)+'</span>'+
  2189. '<span class="fc-t">'+f.t+'</span></div>'+
  2190. '<div class="fc-obs">'+f.obs+'</div>'+
  2191. '<div class="fc-tip">'+f.tip+'</div></div>';
  2192. }).join('');
  2193. var checks=[
  2194. { t:'停用益生菌 / 补剂', n:'第 2 天起完成', done:true },
  2195. { t:'确认近 3 天无抗生素类药物', n:'请自行核对', done:false },
  2196. { t:'饮食结构稳定', n:'精制碳水已降低', done:true },
  2197. { t:'进餐时间规律', n:'连续 6 天固定', done:true },
  2198. { t:'检测前 24 小时饮食清淡', n:'检测当天执行', done:false }
  2199. ];
  2200. document.getElementById('d7-checks').innerHTML=checks.map(function(c){
  2201. return '<div class="chk-row '+(c.done?'done':'todo')+'">'+
  2202. '<span class="ck-ic">'+(c.done?svgUse('check',13):svgUse('clock',13))+'</span>'+
  2203. '<span class="ck-t">'+c.t+'</span><span class="ck-n">'+c.n+'</span></div>';
  2204. }).join('');
  2205. }
  2206. function openQuiz(){
  2207. qzState={ phase:'flag', i:0, flagPicks:[], modPicks:{}, active:[], done:false, result:null };
  2208. BASIC={ gender:'', h:'', w:'', waist:'' };
  2209. renderQuiz();
  2210. pushScreen('quiz');
  2211. }
  2212. function openRisk(){ showRisk(); pushScreen('risk'); }
  2213. function openPrep(){
  2214. renderPrepPage();
  2215. pushScreen('prep');
  2216. }
  2217. function openReport7(){
  2218. renderD7();
  2219. pushScreen('report7');
  2220. }
  2221. /* ===== 折线图(趋势) ===== */
  2222. function buildLineChart(el, cfg, w, h) {
  2223. var pad=8, maxV=100, minV=55;
  2224. var n=cfg.labels.length, all=[];
  2225. cfg.lines.forEach(function(l){ all=all.concat(l.data); });
  2226. var hi=Math.max.apply(null, all), lo=Math.min.apply(null, all);
  2227. hi=Math.min(100, Math.ceil((hi+4)/5)*5); lo=Math.max(0, Math.floor((lo-6)/5)*5);
  2228. var svg='<svg viewBox="0 0 '+w+' '+h+'" width="100%" height="'+h+'" preserveAspectRatio="none" style="overflow:visible">';
  2229. // 网格 + 标签
  2230. for(var g=0; g<=3; g++){
  2231. var gy=pad+g*((h-pad*2)/3);
  2232. svg+='<line x1="0" y1="'+gy.toFixed(1)+'" x2="'+w+'" y2="'+gy.toFixed(1)+'" stroke="var(--line)" stroke-width="1"/>';
  2233. svg+='<text x="0" y="'+(gy-4).toFixed(1)+'" font-size="9" fill="#B49A83">'+Math.round(hi-(hi-lo)*(g/3))+'</text>';
  2234. }
  2235. cfg.labels.forEach(function(l,i){
  2236. var lx=pad+i*((w-pad*2)/(n-1));
  2237. svg+='<text x="'+lx.toFixed(1)+'" y="'+(h-1)+'" font-size="9.5" fill="#B49A83" text-anchor="middle">'+l+'</text>';
  2238. });
  2239. function px(i){ return pad+i*((w-pad*2)/(n-1)); }
  2240. function py(v){ return pad+(hi-v)/(hi-lo)*((h-pad*2)); }
  2241. cfg.lines.forEach(function(l){
  2242. var pts=l.data.map(function(v,i){ return px(i).toFixed(1)+','+py(v).toFixed(1); });
  2243. var area=pts.join(' ')+','+px(n-1).toFixed(1)+','+h+','+px(0).toFixed(1)+','+h;
  2244. svg+='<polygon points="'+area+'" fill="'+l.color+'" opacity="0.08"/>';
  2245. svg+='<polyline points="'+pts.join(' ')+'" fill="none" stroke="'+l.color+'" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/>';
  2246. l.data.forEach(function(v,i){
  2247. var last=(i===l.data.length-1);
  2248. svg+='<circle cx="'+px(i).toFixed(1)+'" cy="'+py(v).toFixed(1)+'" r="'+(last?4:2.6)+'" fill="#fff" stroke="'+l.color+'" stroke-width="2"/>';
  2249. });
  2250. });
  2251. svg+='</svg>';
  2252. el.innerHTML=svg;
  2253. }
  2254. /* ===== 五维总览:雷达(含家人两轮对比) ===== */
  2255. function buildRadarCompare(el, size) {
  2256. var cx=size/2, cy=size/2, R=size/2-30, n=DIMS.length;
  2257. function pt(i, ratio){
  2258. var a=-Math.PI/2+i*2*Math.PI/n;
  2259. return [cx+Math.cos(a)*R*ratio, cy+Math.sin(a)*R*ratio];
  2260. }
  2261. var svg='<svg width="'+size+'" height="'+size+'" viewBox="0 0 '+size+' '+size+'">';
  2262. [0.25,0.5,0.75,1].forEach(function(r){
  2263. var p=DIMS.map(function(d,i){ return pt(i,r).map(function(v){return v.toFixed(1)}).join(','); }).join(' ');
  2264. svg+='<polygon points="'+p+'" fill="none" stroke="var(--line)" stroke-width="1"/>';
  2265. });
  2266. for(var i=0;i<n;i++){
  2267. var e=pt(i,1);
  2268. svg+='<line x1="'+cx+'" y1="'+cy+'" x2="'+e[0].toFixed(1)+'" y2="'+e[1].toFixed(1)+'" stroke="var(--line)" stroke-width="1"/>';
  2269. }
  2270. // 自家
  2271. var mine=DIMS.map(function(d,i){ return pt(i, d.score/100).map(function(v){return v.toFixed(1)}).join(','); }).join(' ');
  2272. svg+='<polygon points="'+mine+'" fill="rgba(249,115,22,0.18)" stroke="var(--brand)" stroke-width="2"/>';
  2273. // 上周虚线
  2274. var last=DIMS.map(function(d,i){ return pt(i, Math.max(0.05,(d.score-4)/100)).map(function(v){return v.toFixed(1)}).join(','); }).join(' ');
  2275. svg+='<polygon points="'+last+'" fill="none" stroke="#B49A83" stroke-width="1.6" stroke-dasharray="4 3"/>';
  2276. DIMS.forEach(function(d,i){
  2277. var p=pt(i,d.score/100);
  2278. svg+='<circle cx="'+p[0].toFixed(1)+'" cy="'+p[1].toFixed(1)+'" r="3.4" fill="#fff" stroke="'+d.color+'" stroke-width="2"/>';
  2279. });
  2280. DIMS.forEach(function(d,i){
  2281. var lp=pt(i,1.24);
  2282. svg+='<text x="'+lp[0].toFixed(1)+'" y="'+(lp[1]+4).toFixed(1)+'" font-size="11" font-weight="700" fill="'+d.color+'" text-anchor="middle">'+d.name+'</text>';
  2283. });
  2284. svg+='</svg>';
  2285. el.innerHTML=svg;
  2286. }
  2287. /* ===== 渲染:五维总览 ===== */
  2288. var ovRange='week';
  2289. function renderOverview() {
  2290. buildRadarCompare(document.getElementById('ov-radar'), 240);
  2291. var avg=Math.round(DIMS.reduce(function(s,d){return s+d.score},0)/DIMS.length);
  2292. document.getElementById('ov-n').textContent=avg;
  2293. var lg='';
  2294. DIMS.forEach(function(d){ lg+='<span class="ov-lg"><i style="background:'+d.color+'"></i>'+d.name+' '+d.score+'</span>'; });
  2295. lg+='<span class="ov-lg"><i style="background:#B49A83"></i>上周</span>';
  2296. document.getElementById('ov-legend').innerHTML=lg;
  2297. setOvRange(ovRange, document.querySelector('#ov-trend-tabs .tt.on'));
  2298. }
  2299. function setOvRange(r, el) {
  2300. ovRange=r;
  2301. if (el) {
  2302. document.querySelectorAll('#ov-trend-tabs .tt').forEach(function(t){ t.classList.remove('on'); });
  2303. el.classList.add('on');
  2304. }
  2305. var cfg=TREND[r];
  2306. buildLineChart(document.getElementById('ov-trend'), cfg, 320, 160);
  2307. var lgd='';
  2308. cfg.lines.forEach(function(l){ lgd+='<span class="tl"><i style="background:'+l.color+'"></i>'+l.name+'</span>'; });
  2309. document.getElementById('ov-trend-legend').innerHTML=lgd;
  2310. var cmp='';
  2311. FAMILY.forEach(function(f){
  2312. var w=f.score+'%';
  2313. var lvl=f.score>=80?'优秀':(f.score>=70?'良好':'待提升');
  2314. cmp+='<div class="cmp-row" onclick="openDim(\''+f.dim+'\')">'+
  2315. '<div class="cmp-av" style="background:'+f.color+'">'+f.name.charAt(0)+'</div>'+
  2316. '<div class="cmp-info"><div class="cmp-nm"><span class="cn">'+f.name+'</span><span class="cr">'+f.role+'</span></div>'+
  2317. '<div class="cmp-bar"><div class="cf" style="width:'+w+';background:'+f.color+'"></div></div></div>'+
  2318. '<div class="cmp-sc" style="color:'+f.color+'">'+f.score+'</div></div>';
  2319. });
  2320. document.getElementById('ov-cmp').innerHTML=cmp;
  2321. var adv='';
  2322. ADVICE.forEach(function(a){
  2323. adv+='<div class="adv-card" onclick="toast(\'打开建议详情\')">'+
  2324. '<div class="adv-ic" style="background:'+dimSoft(a.dim)+';color:'+dimColor(a.dim)+'">'+svgUse(a.icon,18)+'</div>'+
  2325. '<div class="adv-tx"><div class="adv-t">'+a.t+'</div><div class="adv-s">'+a.s+'</div></div>'+
  2326. '<div class="adv-pri" style="background:'+a.priSoft+';color:'+a.priColor+'">'+a.pri+'</div></div>';
  2327. });
  2328. document.getElementById('ov-adv').innerHTML=adv;
  2329. }
  2330. /* ===== 渲染:维度详情 ===== */
  2331. function renderDim(code) {
  2332. var d=dimByCode(code);
  2333. var hero='<div class="dim-hero" style="background:linear-gradient(135deg,'+d.color+'22,'+d.soft+');color:'+d.color+'">'+
  2334. '<div class="dh-top"><div class="dh-ic" style="background:'+d.color+';color:#fff">'+svgUse(code==='body'?'run':(code==='mind'?'smile':'bulb'),22)+'</div>'+
  2335. '<div><div class="dh-nm">'+d.name+' · '+d.desc+'</div><div class="dh-ds">小宇 · 10 岁</div></div>'+
  2336. '<div class="dh-sc"><div class="n">'+d.score+'</div><div class="l">当前评分</div></div></div>'+
  2337. '<div class="sub-score">'+
  2338. '<div class="ss"><div class="sl">较上月</div><div class="sv" style="color:'+d.color+'">+4<small>分</small></div></div>'+
  2339. '<div class="ss"><div class="sl">同位段</div><div class="sv" style="color:'+d.color+'">前 30%<small></small></div></div>'+
  2340. '</div></div>';
  2341. document.getElementById('dim-hero-slot').innerHTML=hero;
  2342. document.getElementById('dim-nav-title').textContent=d.name+' · '+d.desc;
  2343. var m=DIM_METRICS[code]||DIM_METRICS.body;
  2344. var mh='';
  2345. m.forEach(function(x){
  2346. mh+='<div class="metric-row"><div class="mi"><div class="mn">'+x.n+'<span class="tag-ref '+x.ref+'">'+(x.ref==='ok'?'正常':(x.ref==='mid'?'关注':'偏高'))+'</span></div><div class="mr">'+x.r+'</div></div>'+
  2347. '<div class="mv" style="color:'+d.color+'">'+x.v+'<span style="font-size:var(--fs-xs);color:var(--ink-3);margin-left:2px">'+x.unit+'</span></div></div>';
  2348. });
  2349. document.getElementById('dim-metrics').innerHTML=mh;
  2350. buildLineChart(document.getElementById('dim-trend'), {
  2351. labels: TREND.week.labels,
  2352. lines: [{ name:d.name, color:d.color, data:[d.score-6,d.score-4,d.score-5,d.score-2,d.score-1,d.score+1,d.score] }]
  2353. }, 320, 140);
  2354. var ah='';
  2355. (DIM_ACTIONS[code]||DIM_ACTIONS.body).forEach(function(a){
  2356. ah+='<div class="adv-card" onclick="completeAdv(this)">'+
  2357. '<div class="adv-ic" style="background:'+dimSoft(code)+';color:'+a.c+'">'+svgUse(a.ic,18)+'</div>'+
  2358. '<div class="adv-tx"><div class="adv-t">'+a.t+'</div><div class="adv-s">'+a.s+'</div></div>'+
  2359. '<div style="align-self:center;width:22px;height:22px;border-radius:50%;border:1.8px solid '+d.color+';flex:none" class="adv-ck"></div></div>';
  2360. });
  2361. document.getElementById('dim-actions').innerHTML=ah;
  2362. var rh='';
  2363. (DIM_RECORDS[code]||DIM_RECORDS.body).forEach(function(r){
  2364. rh+='<div class="row"><div class="rk" style="background:'+dimSoft(code)+';color:'+r.c+'">'+svgUse(r.ic,18)+'</div>'+
  2365. '<div class="ri"><div class="rt">'+r.t+'</div><div class="rm">'+r.m+'</div></div></div>';
  2366. });
  2367. document.getElementById('dim-records').innerHTML=rh;
  2368. }
  2369. function completeAdv(card){
  2370. var ck=card.querySelector('.adv-ck');
  2371. if (!ck || ck.dataset.done) return;
  2372. ck.dataset.done='1';
  2373. ck.style.background='var(--ok)';
  2374. ck.style.borderColor='var(--ok)';
  2375. ck.innerHTML='<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="3.4" stroke-linecap="round" stroke-linejoin="round"><path d="M4 12l5 5 11-11"/></svg>';
  2376. toast('已完成 · 成长分 +10');
  2377. }
  2378. /* ===== 报告上传流程(状态机) ===== */
  2379. var upState={ step:1, dim:'body', pct:0, timer:null };
  2380. function openUpload(dim){
  2381. upState.dim=dim||'body';
  2382. upState.step=1;
  2383. renderUpload();
  2384. pushScreen('upload');
  2385. }
  2386. function closeUpload(){ pushScreen(null); }
  2387. function renderUpload(){
  2388. var labels=['选择','识别','确认','完成'];
  2389. var h='';
  2390. for (var i=0;i<4;i++){
  2391. var cls= upState.step>i+1 ? 'done' : (upState.step===i+1 ? 'on' : '');
  2392. h+='<div class="up-step '+cls+'"><div class="us-n">'+(upState.step>i+1?'<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3.4" stroke-linecap="round" stroke-linejoin="round"><path d="M4 12l5 5 11-11"/></svg>':(i+1))+'</div><div class="us-t">'+labels[i]+'</div></div>';
  2393. if(i<3) h+='<div class="up-step-line'+(upState.step>i+1?' done':'')+'"></div>';
  2394. }
  2395. document.getElementById('up-steps').innerHTML=h;
  2396. ['pick','ocr','fix','done'].forEach(function(k,i){
  2397. document.getElementById('up-step-'+k).style.display = (upState.step===i+1)?'block':'none';
  2398. });
  2399. var acts='';
  2400. if (upState.step===1){
  2401. acts='<button class="btn-primary" onclick="startOCR()">开始识别</button>'+
  2402. '<button class="btn-ghost" onclick="closeUpload()">取消</button>';
  2403. } else if (upState.step===2){
  2404. acts='<button class="btn-primary" disabled>识别中…</button>';
  2405. } else if (upState.step===3){
  2406. acts='<button class="btn-primary" onclick="finishUpload()">确认并归档</button>'+
  2407. '<button class="btn-ghost" onclick="backToPick()">重新选择</button>';
  2408. } else {
  2409. acts='<button class="btn-primary" onclick="closeUpload()">完成</button>';
  2410. }
  2411. document.getElementById('up-actions').innerHTML=acts;
  2412. if (upState.step===1) renderPending();
  2413. if (upState.step===2) renderOcrSteps();
  2414. if (upState.step===3) renderFixList();
  2415. if (upState.step===4) renderDoneList();
  2416. }
  2417. function renderPending(){
  2418. document.getElementById('up-pending').innerHTML=
  2419. '<div class="row"><div class="rk" style="background:var(--dim-action-soft);color:var(--ok)">'+svgUse('check',18)+'</div>'+
  2420. '<div class="ri"><div class="rt">血常规_20260920.jpg</div><div class="rm">9-20 已解析 · 4 项指标</div></div>'+
  2421. '<button class="pill-btn done" disabled>已归档</button></div>'+
  2422. '<div class="row"><div class="rk" style="background:var(--brand-soft);color:var(--brand)">'+svgUse('upload',18)+'</div>'+
  2423. '<div class="ri"><div class="rt">体检报告_20260928.jpg</div><div class="rm">刚刚选择 · 待识别</div></div>'+
  2424. '<button class="pill-btn" onclick="startOCR()">识别</button></div>';
  2425. }
  2426. function renderOcrSteps(){
  2427. var p=upState.pct, h='';
  2428. var reached=Math.floor(p/100*OCR_STEPS.length);
  2429. OCR_STEPS.forEach(function(s,i){
  2430. var cls= p>=100 ? 'done' : (i===reached ? 'run' : '');
  2431. var ic= p>=100
  2432. ? '<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3.4" stroke-linecap="round" stroke-linejoin="round"><path d="M4 12l5 5 11-11"/></svg>'
  2433. : (i===reached ? '<svg class="spin" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3"><path d="M12 3a9 9 0 0 1 9 9" stroke-linecap="round"/></svg>' : '');
  2434. h+='<div class="ocr-step '+cls+'"><div class="os-ic">'+ic+'</div><div class="os-t">'+s.t+'</div></div>';
  2435. });
  2436. document.getElementById('ocr-steps').innerHTML=h;
  2437. }
  2438. function startOCR(){
  2439. upState.step=2; upState.pct=0; renderUpload();
  2440. clearInterval(upState.timer);
  2441. upState.timer=setInterval(function(){
  2442. upState.pct=Math.min(100, upState.pct+4);
  2443. document.getElementById('ocr-fill').style.width=upState.pct+'%';
  2444. document.getElementById('ocr-pct').textContent=upState.pct+'%';
  2445. renderOcrSteps();
  2446. if (upState.pct>=100){
  2447. clearInterval(upState.timer);
  2448. setTimeout(function(){ upState.step=3; renderUpload(); toast('识别完成 · 请核对'); }, 420);
  2449. }
  2450. }, 90);
  2451. }
  2452. function backToPick(){
  2453. clearInterval(upState.timer);
  2454. upState.step=1; renderUpload();
  2455. }
  2456. function renderFixList(){
  2457. var d=dimByCode(upState.dim), h='';
  2458. FIX_FIELDS.forEach(function(f){
  2459. h+='<div class="fix-row"><div class="fi"><div class="fn">'+f.n+(f.low?' <span class="low-conf">待确认</span>':'')+'</div>'+
  2460. '<div class="fv" style="color:'+d.color+'">'+f.v+' <span style="font-size:var(--fs-sm);color:var(--ink-3)">'+f.u+'</span></div>'+
  2461. (f.low?'<div class="fw">识别置信度较低,请核对</div>':'')+'</div>'+
  2462. '<button class="pill-btn" style="padding:6px 12px" onclick="toast(\'编辑 '+f.n+'\')">修改</button></div>';
  2463. });
  2464. document.getElementById('up-fix-list').innerHTML=h;
  2465. }
  2466. function renderDoneList(){
  2467. var d=dimByCode(upState.dim), h='';
  2468. h+='<div class="row"><div class="rk" style="background:'+d.soft+';color:'+d.color+'">'+svgUse('upload',18)+'</div>'+
  2469. '<div class="ri"><div class="rt">体检报告_20260928.jpg</div><div class="rm">刚刚 · 6 项指标</div></div>'+
  2470. '<span class="tag-ref ok">已归档</span></div>';
  2471. FIX_FIELDS.forEach(function(f){
  2472. h+='<div class="row"><div class="rk" style="background:var(--bg-soft);color:var(--ink-2)">'+svgUse(f.u==='mmHg'||f.u==='bpm'?'heart':'check',16)+'</div>'+
  2473. '<div class="ri"><div class="rt" style="font-size:var(--fs-base);font-weight:500">'+f.n+'</div></div>'+
  2474. '<div style="font-weight:800;color:'+d.color+'">'+f.v+'<span style="font-size:var(--fs-xs);color:var(--ink-3);margin-left:2px">'+f.u+'</span></div></div>';
  2475. });
  2476. document.getElementById('up-done-list').innerHTML=h;
  2477. }
  2478. function finishUpload(){
  2479. clearInterval(upState.timer);
  2480. upState.step=4; renderUpload();
  2481. toast('归档成功 · 身维度 +3 分');
  2482. }
  2483. /* ===== 渲染:成长报告与分享 ===== */
  2484. var rptRange='week';
  2485. function setRptRange(r, el){
  2486. rptRange=r;
  2487. if (el){
  2488. document.querySelectorAll('#rpt-tabs .rtt').forEach(function(t){ t.classList.remove('on'); });
  2489. el.classList.add('on');
  2490. }
  2491. renderReport();
  2492. }
  2493. function renderReport(){
  2494. var isWeek=rptRange==='week';
  2495. var title=isWeek?'本周成长报告':'本月成长报告';
  2496. var sub=isWeek?'9-22 至 9-28 · 全家共同成长':'9 月 · 全家共同成长';
  2497. var dims='';
  2498. DIMS.forEach(function(d){
  2499. var s=isWeek?d.score:Math.max(40,d.score-4);
  2500. dims+='<div class="sc-dim"><div class="sd-n" style="color:'+d.color+'">'+s+'</div><div class="sd-l">'+d.name+'</div></div>';
  2501. });
  2502. var unlockedN=BADGES.filter(function(b){return !b.locked;}).length;
  2503. var card='<div class="share-card hero-share">'+
  2504. '<div class="sc-brand"><div class="scb-ic"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2l2.4 6.3L21 9.3l-5 4.4L17.5 21 12 17l-5.5 4L8 13.7l-5-4.4 6.6-1z"/></svg></div>'+
  2505. '<div class="scb-tx">浠艾福 · Care Family</div>'+
  2506. '<div class="sc-streak" style="margin-left:auto">'+svgUse('flame',13)+' 连续 '+growthState.streak+' 天</div></div>'+
  2507. '<div class="sc-title">'+title+'</div>'+
  2508. '<div class="sc-sub">'+sub+'</div>'+
  2509. '<div class="sc-dims">'+dims+'</div>'+
  2510. '<div class="sc-ach">'+
  2511. '<div class="sc-ach-item"><div class="n">'+growthState.baseTasks+'</div><div class="l">完成任务</div></div>'+
  2512. '<div class="sc-ach-item"><div class="n">'+growthState.pts.toLocaleString()+'</div><div class="l">成长分</div></div>'+
  2513. '<div class="sc-ach-item"><div class="n">'+unlockedN+'</div><div class="l">获得徽章</div></div>'+
  2514. '</div>'+
  2515. '<div class="sc-foot"><div class="sf-l">成果分享 · 邀请朋友们一起看</div><div class="sf-r">综合 '+(isWeek?76:72)+' 分 ↑</div></div>'+
  2516. '</div>';
  2517. document.getElementById('rpt-card-slot').innerHTML=card;
  2518. document.getElementById('rpt-share').innerHTML=
  2519. '<div class="sa pri" onclick="toast(\'已保存到相册,可直接分享\')">'+svgUse('upload',18)+'保存图片</div>'+
  2520. '<div class="sa sec" onclick="toast(\'发送给朋友一起看成果\')">'+svgUse('people',18)+'发送给朋友</div>';
  2521. var bh='';
  2522. BADGES.forEach(function(b){
  2523. bh+='<div class="bg-item'+(b.locked?' locked':'')+'" onclick="toast(\''+(b.locked?'尚未解锁:'+b.d:b.n+' 已获得')+'\')">'+
  2524. (b.locked?'<div class="bg-lock">'+svgUse('target',14)+'</div>':'')+
  2525. '<div class="bg-ring" style="background:linear-gradient(135deg,'+b.c+','+b.c+'99)">'+svgUse(b.ic,24)+'</div>'+
  2526. '<div class="bg-nm">'+b.n+'</div><div class="bg-dt">'+b.d+'</div></div>';
  2527. });
  2528. document.getElementById('rpt-badges').innerHTML=bh;
  2529. // 首次进入报告页:若已解锁全勤,播放徽章解锁动画
  2530. if (growthState.unlocked){
  2531. var lastItem=document.querySelector('#rpt-badges .bg-item:not(.locked):last-child');
  2532. if (lastItem){ lastItem.classList.add('just-unlocked'); }
  2533. }
  2534. var hl=[
  2535. { ic:'check', c:'var(--dim-body)', t:'<b>小宇</b> 运动打卡 4 次达标', m:'本周' },
  2536. { ic:'book', c:'var(--dim-wisdom)', t:'<b>小柚</b> 亲子共读累计 14 天', m:'进行中' },
  2537. { ic:'heart', c:'var(--dim-mind)', t:'<b>爷爷</b> 连续 7 天完成情绪打卡', m:'连续 7 天' }
  2538. ];
  2539. var h='';
  2540. hl.forEach(function(x){
  2541. h+='<div class="feed-item"><div class="feed-dot" style="background:'+x.c+'22;color:'+x.c+'">'+svgUse(x.ic,16)+'</div>'+
  2542. '<div style="flex:1;min-width:0"><div class="fi-t">'+x.t+'</div><div class="fi-time">'+x.m+'</div></div></div>';
  2543. });
  2544. document.getElementById('rpt-highlights').innerHTML=h;
  2545. }
  2546. /* ===== 交互 ===== */
  2547. var currentTab='home';
  2548. function setTab(tab){
  2549. currentTab=tab;
  2550. if (tab==='login') return;
  2551. taskStack=[];
  2552. TASK_SCREENS.forEach(function(s){
  2553. var el=document.getElementById('screen-'+s);
  2554. if (el) el.classList.remove('active');
  2555. });
  2556. document.querySelectorAll('.screen').forEach(function(s){
  2557. if (s.id==='screen-'+tab){ s.classList.add('active'); } else { s.classList.remove('active'); }
  2558. });
  2559. document.getElementById('tabbar').style.display = (state.loggedIn) ? 'flex' : 'none';
  2560. document.querySelectorAll('.tabbar .tab').forEach(function(t){ t.classList.toggle('on', t.dataset.tab===tab); });
  2561. if (tab==='home') renderHome();
  2562. if (tab==='health') renderHealth();
  2563. if (tab==='growth') renderGrowth();
  2564. if (tab==='profile') renderProfile();
  2565. }
  2566. function openDim(){ document.getElementById('dim-mask').classList.add('show'); document.getElementById('dim-sheet').classList.add('show'); }
  2567. function closeDim(){ document.getElementById('dim-mask').classList.remove('show'); document.getElementById('dim-sheet').classList.remove('show'); }
  2568. /* ===== 二级页栈(Task 页:五维总览 / 维度详情 / 上传 / 报告) ===== */
  2569. var taskStack=[];
  2570. var TASK_SCREENS=['overview','dim','upload','report','quiz','risk','prep','report7'];
  2571. function pushScreen(name){
  2572. TASK_SCREENS.forEach(function(s){
  2573. var el=document.getElementById('screen-'+s);
  2574. if (el) el.classList.remove('active');
  2575. });
  2576. if (name) taskStack.push(name);
  2577. if (name){
  2578. var el=document.getElementById('screen-'+name);
  2579. if (el) el.classList.add('active');
  2580. }
  2581. // 二级页隐藏 TabBar
  2582. document.getElementById('tabbar').style.display = name ? 'none' : (state.loggedIn?'flex':'none');
  2583. if (!name && state.loggedIn) setTab(currentTab);
  2584. }
  2585. function backTo(tab){
  2586. taskStack=[];
  2587. pushScreen(null);
  2588. if (tab) setTab(tab);
  2589. }
  2590. function openDimDetail(code){
  2591. renderDim(code);
  2592. pushScreen('dim');
  2593. }
  2594. function openOverview(){
  2595. renderOverview();
  2596. pushScreen('overview');
  2597. }
  2598. function openReport(){
  2599. setRptRange(rptRange, document.querySelector('#rpt-tabs .rtt.on'));
  2600. pushScreen('report');
  2601. }
  2602. function switchMember(m){
  2603. document.querySelectorAll('.mchip').forEach(function(c){ c.classList.toggle('on', c.dataset.member===m); });
  2604. toast(m==='me'?'已切换到:我':'已切换到:小宇');
  2605. }
  2606. function completeTask(btn){
  2607. if (btn.dataset.done) return;
  2608. btn.dataset.done='1';
  2609. btn.textContent='已得 ✓'; btn.classList.add('done'); btn.disabled=true;
  2610. // 成果驱动:累加成长分 + 连续打卡
  2611. growthState.pts += 10;
  2612. growthState.streak += 1;
  2613. growthState.baseTasks += 1;
  2614. if (currentTab==='growth') renderAchievementHero();
  2615. toast('获得成长分 +10 · 连续打卡 '+growthState.streak+' 天');
  2616. }
  2617. function setHealthSeg(seg, el){
  2618. document.querySelectorAll('.seg .sg').forEach(function(s){ s.classList.remove('on'); });
  2619. el.classList.add('on');
  2620. renderHealth();
  2621. toast('切换到:'+el.textContent);
  2622. }
  2623. var toastTimer;
  2624. function toast(msg){
  2625. var t=document.getElementById('toast'); t.textContent=msg; t.classList.add('show');
  2626. clearTimeout(toastTimer); toastTimer=setTimeout(function(){ t.classList.remove('show'); }, 1600);
  2627. }
  2628. /* 登录态切换(演示) */
  2629. var state={ loggedIn:true };
  2630. function applyLogin(){
  2631. document.getElementById('db-in').classList.toggle('on', state.loggedIn);
  2632. document.getElementById('db-out').classList.toggle('on', !state.loggedIn);
  2633. document.getElementById('tabbar').style.display = state.loggedIn ? 'flex' : 'none';
  2634. ['home','health','growth','profile'].forEach(function(t){ document.getElementById('screen-'+t).style.display = state.loggedIn? 'block':'none'; });
  2635. document.getElementById('screen-login').style.display = state.loggedIn? 'none':'block';
  2636. document.getElementById('screen-login').classList.toggle('active', !state.loggedIn);
  2637. if (state.loggedIn){ setTab(currentTab); }
  2638. }
  2639. function demoLogin(){ state.loggedIn=true; applyLogin(); toast('欢迎回来,林晓'); }
  2640. document.getElementById('db-in').onclick=function(){ state.loggedIn=true; applyLogin(); };
  2641. document.getElementById('db-out').onclick=function(){ state.loggedIn=false; applyLogin(); };
  2642. /* ===== SVG 图标精灵(内联,替代 emoji) ===== */
  2643. var SPRITE = {
  2644. check:'<polyline points="4 12 9 17 20 6"/>',
  2645. star:'<polygon points="12 3 14.5 9.5 21 10 16 14.5 17.5 21 12 17.5 6.5 21 8 14.5 3 10 9.5 9.5"/>',
  2646. heart:'<path d="M12 20s-7-4.4-7-9.5A4 4 0 0 1 12 7a4 4 0 0 1 7 3.5C19 15.6 12 20 12 20z"/>',
  2647. target:'<circle cx="12" cy="12" r="9"/><circle cx="12" cy="12" r="5"/><circle cx="12" cy="12" r="1.5" fill="currentColor"/>',
  2648. bulb:'<path d="M9 18h6M10 21h4"/><path d="M12 3a6 6 0 0 0-4 10.5c.7.7 1 1.5 1 2.5h6c0-1 .3-1.8 1-2.5A6 6 0 0 0 12 3z"/>',
  2649. coin:'<circle cx="12" cy="12" r="9"/><path d="M12 7v10M9.5 9.5h4a1.5 1.5 0 0 1 0 3h-3a1.5 1.5 0 0 0 0 3h4"/>',
  2650. flame:'<path d="M12 3c1 3-2 4-2 7a2 2 0 0 0 4 0c0-1 0-1 .5-2 1.5 2 2.5 3.5 2.5 6a5 5 0 0 1-10 0c0-4 3-6 5-11z"/>',
  2651. gift:'<rect x="3" y="8" width="18" height="13" rx="2"/><path d="M3 12h18M12 8v13"/><path d="M12 8C10 8 8 6 9 4.5 10.5 4 12 6 12 8zM12 8c2 0 4-2 3-3.5C13.5 4 12 6 12 8z"/>',
  2652. medal:'<circle cx="12" cy="9" r="6"/><path d="M9 14l-2 7 5-3 5 3-2-7"/>',
  2653. book:'<path d="M4 5a2 2 0 0 1 2-2h12v16H6a2 2 0 0 0-2 2z"/><path d="M4 19a2 2 0 0 1 2-2h12"/>',
  2654. upload:'<path d="M12 16V4M7 9l5-5 5 5"/><path d="M4 20h16"/>',
  2655. target2:'',
  2656. diet:'<path d="M5 3v8a3 3 0 0 0 6 0V3M8 3v18M16 3c-1.5 0-2 2-2 4s.5 4 2 4 2-2 2-4-.5-4-2-4zM16 11v10"/>',
  2657. run:'<circle cx="15" cy="5" r="2"/><path d="M13 21l2-5-3-2-2 3M15 14l3 2 1 4M13 11l3 1 2-1"/>',
  2658. moon:'<path d="M20 14a8 8 0 1 1-9-11 6 6 0 0 0 9 11z"/>',
  2659. smile:'<circle cx="12" cy="12" r="9"/><path d="M8 14s1.5 2 4 2 4-2 4-2"/><path d="M9 9h.01M15 9h.01"/>',
  2660. people:'<circle cx="9" cy="8" r="3"/><path d="M3 20c0-3 2.5-5 6-5s6 2 6 5"/><path d="M16 6a3 3 0 0 1 0 6M21 20c0-2.5-1.5-4-4-4.5"/>',
  2661. share:'<circle cx="18" cy="5" r="3"/><circle cx="6" cy="12" r="3"/><circle cx="18" cy="19" r="3"/><path d="M8.6 13.5l6.8 4M15.4 6.5l-6.8 4"/>',
  2662. cam:'<path d="M4 8h3l2-3h6l2 3h3v11H4z"/><circle cx="12" cy="13" r="3.4"/>',
  2663. chart:'<path d="M3 17l5-5 4 4 8-8"/><path d="M16 8h4v4"/>',
  2664. leaf:'<path d="M5 19c0-8 6-13 14-14 0 9-5 14-13 14z"/><path d="M5 19c3-4 6-6 10-7"/>',
  2665. clock:'<circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/>',
  2666. alert:'<path d="M12 3l9 16H3z"/><path d="M12 10v4M12 17h.01"/>',
  2667. shield:'<path d="M12 3l8 3v6c0 5-3.5 8.5-8 9.5-4.5-1-8-4.5-8-9.5V6z"/><path d="M9 12l2 2 4-4"/>'
  2668. };
  2669. (function injectSprite(){
  2670. var defs='';
  2671. for (var k in SPRITE){ defs+='<symbol id="i-'+k+'" viewBox="0 0 24 24">'+SPRITE[k]+'</symbol>'; }
  2672. var s=document.createElementNS('http://www.w3.org/2000/svg','svg');
  2673. s.setAttribute('style','display:none'); s.innerHTML=defs;
  2674. document.body.appendChild(s);
  2675. })();
  2676. /* 时钟 */
  2677. function tick(){ var d=new Date(); document.getElementById('clock').textContent = d.getHours()+':'+String(d.getMinutes()).padStart(2,'0'); }
  2678. tick(); setInterval(tick, 30000);
  2679. /* 闪屏(还原 flash 页:2s 自动进入,轻触可跳过) */
  2680. function hideSplash(){
  2681. clearTimeout(splashTimer);
  2682. var s=document.getElementById('splash');
  2683. if (s) s.classList.add('hide');
  2684. }
  2685. var splashTimer = setTimeout(hideSplash, 2000);
  2686. /* 初始化 */
  2687. renderHome(); renderHealth(); renderGrowth(); renderProfile(); renderDimSheet();
  2688. renderOverview(); setRptRange('week', document.querySelector('#rpt-tabs .rtt.on'));
  2689. renderUpload(); renderPrepPage(); renderD7();
  2690. applyLogin();
  2691. </script>
  2692. </body>
  2693. </html>