<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>📊 政策新闻仪表盘</title>
    <script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.4/dist/chart.umd.min.js"></script>
    <style>
        * { margin: 0; padding: 0; box-sizing: border-box; }
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
            background: #0f0f1a;
            color: #e0e0e0;
            min-height: 100vh;
            padding: 20px;
        }
        .header {
            text-align: center;
            margin-bottom: 30px;
        }
        .header h1 {
            font-size: 28px;
            background: linear-gradient(135deg, #00d2ff, #7b2ff7);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            margin-bottom: 8px;
        }
        .header .date {
            color: #888;
            font-size: 14px;
        }
        .summary-cards {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 16px;
            margin-bottom: 30px;
        }
        .summary-card {
            background: linear-gradient(135deg, #1a1a2e, #16213e);
            border-radius: 12px;
            padding: 20px;
            text-align: center;
            border: 1px solid #2a2a4a;
        }
        .summary-card .number {
            font-size: 36px;
            font-weight: bold;
            margin-bottom: 4px;
        }
        .summary-card .label { color: #888; font-size: 13px; }
        .bullish .number { color: #00e676; }
        .bearish .number { color: #ff5252; }
        .neutral .number { color: #ffd740; }
        .chart-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
            margin-bottom: 30px;
        }
        .chart-box {
            background: linear-gradient(135deg, #1a1a2e, #16213e);
            border-radius: 12px;
            padding: 20px;
            border: 1px solid #2a2a4a;
        }
        .chart-box h3 {
            font-size: 16px;
            color: #aaa;
            margin-bottom: 16px;
        }
        .policy-list {
            background: linear-gradient(135deg, #1a1a2e, #16213e);
            border-radius: 12px;
            padding: 20px;
            border: 1px solid #2a2a4a;
        }
        .policy-list h3 {
            font-size: 18px;
            color: #aaa;
            margin-bottom: 16px;
        }
        .policy-item {
            display: flex;
            align-items: center;
            padding: 14px 16px;
            border-radius: 8px;
            margin-bottom: 10px;
            background: rgba(255,255,255,0.03);
            border-left: 4px solid;
        }
        .policy-item.bullish { border-left-color: #00e676; }
        .policy-item.bearish { border-left-color: #ff5252; }
        .policy-item.mixed { border-left-color: #ffd740; }
        .policy-item .tag {
            font-size: 12px;
            padding: 3px 10px;
            border-radius: 12px;
            margin-right: 12px;
            white-space: nowrap;
        }
        .tag.monetary { background: #1565c0; color: #fff; }
        .tag.fiscal { background: #7b1fa2; color: #fff; }
        .tag.industry { background: #2e7d32; color: #fff; }
        .tag.geopolitical { background: #e65100; color: #fff; }
        .tag.regulation { background: #c62828; color: #fff; }
        .policy-item .content { flex: 1; }
        .policy-item .title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
        .policy-item .impact { font-size: 12px; color: #888; }
        .policy-item .arrow {
            font-size: 20px;
            margin-left: 12px;
        }
        .arrow.up { color: #00e676; }
        .arrow.down { color: #ff5252; }
        .arrow.flat { color: #ffd740; }
        .footer {
            text-align: center;
            color: #555;
            font-size: 12px;
            margin-top: 30px;
        }
        canvas { max-height: 250px; }
    </style>
</head>
<body>
    <div class="header">
        <h1>📊 政策新闻仪表盘</h1>
        <div class="date">DATE_PLACEHOLDER</div>
    </div>

    <!-- 概览卡片 -->
    <div class="summary-cards">
        <div class="summary-card bullish">
            <div class="number">BULLISH_COUNT</div>
            <div class="label">🟢 利好政策</div>
        </div>
        <div class="summary-card bearish">
            <div class="number">BEARISH_COUNT</div>
            <div class="label">🔴 利空政策</div>
        </div>
        <div class="summary-card neutral">
            <div class="number">MIXED_COUNT</div>
            <div class="label">🟡 中性/混合</div>
        </div>
    </div>

    <!-- 图表区 -->
    <div class="chart-grid">
        <div class="chart-box">
            <h3>📈 板块影响热力</h3>
            <canvas id="sectorChart"></canvas>
        </div>
        <div class="chart-box">
            <h3>🏷️ 政策类型分布</h3>
            <canvas id="typeChart"></canvas>
        </div>
    </div>

    <!-- 政策列表 -->
    <div class="policy-list">
        <h3>📋 政策详情</h3>
        POLICY_ITEMS_PLACEHOLDER
    </div>

    <div class="footer">
        Powered by Hermes Agent · 政策新闻监控
    </div>

    <script>
        // 板块影响柱状图
        new Chart(document.getElementById('sectorChart'), {
            type: 'bar',
            data: {
                labels: SECTOR_LABELS,
                datasets: [{
                    label: '影响指数',
                    data: SECTOR_VALUES,
                    backgroundColor: SECTOR_COLORS,
                    borderRadius: 6,
                    borderSkipped: false,
                }]
            },
            options: {
                responsive: true,
                indexAxis: 'y',
                plugins: { legend: { display: false } },
                scales: {
                    x: {
                        grid: { color: 'rgba(255,255,255,0.05)' },
                        ticks: { color: '#888' }
                    },
                    y: {
                        grid: { display: false },
                        ticks: { color: '#ccc', font: { size: 12 } }
                    }
                }
            }
        });

        // 政策类型饼图
        new Chart(document.getElementById('typeChart'), {
            type: 'doughnut',
            data: {
                labels: TYPE_LABELS,
                datasets: [{
                    data: TYPE_VALUES,
                    backgroundColor: ['#1565c0','#7b1fa2','#2e7d32','#e65100','#c62828'],
                    borderWidth: 0,
                    spacing: 3,
                }]
            },
            options: {
                responsive: true,
                plugins: {
                    legend: {
                        position: 'bottom',
                        labels: { color: '#aaa', padding: 16, font: { size: 12 } }
                    }
                },
                cutout: '55%'
            }
        });
    </script>
</body>
</html>
