Spaces:
Running
Running
Update index.html
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222<!DOCTYPE html><html lang="zh-TW"><head><meta charset="UTF-8"><title>大仁哥曝險與再平衡計算機</title><style>body,div,input,select,button,p,h1,h2,h3,span,label,strong{box-sizing:border-box;font-family:"Microsoft JhengHei",sans-serif;}body{background-color:rgb(245,247,250);margin:0;padding:20px;display:flex;justify-content:center;}.container{background-color:rgb(255,255,255);padding:30px;border-radius:12px;box-shadow:0 4px 12px rgb(0,0,0,0.1);max-width:800px;width:100%;display:flex;flex-wrap:wrap;gap:30px;}.left-panel,.right-panel{flex:1;min-width:300px;}h2{color:rgb(33,37,41);border-bottom:2px solid rgb(226,232,240);padding-bottom:10px;}.input-group{margin-bottom:15px;}.input-group label{display:block;margin-bottom:5px;color:rgb(73,80,87);font-weight:bold;}.input-group input,.input-group select{width:100%;padding:10px;border:1px solid rgb(206,212,218);border-radius:6px;font-size:16px;}.result-box{background-color:rgb(248,249,250);padding:15px;border-radius:8px;margin-bottom:15px;}.result-item{display:flex;justify-content:space-between;margin-bottom:10px;font-size:18px;}.result-item.highlight{color:rgb(220,53,69);font-weight:bold;font-size:20px;}.progress-bar-bg{background-color:rgb(226,232,240);border-radius:10px;height:20px;width:100%;overflow:hidden;margin-top:5px;}.progress-bar-fill{height:100%;background-color:rgb(76,175,80);transition:width 0.3s,background-color 0.3s;}.allocation-bar{display:flex;height:20px;border-radius:10px;overflow:hidden;margin-top:10px;}.alloc-lev{background-color:rgb(220,53,69);}.alloc-pro{background-color:rgb(255,193,7);}.alloc-cash{background-color:rgb(76,175,80);}.legend{display:flex;gap:10px;font-size:14px;margin-top:5px;}.legend-item{display:flex;align-items:center;gap:5px;}.dot{width:12px;height:12px;border-radius:50%;}.advice-box{background-color:rgb(232,244,253);border-left:5px solid rgb(33,150,243);padding:15px;border-radius:4px;font-size:16px;color:rgb(13,71,161);line-height:1.5;}.warning{background-color:rgb(253,237,237);border-left:5px solid rgb(244,67,54);color:rgb(183,28,28);}</style></head><body><div class="container"><div class="left-panel"><h2>資產輸入區</h2><div class="input-group"><label>槓桿ETF(正2)市值額度</label><input type="number" class="lev-input" placeholder="請輸入金額" oninput="calculate()"></div><div class="input-group"><label>原型ETF(0050)市值額度</label><input type="number" class="pro-input" placeholder="請輸入金額" oninput="calculate()"></div><div class="input-group"><label>現金額度</label><input type="number" class="cash-input" placeholder="請輸入金額" oninput="calculate()"></div><h2>再平衡目標設定</h2><div class="input-group"><label>目標總曝險比例(%)</label><input type="number" class="target-input" placeholder="例如:120" oninput="calculate()"></div><div class="input-group"><label>預計調整工具</label><select class="adjust-select" onchange="calculate()"><option value="lev">買賣槓桿ETF(正2)</option><option value="pro">買賣原型ETF(0050)</option></select></div></div><div class="right-panel"><h2>分析結果</h2><div class="result-box"><div class="result-item"><span>總資產:</span><span class="total-assets">0</span></div><div class="result-item"><span>當前總曝險金額:</span><span class="total-exposure">0</span></div><div class="result-item highlight"><span>實際曝險比例:</span><span class="exposure-pct">0%</span></div><div class="progress-bar-bg"><div class="progress-bar-fill" style="width:0%;"></div></div></div><div class="result-box"><div class="result-item"><span>資產佔比(正2:原型:現金):</span><span class="allocation-text">0:0:0</span></div><div class="allocation-bar"><div class="alloc-lev" style="width:0%;"></div><div class="alloc-pro" style="width:0%;"></div><div class="alloc-cash" style="width:0%;"></div></div><div class="legend"><div class="legend-item"><div class="dot alloc-lev"></div>正2</div><div class="legend-item"><div class="dot alloc-pro"></div>原型</div><div class="legend-item"><div class="dot alloc-cash"></div>現金</div></div></div><h2>調整建議</h2><div class="advice-box advice-text">請輸入資料以獲取建議。</div></div></div><script>function calculate(){const lev=parseFloat(document.querySelector('.lev-input').value)||0;const pro=parseFloat(document.querySelector('.pro-input').value)||0;const cash=parseFloat(document.querySelector('.cash-input').value)||0;const targetExposurePct=parseFloat(document.querySelector('.target-input').value)||0;const adjustAsset=document.querySelector('.adjust-select').value;const totalAssets=lev+pro+cash;const elAssets=document.querySelector('.total-assets');const elExposure=document.querySelector('.total-exposure');const elPct=document.querySelector('.exposure-pct');const elBar=document.querySelector('.progress-bar-fill');const elAllocText=document.querySelector('.allocation-text');const elAllocLev=document.querySelector('.alloc-lev');const elAllocPro=document.querySelector('.alloc-pro');const elAllocCash=document.querySelector('.alloc-cash');const elAdvice=document.querySelector('.advice-text');const adviceBox=document.querySelector('.advice-box');if(totalAssets===0){elAssets.textContent='0';elExposure.textContent='0';elPct.textContent='0%';elBar.style.width='0%';elAllocText.textContent='0:0:0';elAllocLev.style.width='0%';elAllocPro.style.width='0%';elAllocCash.style.width='0%';elAdvice.textContent='請輸入資料以獲取建議。';adviceBox.className='advice-box\tadvice-text';return;}const totalExposure=lev+lev+pro;const currentExposurePct=(totalExposure/totalAssets)/(1/100);elAssets.textContent=Math.round(totalAssets).toLocaleString();elExposure.textContent=Math.round(totalExposure).toLocaleString();elPct.textContent=currentExposurePct.toFixed(2)+'%';let barWidth=currentExposurePct;if(barWidth>100)barWidth=100;elBar.style.width=barWidth+'%';if(currentExposurePct<=100){elBar.style.backgroundColor='rgb(76,175,80)';}else if(currentExposurePct<=150){elBar.style.backgroundColor='rgb(255,193,7)';}else{elBar.style.backgroundColor='rgb(244,67,54)';}let rawLev=(lev/totalAssets)/(1/100);let rawPro=(pro/totalAssets)/(1/100);let rawCash=(cash/totalAssets)/(1/100);let fLev=Math.floor(rawLev);let fPro=Math.floor(rawPro);let fCash=Math.floor(rawCash);let remainder=100-(fLev+fPro+fCash);let fractions=[{key:'lev',val:rawLev-fLev},{key:'pro',val:rawPro-fPro},{key:'cash',val:rawCash-fCash}];fractions.sort(function(a,b){return b.val-a.val;});for(let i=0;i<remainder;i++){if(fractions[i].key==='lev')fLev++;else if(fractions[i].key==='pro')fPro++;else if(fractions[i].key==='cash')fCash++;}elAllocText.textContent=fLev+':'+fPro+':'+fCash;elAllocLev.style.width=fLev+'%';elAllocPro.style.width=fPro+'%';elAllocCash.style.width=fCash+'%';if(targetExposurePct>0){const targetExposureAmount=totalAssets/(100/targetExposurePct);const diffExposure=targetExposureAmount-totalExposure;if(Math.abs(diffExposure)<1){adviceBox.className='advice-box\tadvice-text';elAdvice.textContent='目前曝險已達標,無需調整。';}else{if(adjustAsset==='lev'){const changeAmount=diffExposure/2;if(changeAmount>0){if(cash>=changeAmount){adviceBox.className='advice-box\tadvice-text';elAdvice.innerHTML='建議將現金轉買入槓桿ETF額度:<br><strong>'+Math.round(changeAmount).toLocaleString()+'</strong>';}else{adviceBox.className='advice-box\tadvice-text\twarning';elAdvice.innerHTML='目標需要買入槓桿ETF額度:<strong>'+Math.round(changeAmount).toLocaleString()+'</strong><br>警告:現金餘額不足!';}}else{const sellAmount=Math.abs(changeAmount);if(lev>=sellAmount){adviceBox.className='advice-box\tadvice-text';elAdvice.innerHTML='建議賣出槓桿ETF轉為現金額度:<br><strong>'+Math.round(sellAmount).toLocaleString()+'</strong>';}else{adviceBox.className='advice-box\tadvice-text\twarning';elAdvice.innerHTML='目標需要賣出槓桿ETF額度:<strong>'+Math.round(sellAmount).toLocaleString()+'</strong><br>警告:槓桿ETF餘額不足以賣出!';}}}else{const changeAmount=diffExposure;if(changeAmount>0){if(cash>=changeAmount){adviceBox.className='advice-box\tadvice-text';elAdvice.innerHTML='建議將現金轉買入原型ETF額度:<br><strong>'+Math.round(changeAmount).toLocaleString()+'</strong>';}else{adviceBox.className='advice-box\tadvice-text\twarning';elAdvice.innerHTML='目標需要買入原型ETF額度:<strong>'+Math.round(changeAmount).toLocaleString()+'</strong><br>警告:現金餘額不足!';}}else{const sellAmount=Math.abs(changeAmount);if(pro>=sellAmount){adviceBox.className='advice-box\tadvice-text';elAdvice.innerHTML='建議賣出原型ETF轉為現金額度:<br><strong>'+Math.round(sellAmount).toLocaleString()+'</strong>';}else{adviceBox.className='advice-box\tadvice-text\twarning';elAdvice.innerHTML='目標需要賣出原型ETF額度:<strong>'+Math.round(sellAmount).toLocaleString()+'</strong><br>警告:原型ETF餘額不足以賣出!';}}}}}else{adviceBox.className='advice-box\tadvice-text';elAdvice.textContent='請在左側輸入目標總曝險比例以獲得調整建議。';}}</script></body>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221<!DOCTYPE html><html lang="zh-TW"><head><meta charset="UTF-8"><title>大仁哥曝險與資產動態平衡計算機</title><style>html,body,div,input,select,button,p,h1,h2,h3,span,label,strong,ol,li{box-sizing:border-box;font-family:"Microsoft JhengHei",sans-serif;margin:0;padding:0;}body{background-color:rgb(245,247,250);padding:24px;display:flex;justify-content:center;}.app-container{background-color:rgb(255,255,255);padding:32px;border-radius:14px;box-shadow:0 6px 16px rgba(0,0,0,0.08);max-width:960px;width:100%;display:flex;flex-wrap:wrap;gap:32px;}.input-col,.output-col{flex:1;min-width:320px;}.section-title{color:rgb(33,37,41);font-size:20px;font-weight:bold;border-bottom:2px solid rgb(226,232,240);padding-bottom:12px;margin-bottom:20px;}.field-group{margin-bottom:16px;}.field-group label{display:block;margin-bottom:6px;color:rgb(73,80,87);font-weight:bold;font-size:15px;}.field-group input{width:100%;padding:12px;border:1px solid rgb(206,212,218);border-radius:8px;font-size:16px;outline:none;transition:border-color 0.2s;}.field-group input:focus{border-color:rgb(13,110,253);}.metric-card{background-color:rgb(248,249,250);padding:18px;border-radius:10px;margin-bottom:18px;border:1px solid rgb(233,236,239);}.metric-row{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;font-size:16px;}.metric-row.accent{color:rgb(220,53,69);font-weight:bold;font-size:20px;}.meter-bg{background-color:rgb(226,232,240);border-radius:8px;height:18px;width:100%;overflow:hidden;margin-top:8px;}.meter-fill{height:100%;background-color:rgb(40,167,69);transition:width 0.3s,background-color 0.3s;}.split-bar{display:flex;height:18px;border-radius:8px;overflow:hidden;margin-top:8px;}.bar-lev{background-color:rgb(220,53,69);}.bar-pro{background-color:rgb(255,193,7);}.bar-cash{background-color:rgb(40,167,69);}.legend-group{display:flex;gap:14px;font-size:13px;margin-top:8px;color:rgb(108,117,125);}.legend-point{display:flex;align-items:center;gap:5px;}.badge-dot{width:10px;height:10px;border-radius:50%;}.advice-panel{display:flex;flex-direction:column;gap:14px;}.plan-card{background-color:rgb(241,248,255);border:1px solid rgb(184,218,255);border-left:5px solid rgb(13,110,253);padding:16px;border-radius:8px;color:rgb(10,54,115);}.plan-card.neutral{background-color:rgb(248,249,250);border:1px solid rgb(222,226,230);border-left:5px solid rgb(108,117,125);color:rgb(73,80,87);}.plan-card.warn{background-color:rgb(255,243,205);border:1px solid rgb(255,238,186);border-left:5px solid rgb(255,193,7);color:rgb(133,100,4);}.plan-header{font-weight:bold;font-size:16px;margin-bottom:8px;}.plan-desc{font-size:14px;line-height:1.6;margin-bottom:10px;}.action-steps{padding-left:20px;font-size:14px;line-height:1.7;margin-bottom:10px;}.balance-preview{background-color:rgba(255,255,255,0.7);border-radius:6px;padding:8px 12px;font-size:13px;display:flex;flex-wrap:wrap;gap:12px;border:1px dashed rgb(184,218,255);}</style></head><body><div class="app-container"><div class="input-col"><div class="section-title">第一步:現有資產額度</div><div class="field-group"><label>槓桿ETF(正2)市值</label><input type="number" class="val-lev" placeholder="例如:300000" oninput="runCalculations()"></div><div class="field-group"><label>原型0050市值</label><input type="number" class="val-pro" placeholder="例如:400000" oninput="runCalculations()"></div><div class="field-group"><label>現金儲備額度</label><input type="number" class="val-cash" placeholder="例如:300000" oninput="runCalculations()"></div><div class="section-title">第二步:目標曝險設定</div><div class="field-group"><label>期望總曝險比例(%)</label><input type="number" class="val-target" placeholder="例如:100 或 120" oninput="runCalculations()"></div></div><div class="output-col"><div class="section-title">現況曝險與資產結構</div><div class="metric-card"><div class="metric-row"><span>可投資總資產:</span><span class="txt-assets">0 元</span></div><div class="metric-row"><span>當前總曝險金額:</span><span class="txt-exposure">0 元</span></div><div class="metric-row accent"><span>實際總曝險比:</span><span class="txt-exp-pct">0%</span></div><div class="meter-bg"><div class="meter-fill" style="width:0%;"></div></div></div><div class="metric-card"><div class="metric-row"><span>資金配置佔比(正2:原型:現金):</span><span class="txt-ratio">0:0:0</span></div><div class="split-bar"><div class="bar-lev" style="width:0%;"></div><div class="bar-pro" style="width:0%;"></div><div class="bar-cash" style="width:0%;"></div></div><div class="legend-group"><div class="legend-point"><div class="badge-dot bar-lev"></div>正2部位</div><div class="legend-point"><div class="badge-dot bar-pro"></div>原型部位</div><div class="legend-point"><div class="badge-dot bar-cash"></div>現金部位</div></div></div><div class="section-title">大仁哥既有部位調整策略</div><div class="advice-panel"><div class="plan-card neutral">請於左側輸入各項額度與期望目標曝險比例以取得分析。</div></div></div></div><script>function fmt(val){return Math.round(val).toLocaleString();}function runCalculations(){const levVal=parseFloat(document.querySelector('.val-lev').value)||0;const proVal=parseFloat(document.querySelector('.val-pro').value)||0;const cashVal=parseFloat(document.querySelector('.val-cash').value)||0;const targetPct=parseFloat(document.querySelector('.val-target').value)||0;const total=levVal+proVal+cashVal;const txtAssets=document.querySelector('.txt-assets');const txtExp=document.querySelector('.txt-exposure');const txtExpPct=document.querySelector('.txt-exp-pct');const meterFill=document.querySelector('.meter-fill');const txtRatio=document.querySelector('.txt-ratio');const barLev=document.querySelector('.bar-lev');const barPro=document.querySelector('.bar-pro');const barCash=document.querySelector('.bar-cash');const adviceBox=document.querySelector('.advice-panel');if(total===0){txtAssets.textContent='0 元';txtExp.textContent='0 元';txtExpPct.textContent='0%';meterFill.style.width='0%';txtRatio.textContent='0:0:0';barLev.style.width='0%';barPro.style.width='0%';barCash.style.width='0%';adviceBox.innerHTML='<div class="plan-card neutral">請於左側輸入各項額度與期望目標曝險比例以取得分析。</div>';return;}const currentExposure=levVal+levVal+proVal;const currentPct=(currentExposure/total)/(1/100);txtAssets.textContent=fmt(total)+' 元';txtExp.textContent=fmt(currentExposure)+' 元';txtExpPct.textContent=currentPct.toFixed(2)+'%';let fillWidth=currentPct;if(fillWidth>100)fillWidth=100;meterFill.style.width=fillWidth+'%';if(currentPct<=100){meterFill.style.backgroundColor='rgb(40,167,69)';}else if(currentPct<=150){meterFill.style.backgroundColor='rgb(255,193,7)';}else{meterFill.style.backgroundColor='rgb(220,53,69)';}let rLev=(levVal/total)/(1/100);let rPro=(proVal/total)/(1/100);let rCash=(cashVal/total)/(1/100);let floorLev=Math.floor(rLev);let floorPro=Math.floor(rPro);let floorCash=Math.floor(rCash);let rem=100-(floorLev+floorPro+floorCash);let fractions=[{k:'lev',v:rLev-floorLev},{k:'pro',v:rPro-floorPro},{k:'cash',v:rCash-floorCash}];fractions.sort(function(a,b){return b.v-a.v;});for(let i=0;i<rem;i++){if(fractions[i].k==='lev')floorLev++;else if(fractions[i].k==='pro')floorPro++;else if(fractions[i].k==='cash')floorCash++;}txtRatio.textContent=floorLev+':'+floorPro+':'+floorCash;barLev.style.width=floorLev+'%';barPro.style.width=floorPro+'%';barCash.style.width=floorCash+'%';if(targetPct<=0){adviceBox.innerHTML='<div class="plan-card neutral">請於左側設定大於0的期望總曝險比例(%)。</div>';return;}if(targetPct>200){adviceBox.innerHTML='<div class="plan-card warn"><div class="plan-header">超出工具內建極限(200%)</div><div class="plan-desc">在不進行額外融資或向券商借貸的前提下,即便將100%資產全數押入槓桿ETF(正2),最大極限曝險即為200%。若欲追求超過200%的曝險,需引進外部信貸或期貨部位。</div></div>';return;}const targetExposureAmount=total/(100/targetPct);const diffExp=targetExposureAmount-currentExposure;if(Math.abs(diffExp)<1){adviceBox.innerHTML='<div class="plan-card" style="border-left-color:rgb(40,167,69);"><div class="plan-header">目前配置已精準達標</div><div class="plan-desc">當前總曝險為 '+fmt(currentExposure)+' 元('+currentPct.toFixed(1)+'%),已完美吻合目標,維持既有紀律即可。</div></div>';return;}let cardsHtml='';if(diffExp>0){if(proVal>=diffExp){const swapVal=diffExp;cardsHtml+='<div class="plan-card"><div class="plan-header">策略一:大仁哥零現金置換法(推薦)</div><div class="plan-desc">核心思維:<strong>「以正2換取原型,釋放資金效率」</strong>。將原型0050賣出轉入正2,每轉1元即可提升1元曝險,<strong>完全不消耗任何防禦現金</strong>:</div><ol class="action-steps"><li>賣出原型0050額度:'+fmt(swapVal)+' 元</li><li>將取得資金全數買入槓桿正2:'+fmt(swapVal)+' 元</li><li>現金部位完全不動:保留 '+fmt(cashVal)+' 元作為生活與心理安全閥</li></ol><div class="balance-preview"><span>調整後正2:'+fmt(levVal+swapVal)+' 元</span><span>調整後0050:'+fmt(proVal-swapVal)+' 元</span><span>調整後現金:'+fmt(cashVal)+' 元</span></div></div>';}else{const swapAllPro=proVal;const remainExp=diffExp-swapAllPro;const cashBuyLev=remainExp/2;cardsHtml+='<div class="plan-card"><div class="plan-header">策略一:既有資產梯次補足法</div><div class="plan-desc">現有原型0050全數換為正2後仍有曝險缺口,由既有現金補足:</div><ol class="action-steps"><li>賣出全部原型0050:'+fmt(swapAllPro)+' 元,轉買槓桿正2</li><li>動用現金儲備額度:'+fmt(cashBuyLev)+' 元,買入槓桿正2</li><li>調整後剩餘現金:'+fmt(cashVal-cashBuyLev)+' 元</li></ol><div class="balance-preview"><span>調整後正2:'+fmt(levVal+swapAllPro+cashBuyLev)+' 元</span><span>調整後0050:0 元</span><span>調整後現金:'+fmt(cashVal-cashBuyLev)+' 元</span></div></div>';}const pureLevTarget=total/(200/targetPct);const pureCashTarget=total-pureLevTarget;const levGap=pureLevTarget-levVal;cardsHtml+='<div class="plan-card"><div class="plan-header">策略二:大仁哥50/50極簡純化架構</div><div class="plan-desc">大仁哥旗艦理念:<strong>「持有一倍槓桿時,原型ETF屬於低效冗餘資產」</strong>。出清原型0050,專注維持正2與強大現金護城河:</div><ol class="action-steps"><li>出清全部原型0050:賣出 '+fmt(proVal)+' 元變現</li><li>槓桿正2調整至目標額度:'+(levGap>=0?'買入 '+fmt(levGap):'賣出 '+fmt(Math.abs(levGap)))+' 元(持倉目標為 '+fmt(pureLevTarget)+' 元)</li><li>剩餘額度全數留存為現金儲備:持倉目標為 '+fmt(pureCashTarget)+' 元</li></ol><div class="balance-preview"><span>調整後正2:'+fmt(pureLevTarget)+' 元</span><span>調整後0050:0 元</span><span>調整後現金:'+fmt(pureCashTarget)+' 元</span></div></div>';}else{const dropExp=Math.abs(diffExp);if(levVal>=(dropExp/2)){const sellLev=dropExp/2;cardsHtml+='<div class="plan-card"><div class="plan-header">策略一:正2獲利調節・壯大現金護城河(推薦)</div><div class="plan-desc">核心思維:<strong>「股市大漲後適度賣出槓桿,鎖定利潤轉化為現金儲備」</strong>:</div><ol class="action-steps"><li>賣出槓桿正2額度:'+fmt(sellLev)+' 元轉為現金</li><li>原型0050額度不動:維持 '+fmt(proVal)+' 元</li><li>實體現金池增長:從 '+fmt(cashVal)+' 元提升至 '+fmt(cashVal+sellLev)+' 元(擴大未來回檔加碼餘裕)</li></ol><div class="balance-preview"><span>調整後正2:'+fmt(levVal-sellLev)+' 元</span><span>調整後0050:'+fmt(proVal)+' 元</span><span>調整後現金:'+fmt(cashVal+sellLev)+' 元</span></div></div>';}else{const sellAllLev=levVal;const remainDrop=dropExp-(levVal+levVal);const sellPro=remainDrop;cardsHtml+='<div class="plan-card"><div class="plan-header">策略一:雙向降槓桿獲利變現法</div><div class="plan-desc">欲調降之曝險幅度較大,需同步減碼正2與原型以收回充裕現金:</div><ol class="action-steps"><li>賣出全部槓桿正2:'+fmt(sellAllLev)+' 元轉為現金</li><li>賣出原型0050額度:'+fmt(sellPro)+' 元轉為現金</li><li>保留原型0050部位:'+fmt(proVal-sellPro)+' 元</li></ol><div class="balance-preview"><span>調整後正2:0 元</span><span>調整後0050:'+fmt(proVal-sellPro)+' 元</span><span>調整後現金:'+fmt(cashVal+sellAllLev+sellPro)+' 元</span></div></div>';}if(levVal>=dropExp){const swapLevToPro=dropExp;cardsHtml+='<div class="plan-card"><div class="plan-header">策略二:降槓桿不降股票・正2轉原型法</div><div class="plan-desc">若欲平抑波動風險,但不想增加手上閒置現金,可將正2轉為原型0050(每轉1元降低1元曝險):</div><ol class="action-steps"><li>賣出槓桿正2額度:'+fmt(swapLevToPro)+' 元</li><li>全數轉買入原型0050:'+fmt(swapLevToPro)+' 元</li><li>現金儲備維持不動:'+fmt(cashVal)+' 元</li></ol><div class="balance-preview"><span>調整後正2:'+fmt(levVal-swapLevToPro)+' 元</span><span>調整後0050:'+fmt(proVal+swapLevToPro)+' 元</span><span>調整後現金:'+fmt(cashVal)+' 元</span></div></div>';}else{const pureLevTarget=total/(200/targetPct);const pureCashTarget=total-pureLevTarget;cardsHtml+='<div class="plan-card"><div class="plan-header">策略二:大仁哥50/50極簡純化架構</div><div class="plan-desc">出清原型0050,將資產結構徹底重塑為純粹的正2加現金:</div><ol class="action-steps"><li>出清全部原型0050:賣出 '+fmt(proVal)+' 元</li><li>調整槓桿正2至目標持倉:'+fmt(pureLevTarget)+' 元</li><li>充實防禦現金池至目標:'+fmt(pureCashTarget)+' 元</li></ol><div class="balance-preview"><span>調整後正2:'+fmt(pureLevTarget)+' 元</span><span>調整後0050:0 元</span><span>調整後現金:'+fmt(pureCashTarget)+' 元</span></div></div>';}}adviceBox.innerHTML=cardsHtml;}</script></body>
index.html+185-186