<!DOCTYPE html>
<html lang="zh-CN" data-theme="dark">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
    <script src="/static/instance_theme.js?v=50"></script>
    <link rel="stylesheet" href="/static/instance_theme_early.css?v=4">
    <link rel="stylesheet" href="/static/account_risk_badge.css?v=4">
    <link rel="stylesheet" href="/static/instance_page.css?v=9">
    <link rel="stylesheet" href="/static/instance_theme.css?v=97">
    <script src="/static/account_risk_badge.js?v=4"></script>
    <meta name="theme-color" content="#0b0d14">
    <title>{{ pwa_app_name }}</title>
</head>
<body
    data-embed-shell="1"
    data-intraday-discipline="{% if intraday_discipline %}1{% else %}0{% endif %}"
    data-risk-percent="{{ risk_percent }}"
    data-page="{{ initial_tab }}"
    data-position-sizing-mode="{{ position_sizing_mode }}"
    data-btc-leverage="{{ btc_leverage }}"
    data-alt-leverage="{{ alt_leverage }}"
    data-full-margin-buffer="{{ full_margin_buffer_ratio }}"
    data-balance-refresh-ms="{{ balance_refresh_seconds * 1000 }}"
    data-price-refresh-ms="{{ price_refresh_seconds * 1000 }}"
>
<div class="container">
    <div class="header">
        <h1>加密货币｜交易监控 + AI复盘一体化</h1>
    </div>
    <nav class="top-nav embed-top-nav" aria-label="实例导航">
        <a href="/dashboard" data-embed-tab="dashboard" class="{% if initial_tab == 'dashboard' %}active{% endif %}"{% if not display.show_nav_dashboard %} style="display:none"{% endif %}>数据看板</a>
        <a href="/key_monitor" data-embed-tab="key_monitor" class="{% if initial_tab == 'key_monitor' %}active{% endif %}">关键位监控</a>
        <a href="/trade" data-embed-tab="trade" class="{% if initial_tab == 'trade' %}active{% endif %}">实盘下单</a>
        {% if not intraday_discipline and display.show_nav_strategy %}
        <a href="/strategy" data-embed-tab="strategy" class="{% if initial_tab == 'strategy' %}active{% endif %}">策略交易</a>
        {% endif %}
        {% if not intraday_discipline and display.show_nav_strategy_records %}
        <a href="/strategy/records" data-embed-tab="strategy_records" class="{% if initial_tab == 'strategy_records' %}active{% endif %}">策略交易记录</a>
        {% endif %}
        {% if display.show_nav_records %}
        <a href="/records" data-embed-tab="records" class="{% if initial_tab == 'records' %}active{% endif %}">交易记录与复盘</a>
        {% endif %}
        {% if display.show_nav_stats %}
        <a href="/stats" data-embed-tab="stats" class="{% if initial_tab == 'stats' %}active{% endif %}">统计分析</a>
        {% endif %}
        {% if options_nav_visible and display.show_nav_options %}
        <a href="/options" data-embed-tab="options" class="{% if initial_tab == 'options' %}active{% endif %}">期权</a>
        {% endif %}
        {% if options_nav_visible and display.show_nav_options_review %}
        <a href="/options/review" data-embed-tab="options_review" class="{% if initial_tab == 'options_review' %}active{% endif %}">期权复盘</a>
        {% endif %}
        {% if hedge_plan_nav_visible and display.show_nav_hedge_plan %}
        <a href="/hedge-plan" data-embed-tab="hedge_plan" class="{% if initial_tab == 'hedge_plan' %}active{% endif %}">对冲计划</a>
        {% endif %}
        {% if display.show_nav_risk_policy %}
        <a href="/risk_policy" data-embed-tab="risk_policy" class="{% if initial_tab == 'risk_policy' %}active{% endif %}">风控说明</a>
        {% endif %}
        {% if display.show_nav_env_config %}
        <a href="/env_config" data-embed-tab="env_config" class="{% if initial_tab == 'env_config' %}active{% endif %}">env配置</a>
        {% endif %}
        <a href="/settings" data-embed-tab="settings" class="{% if initial_tab == 'settings' %}active{% endif %}">系统设置</a>
    </nav>
    <div id="embed-flash" class="flash" style="display:none" role="status"></div>

    {% include 'instance_header_panel.html' %}
    {% if initial_tab not in ('settings', 'risk_policy', 'env_config') and include_transfer_block %}
    {% include 'instance_top_bar.html' %}
    {% endif %}

    <div id="embed-page-root">
        {% include 'embed_page_fragment.html' %}
    </div>
</div>

<div class="modal" id="imgModal" onclick="closeModal()">
    <img id="bigImg" src="" alt="screenshot">
</div>
<div class="detail-modal" id="detailModal" onclick="closeDetailModal(event)">
    <div class="panel" onclick="event.stopPropagation()">
        <div class="panel-head">
            <div class="panel-title" id="detailTitle">详情</div>
            <div class="panel-actions">
                <button type="button" class="panel-fs" onclick="expandDetailToFullscreen()">全屏</button>
                <button type="button" class="panel-close" onclick="forceCloseDetailModal()">关闭</button>
            </div>
        </div>
        <div class="panel-body" id="detailBody"></div>
        <div id="detailImages" class="journal-detail-images" style="display:none"></div>
        <img id="detailImage" class="panel-image" src="" alt="detail-image" style="display:none" onclick="showImage(this.src)">
    </div>
</div>

<script src="/static/instance_ui.js?v=10"></script>
<script src="/static/journal_upload_slots.js?v=3"></script>
<script src="/static/instance_records_mobile.js?v=2"></script>
<script src="/static/time_close_ui.js?v=3"></script>
<script src="/static/ai_review_render.js?v=2"></script>
<script src="/static/form_submit_guard.js?v=2"></script>
<script>
const ORDER_ENTRY_MODEL_TRADE_STYLE = {{ entry_model_trade_style_map | tojson }};
const ORDER_ENTRY_MODEL_CATEGORIES = {{ entry_model_categories | tojson }};
const ORDER_ENTRY_MODEL_CODE_TO_CATEGORY = {{ entry_model_code_to_category | tojson }};
</script>
<script src="/static/order_entry_model.js?v=5"></script>
<script src="/static/manual_order_rr_preview.js?v=5"></script>
<script src="/static/symbol_live_price.js?v=2"></script>
<script src="/static/strategy_roll.js?v=6"></script>
<script src="/static/key_monitor_form.js?v=2"></script>
<script src="/static/instance_stats.js?v=4"></script>
{% include 'embed_boot_scripts.html' %}
<script src="/static/records_review_page.js?v=2"></script>
<script src="/static/options_expiry_countdown.js?v=1"></script>
<script src="/static/instance_dashboard.js?v=3"></script>
<script>
window.__INSTANCE_DISPLAY__ = {{ display | tojson }};
</script>
<script src="/static/instance_settings_prefs.js?v=15"></script>
<script src="/static/instance_live.js?v=6"></script>
<script src="/static/instance_embed.js?v=25"></script>
</body>
</html>
