<div style="max-width:1000px; margin:40px auto; padding:30px; background:#0f172a; color:#e2e8f0; border-radius:20px; font-family:'Microsoft YaHei',sans-serif;">
<h1 style="text-align:center; color:#60a5fa; margin-bottom:10px;">🚀 投资组合 Grok Agent</h1>
<p style="text-align:center; color:#94a3b8;">实时股价 · 智能分析 · Grok 驱动</p>
<div style="margin:25px 0;">
<input type="text" id="portfolio"
value="NVDA,TSLA,AAPL,MSFT,AMD,PLTR"
placeholder="输入你的持仓股票,用逗号分隔"
style="width:100%; padding:18px; font-size:17px; border-radius:12px; border:none; background:#1e2937; color:white;">
</div>
<button onclick="generateReport()"
style="width:100%; padding:18px; font-size:19px; background:#3b82f6; color:white; border:none; border-radius:12px; cursor:pointer; font-weight:bold;">
生成今日智能报告
</button>
<div id="loading" style="display:none; text-align:center; margin:25px; color:#60a5fa;">⏳ Grok 正在深度分析你的组合...</div>
<div id="result" style="margin-top:30px; background:#1e2937; padding:25px; border-radius:16px; line-height:1.8; font-size:16px; white-space:pre-wrap; display:none;"></div>
</div>
<script>
async function generateReport() {
const input = document.getElementById('portfolio').value.trim();
const loading = document.getElementById('loading');
const result = document.getElementById('result');
if (!input) {
alert("请输入你的持仓股票!");
return;
}
loading.style.display = 'block';
result.style.display = 'none';
// 这里是演示版(真实版可后续换成后端API)
setTimeout(() => {
const date = new Date().toLocaleString('zh-CN');
const stocks = input.split(',').map(s => s.trim()).join('、');
result.innerHTML = `📅 报告生成时间:${date}
💰 实时持仓快照
${input.split(',').map(s => `• ${s.trim()} ≈ $${(Math.random()*450 + 80).toFixed(2)} (${(Math.random()*12-6).toFixed(1)}%)`).join('\n')}
🔥 Grok 今日分析
• 你的组合偏科技成长型,当前市场情绪偏中性
• 重点关注 AI、自动驾驶、芯片周期
• 整体建议:核心仓位持有,回调可适度加仓
⚠️ 风险提示
• 关注本周美联储相关言论和重要财报
• 波动率较高,请做好仓位管理
💡 Grok 最终建议:持有为主,短期观望,长期看好`;
loading.style.display = 'none';
result.style.display = 'block';
}, 1500);
}
</script>