<!DOCTYPE html>
<html lang="zh-TW" id="html-root">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{ title }}</title>
    <link rel="stylesheet" href="/static/css/styles.css">
    <style>
        /* 僅保留必要的頁面特定樣式和響應式調整 */

        /* 響應式調整 */
        @media (max-width: 768px) {
            .timeout-controls {
                flex-direction: column;
                align-items: flex-start;
                gap: 12px;
            }

            .timeout-separator {
                display: none;
            }
        }

        /* 頁面特定的佈局模式樣式 */

        /* 佈局模式樣式 - 工作區模式 */
        /* 工作區模式 - 顯示工作區頁籤，隱藏回饋和AI摘要頁籤 */
        body.layout-combined-vertical .tab-button[data-tab="combined"],
        body.layout-combined-horizontal .tab-button[data-tab="combined"] {
            display: inline-block;
        }

        body.layout-combined-vertical .tab-button[data-tab="feedback"],
        body.layout-combined-vertical .tab-button[data-tab="summary"],
        body.layout-combined-horizontal .tab-button[data-tab="feedback"],
        body.layout-combined-horizontal .tab-button[data-tab="summary"] {
            display: none;
        }

        /* 響應式設計 */
        @media (max-width: 768px) {
            .timeout-controls {
                flex-direction: column;
                align-items: flex-start;
                gap: 12px;
            }

            .timeout-separator {
                display: none;
            }
        }



        /* 工作區分頁的水平佈局樣式 */
        #tab-combined.active.combined-horizontal .combined-content {
            display: flex !important;
            flex-direction: row !important;
            gap: 16px;
            height: calc(100% - 60px); /* 減去描述區塊的高度 */
        }

        #tab-combined.active.combined-horizontal .combined-section:first-child {
            flex: 1 !important;
            min-width: 300px;
            max-width: 50%;
            overflow: hidden; /* 確保容器不超出範圍 */
        }

        #tab-combined.active.combined-horizontal .combined-section:last-child {
            flex: 1 !important;
            min-width: 400px;
        }

        #tab-combined.active.combined-horizontal .combined-summary {
            height: calc(100vh - 200px);
            max-height: 600px;
            overflow: hidden; /* 確保摘要容器不超出範圍 */
        }

        #tab-combined.active.combined-horizontal #combinedSummaryContent {
            height: 100%;
            min-height: 400px;
            overflow-y: auto; /* 添加垂直滾動條 */
            overflow-x: hidden; /* 隱藏水平滾動條 */
        }

        #tab-combined.active.combined-horizontal .text-input {
            min-height: 200px;
        }

        /* 工作區分頁的垂直佈局樣式 */
        #tab-combined.active.combined-vertical .combined-content {
            display: flex !important;
            flex-direction: column !important;
            gap: 16px;
            height: calc(100% - 60px); /* 減去描述區塊的高度 */
        }

        #tab-combined.active.combined-vertical .combined-section:first-child {
            flex: 1 !important;
            min-height: 200px;
            max-height: 400px;
            overflow: hidden; /* 確保容器不超出範圍 */
        }

        #tab-combined.active.combined-vertical .combined-section:last-child {
            flex: 2 !important;
            min-height: 300px;
        }

        #tab-combined.active.combined-vertical .combined-summary {
            height: 300px;
            max-height: 400px;
            overflow: hidden; /* 確保摘要容器不超出範圍 */
        }

        #tab-combined.active.combined-vertical #combinedSummaryContent {
            height: 100%;
            min-height: 200px;
            overflow-y: auto; /* 添加垂直滾動條 */
            overflow-x: hidden; /* 隱藏水平滾動條 */
        }

        #tab-combined.active.combined-vertical .text-input {
            min-height: 200px;
        }

        /* 預設的合併內容布局 */
        .combined-content {
            display: flex;
            flex-direction: column;
            gap: 16px;
            flex: 1;
        }

        /* 工作區基礎樣式 */
        .combined-section {
            background: var(--bg-tertiary);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 16px;
            margin-bottom: 16px;
        }

        .combined-section-title {
            font-size: 16px;
            font-weight: 600;
            color: var(--text-primary);
            margin: 0 0 12px 0;
            padding-bottom: 8px;
            border-bottom: 1px solid var(--border-color);
        }

        .combined-summary {
            background: var(--bg-secondary);
            border: 1px solid var(--border-color);
            border-radius: 6px;
            padding: 0;
            overflow: hidden;
        }

        #combinedSummaryContent {
            padding: 12px !important;
            line-height: 1.6 !important;
            font-family: inherit !important;
            color: var(--text-primary) !important;
            background: transparent !important;
            border: none !important;
            resize: none !important;
            white-space: pre-wrap !important;
            word-wrap: break-word !important;
            overflow-wrap: break-word !important;
        }

        #summaryContent {
            padding: 12px !important;
            line-height: 1.6 !important;
            font-family: inherit !important;
            color: var(--text-primary) !important;
            white-space: pre-wrap !important;
            word-wrap: break-word !important;
            overflow-wrap: break-word !important;
        }

        /* 圖片設定樣式 */
        .image-settings-details {
            border: 1px solid var(--border-color);
            border-radius: 6px;
            background: var(--bg-tertiary);
            margin-bottom: 8px;
        }

        .image-settings-summary {
            padding: 8px 12px;
            cursor: pointer;
            font-weight: 500;
            color: var(--text-secondary);
            font-size: 13px;
            user-select: none;
            transition: color 0.3s ease;
        }

        .image-settings-summary:hover {
            color: var(--text-primary);
        }

        .image-settings-content {
            padding: 12px;
            border-top: 1px solid var(--border-color);
            background: var(--bg-secondary);
        }

        .image-setting-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 12px;
            gap: 12px;
        }

        .image-setting-row:last-of-type {
            margin-bottom: 8px;
        }

        .image-setting-label {
            color: var(--text-primary);
            font-size: 13px;
            font-weight: 500;
        }

        .image-setting-select {
            background: var(--bg-primary);
            color: var(--text-primary);
            border: 1px solid var(--border-color);
            border-radius: 4px;
            padding: 4px 8px;
            font-size: 12px;
            min-width: 80px;
        }

        .image-setting-checkbox-container {
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            font-size: 13px;
        }

        .image-setting-checkbox {
            width: 16px;
            height: 16px;
            accent-color: var(--accent-color);
        }

        .image-setting-help {
            color: var(--warning-color);
            font-size: 11px;
            margin-left: auto;
        }

        .image-setting-help-text {
            color: var(--text-secondary);
            font-size: 11px;
            line-height: 1.4;
            margin-top: 4px;
            padding: 8px;
            background: var(--bg-primary);
            border-radius: 4px;
            border: 1px solid var(--border-color);
        }

        /* 相容性提示樣式 */
        .compatibility-hint {
            background: rgba(33, 150, 243, 0.1);
            border: 1px solid var(--info-color);
            border-radius: 6px;
            padding: 8px 12px;
            margin-bottom: 8px;
            display: flex;
            align-items: center;
            gap: 12px;
            font-size: 13px;
            color: var(--info-color);
        }

        .compatibility-hint-btn {
            background: var(--info-color);
            color: white;
            border: none;
            border-radius: 4px;
            padding: 4px 8px;
            font-size: 11px;
            cursor: pointer;
            transition: background 0.3s ease;
        }

        .compatibility-hint-btn:hover {
            background: #1976d2;
        }

        /* 回饋狀態指示器樣式 */
        .feedback-status-indicator {
            padding: 12px 16px;
            margin: 16px 0;
            border-radius: 8px;
            border: 1px solid;
            background: var(--bg-secondary);
            transition: all 0.3s ease;
        }

        .feedback-status-indicator .status-text {
            width: 100%;
        }

        .feedback-status-indicator .status-text strong,
        .feedback-status-indicator .status-title {
            display: block;
            font-size: 16px;
            margin-bottom: 4px;
        }

        .feedback-status-indicator .status-text span,
        .feedback-status-indicator .status-message {
            font-size: 14px;
            opacity: 0.8;
        }

        .feedback-status-indicator.status-waiting {
            border-color: var(--accent-color);
            background: rgba(74, 144, 226, 0.1);
        }

        .feedback-status-indicator.status-processing {
            border-color: #ffa500;
            background: rgba(255, 165, 0, 0.1);
            animation: pulse 2s infinite;
        }

        .feedback-status-indicator.status-submitted {
            border-color: var(--success-color);
            background: rgba(40, 167, 69, 0.1);
        }

        @keyframes pulse {
            0% { opacity: 1; }
            50% { opacity: 0.7; }
            100% { opacity: 1; }
        }

        /* 禁用狀態的樣式 */
        .image-upload-area.disabled {
            opacity: 0.5;
            pointer-events: none;
            cursor: not-allowed;
        }

        .text-input:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }
    </style>
</head>
<body class="layout-{{ layout_mode }}">
    <div class="container">
        <!-- ===== 頁面頭部區域 ===== -->
        <header class="header">
            <div class="header-content">
                <div class="header-left">
                    <h1 class="title" data-i18n="app.title">MCP Feedback Enhanced</h1>
                    <!-- 倒數計時器顯示 -->
                    <div id="countdownDisplay" class="countdown-display" style="display: none;">
                        <span class="countdown-label" data-i18n="timeout.remaining">剩餘時間</span>
                        <span id="countdownTimer" class="countdown-timer">--:--</span>
                    </div>
                </div>
                <div class="project-info">
                    <span data-i18n="app.projectDirectory">專案目錄</span>: {{ project_directory }}
                </div>
            </div>
        </header>

        <!-- ===== 主內容區域 ===== -->
        <main class="main-content">
            <!-- 分頁導航 -->
            <div class="tabs">
                <div class="tab-buttons">
                    <!-- 工作區分頁 - 移到最左邊第一個 -->
                    <button class="tab-button hidden" data-tab="combined" data-i18n="tabs.combined">
                        📝 工作區
                    </button>
                    <button class="tab-button active" data-tab="feedback" data-i18n="tabs.feedback">
                        💬 回饋
                    </button>
                    <button class="tab-button" data-tab="summary" data-i18n="tabs.summary">
                        📋 AI 摘要
                    </button>
                    <button class="tab-button" data-tab="command" data-i18n="tabs.command">
                        ⚡ 命令
                    </button>
                    <button class="tab-button" data-tab="settings" data-i18n="tabs.settings">
                        ⚙️ 設定
                    </button>
                    <button class="tab-button" data-tab="about" data-i18n="tabs.about">
                        ℹ️ 關於
                    </button>
                </div>
            </div>



            <!-- ===== 回饋分頁 ===== -->
            <div id="tab-feedback" class="tab-content active">
                <div class="section-description" data-i18n="feedback.description">
                    請提供您對 AI 工作成果的回饋意見。您可以輸入文字回饋並上傳相關圖片。
                </div>

                <!-- 等待回饋狀態指示器 -->
                {% set id = "feedbackStatusIndicator" %}
                {% set status = "waiting" %}
                {% set icon = "⏳" %}
                {% set title = "等待回饋" %}
                {% set message = "請提供您的回饋意見" %}
                {% include 'components/status-indicator.html' %}

                <div class="input-group">
                    <label class="input-label" data-i18n="feedback.textLabel">文字回饋</label>
                    <textarea 
                        id="feedbackText" 
                        class="text-input" 
                        data-i18n-placeholder="feedback.detailedPlaceholder"
                        placeholder="請在這裡輸入您的回饋...

💡 小提示：
• 按 Ctrl+Enter/Cmd+Enter (支援數字鍵盤) 可快速提交
• 按 Ctrl+V/Cmd+V 可直接貼上剪貼板圖片"
                    ></textarea>
                </div>

                <!-- 圖片上傳組件 -->
                {% set id_prefix = "feedback" %}
                {% include 'components/image-upload.html' %}
            </div>

            <!-- ===== AI 摘要分頁 ===== -->
            <div id="tab-summary" class="tab-content">
                <div class="section-description" data-i18n="summary.description">
                    以下是 AI 助手完成的工作摘要，請仔細查看並提供您的回饋意見。
                </div>
                
                <div class="input-group">
                    <div id="summaryContent" class="text-input" style="min-height: 300px; white-space: pre-wrap !important; cursor: text; padding: 12px; line-height: 1.6; word-wrap: break-word; overflow-wrap: break-word;" data-dynamic-content="aiSummary">
                        {{ summary }}
                    </div>
                </div>
            </div>

            <!-- 命令分頁 -->
            <div id="tab-command" class="tab-content">
                <div class="section-description" data-i18n="command.description">
                    在此執行命令來驗證結果或收集更多資訊。命令將在專案目錄中執行。
                </div>
                
                <!-- 命令輸出區域 - 放在上面 -->
                <div class="input-group">
                    <label class="input-label" data-i18n="command.outputLabel">命令輸出</label>
                    <div id="commandOutput" class="command-output"></div>
                </div>

                <!-- 命令輸入區域 - 放在下面 -->
                <div class="input-group" style="margin-bottom: 0;">
                    <label class="input-label" data-i18n="command.inputLabel">命令輸入</label>
                    <div style="display: flex; gap: 10px; align-items: flex-start;">
                        <div style="flex: 1; display: flex; align-items: center; gap: 8px;">
                            <span style="color: var(--accent-color); font-family: 'Consolas', 'Monaco', 'Courier New', monospace; font-weight: bold;">$</span>
                            <input 
                                type="text"
                                id="commandInput" 
                                class="command-input-line" 
                                data-i18n-placeholder="command.placeholder"
                                placeholder="輸入要執行的命令..."
                                style="flex: 1; background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: 4px; padding: 8px 12px; color: var(--text-primary); font-family: 'Consolas', 'Monaco', 'Courier New', monospace; font-size: 14px;"
                            />
                        </div>
                        <button id="runCommandBtn" class="btn btn-primary" data-i18n="command.runButton" style="white-space: nowrap;">
                            ▶️ 執行
                        </button>
                    </div>
                </div>
            </div>

            <!-- 工作區分頁 - 移動到此位置 -->
            <div id="tab-combined" class="tab-content">
                <div class="section-description" style="margin-bottom: 12px; padding: 8px 12px; font-size: 13px;" data-i18n="combined.description">
                    AI 摘要和回饋輸入在同一頁面中，方便對照查看。
                </div>
                
                <div class="combined-content">
                    <!-- AI 摘要區域 -->
                    <div class="combined-section">
                        <div class="section-header-with-controls">
                            <h3 class="combined-section-title" data-i18n="combined.summaryTitle">📋 AI 工作摘要</h3>
                            <div class="auto-refresh-controls">
                                <label class="auto-refresh-toggle">
                                    <input type="checkbox" id="autoRefreshEnabled" />
                                    <span class="toggle-label" data-i18n="autoRefresh.enable"></span>
                                </label>
                                <div class="auto-refresh-interval">
                                    <input type="number" id="autoRefreshInterval" min="5" max="300" value="5" />
                                    <span class="interval-unit" data-i18n="autoRefresh.seconds"></span>
                                </div>
                                <div class="auto-refresh-status" id="autoRefreshStatus">
                                    <span class="status-indicator" id="refreshStatusIndicator">⏸️</span>
                                    <span class="status-text" id="refreshStatusText" data-i18n="autoRefresh.disabled"></span>
                                </div>
                            </div>
                        </div>
                        <div class="combined-summary">
                            <div id="combinedSummaryContent" class="text-input" style="min-height: 200px; white-space: pre-wrap !important; cursor: text; padding: 12px; line-height: 1.6; word-wrap: break-word; overflow-wrap: break-word;" data-dynamic-content="aiSummary">{{ summary }}</div>
                        </div>
                    </div>

                    <!-- 回饋輸入區域 -->
                    <div class="combined-section">
                        <h3 class="combined-section-title" data-i18n="combined.feedbackTitle">💬 提供回饋</h3>

                        <!-- 等待回饋狀態指示器 -->
                        {% set id = "combinedFeedbackStatusIndicator" %}
                        {% set status = "waiting" %}
                        {% set icon = "⏳" %}
                        {% set title = "等待回饋" %}
                        {% set message = "請提供您的回饋意見" %}
                        {% include 'components/status-indicator.html' %}

                        <div class="input-group">
                            <label class="input-label" data-i18n="feedback.textLabel">文字回饋</label>
                            <textarea
                                id="combinedFeedbackText"
                                class="text-input"
                                data-i18n-placeholder="feedback.detailedPlaceholder"
                                placeholder="請在這裡輸入您的回饋...

💡 小提示：
• 按 Ctrl+Enter/Cmd+Enter (支援數字鍵盤) 可快速提交
• 按 Ctrl+V/Cmd+V 可直接貼上剪貼板圖片"
                                style="min-height: 150px;"
                            ></textarea>
                        </div>

                        <!-- 圖片上傳組件 -->
                        {% set id_prefix = "combined" %}
                        {% set min_height = "100px" %}
                        {% include 'components/image-upload.html' %}
                    </div>
                </div>
            </div>

            <!-- 設定分頁 -->
            <div id="tab-settings" class="tab-content">
                <div class="section-description" data-i18n="settings.description">
                    調整介面設定和偏好選項。
                </div>

                <!-- 介面設定卡片 -->
                <div class="settings-card">
                    <div class="settings-card-header">
                        <h3 class="settings-card-title" data-i18n="settings.interface">🎨 介面設定</h3>
                    </div>
                    <div class="settings-card-body">
                        <div class="setting-item">
                            <div class="setting-info">
                                <div class="setting-label" data-i18n="settings.layoutMode">界面佈局模式</div>
                                <div class="setting-description" data-i18n="settings.layoutModeDesc">
                                    選擇 AI 摘要和回饋輸入的顯示方式
                                </div>
                            </div>
                            <div class="layout-mode-selector">
                                <div class="layout-option">
                                    <input type="radio" id="combinedVertical" name="layoutMode" value="combined-vertical" checked>
                                    <label for="combinedVertical">
                                        <div class="layout-option-title" data-i18n="settings.combinedVertical">垂直布局</div>
                                        <div class="layout-option-desc" data-i18n="settings.combinedVerticalDesc">AI 摘要在上，回饋輸入在下，摘要和回饋在同一頁面</div>
                                    </label>
                                </div>
                                <div class="layout-option">
                                    <input type="radio" id="combinedHorizontal" name="layoutMode" value="combined-horizontal">
                                    <label for="combinedHorizontal">
                                        <div class="layout-option-title" data-i18n="settings.combinedHorizontal">水平布局</div>
                                        <div class="layout-option-desc" data-i18n="settings.combinedHorizontalDesc">AI 摘要在左，回饋輸入在右，增大摘要可視區域</div>
                                    </label>
                                </div>
                            </div>
                        </div>

                    </div>
                </div>



                <!-- 語言設定卡片 -->
                <div class="settings-card">
                    <div class="settings-card-header">
                        <h3 class="settings-card-title" data-i18n="settings.language">🌐 語言設定</h3>
                    </div>
                    <div class="settings-card-body">
                        <div class="setting-item">
                            <div class="setting-info">
                                <div class="setting-label" data-i18n="settings.currentLanguage">當前語言</div>
                                <div class="setting-description" data-i18n="settings.languageDesc">
                                    選擇界面顯示語言
                                </div>
                            </div>
                            <div class="language-selector-modern">
                                <div class="language-options">
                                    <div class="language-option" data-lang="zh-TW">
                                        <div class="language-flag">🌏</div>
                                        <div class="language-name">繁體中文</div>
                                    </div>
                                    <div class="language-option" data-lang="zh-CN">
                                        <div class="language-flag">🌍</div>
                                        <div class="language-name">简体中文</div>
                                    </div>
                                    <div class="language-option" data-lang="en">
                                        <div class="language-flag">🌎</div>
                                        <div class="language-name">English</div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- 重置設定卡片 -->
                <div class="settings-card">
                    <div class="settings-card-header">
                        <h3 class="settings-card-title" data-i18n="settings.advanced">🔧 進階設定</h3>
                    </div>
                    <div class="settings-card-body">
                        <div class="setting-item" style="border-bottom: none;">
                            <div class="setting-info">
                                <div class="setting-label" data-i18n="settings.reset">重置設定</div>
                                <div class="setting-description" data-i18n="settings.resetDesc">
                                    清除所有已保存的設定，恢復到預設狀態
                                </div>
                            </div>
                            <button id="resetSettingsBtn" class="btn btn-secondary" style="font-size: 12px; padding: 6px 16px;">
                                <span data-i18n="settings.reset">重置設定</span>
                            </button>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 關於分頁 -->
            <div id="tab-about" class="tab-content">
                <div class="section-description" data-i18n="about.description">
                    關於 MCP Feedback Enhanced - 應用程式資訊、專案連結和致謝。
                </div>

                <!-- 主要資訊卡片 -->
                <div class="settings-card">
                    <div class="settings-card-header">
                        <div style="display: flex; justify-content: space-between; align-items: center; width: 100%;">
                            <h3 class="settings-card-title" style="margin: 0;">MCP Feedback Enhanced</h3>
                            <span style="color: var(--accent-color); font-weight: bold; font-size: 16px;">v{{ version }}</span>
                        </div>
                    </div>
                    <div class="settings-card-body">
                        <!-- 應用程式描述 -->
                        <div class="setting-item" style="border-bottom: none; padding-bottom: 16px;">
                            <div class="setting-info">
                                <div class="setting-description" data-i18n="about.description" style="color: var(--text-secondary); font-size: 13px; line-height: 1.5;">
                                    一個強大的 MCP 伺服器，為 AI 輔助開發工具提供人在回路的互動回饋功能。支援 Qt GUI 和 Web UI 雙介面，並具備圖片上傳、命令執行、多語言等豐富功能。
                                </div>
                            </div>
                        </div>

                        <!-- 分隔線 -->
                        <div style="height: 1px; background: var(--border-color); margin: 16px 0;"></div>

                        <!-- GitHub 專案 -->
                        <div class="setting-item" style="border-bottom: none; padding-bottom: 12px;">
                            <div class="setting-info">
                                <div class="setting-label">📂 <span data-i18n="about.githubProject">GitHub 專案</span></div>
                                <div class="setting-description" style="color: var(--text-secondary); font-size: 11px; margin-left: 24px;">
                                    https://github.com/Minidoracat/mcp-feedback-enhanced
                                </div>
                            </div>
                            <button class="btn btn-primary" onclick="window.open('https://github.com/Minidoracat/mcp-feedback-enhanced', '_blank')" style="font-size: 12px; padding: 6px 16px;">
                                <span data-i18n="about.visitGithub">訪問 GitHub</span>
                            </button>
                        </div>

                        <!-- 分隔線 -->
                        <div style="height: 1px; background: var(--border-color); margin: 16px 0;"></div>

                        <!-- Discord 支援 -->
                        <div class="setting-item" style="border-bottom: none; padding-bottom: 12px;">
                            <div class="setting-info">
                                <div class="setting-label">💬 <span data-i18n="about.discordSupport">Discord 支援</span></div>
                                <div class="setting-description" style="color: var(--text-secondary); font-size: 11px; margin-left: 24px;">
                                    https://discord.gg/ACjf9Q58
                                </div>
                                <div class="setting-description" data-i18n="about.contactDescription" style="color: var(--text-secondary); font-size: 12px; margin-left: 24px; margin-top: 8px;">
                                    如需技術支援、問題回報或功能建議，歡迎透過 Discord 社群或 GitHub Issues 與我們聯繫。
                                </div>
                            </div>
                            <button class="btn" onclick="window.open('https://discord.gg/ACjf9Q58', '_blank')" style="background: #5865F2; color: white; font-size: 12px; padding: 6px 16px; border: none;">
                                <span data-i18n="about.joinDiscord">加入 Discord</span>
                            </button>
                        </div>
                    </div>
                </div>

                <!-- 致謝與貢獻卡片 -->
                <div class="settings-card">
                    <div class="settings-card-header">
                        <h3 class="settings-card-title" data-i18n="about.thanks">🙏 致謝與貢獻</h3>
                    </div>
                    <div class="settings-card-body">
                        <div class="setting-item" style="border-bottom: none;">
                            <div class="setting-info">
                                <div class="text-input" data-i18n="about.thanksText" style="background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: 4px; padding: 12px; color: var(--text-primary); font-size: 12px; line-height: 1.5; min-height: 140px; max-height: 200px; overflow-y: auto; white-space: pre-wrap;">感謝原作者 Fábio Ferreira (@fabiomlferreira) 創建了原始的 interactive-feedback-mcp 專案。

本增強版本由 Minidoracat 開發和維護，大幅擴展了專案功能，新增了 GUI 介面、圖片支援、多語言能力以及許多其他改進功能。

同時感謝 sanshao85 的 mcp-feedback-collector 專案提供的 UI 設計靈感。

開源協作讓技術變得更美好！</div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </main>

        <!-- 底部操作按鈕 -->
        <footer class="footer-actions">
            <button id="cancelBtn" class="btn btn-secondary" data-i18n="buttons.cancel">
                ❌ 取消
            </button>
            <button id="submitBtn" class="btn btn-success" data-i18n="buttons.submit">
                ✅ 提交回饋
            </button>
        </footer>
    </div>

    <!-- WebSocket 和 JavaScript -->
    <script src="/static/js/i18n.js?v=2025010510"></script>
    <script src="/static/js/app.js?v=2025010510"></script>
    <script>
        // 等待 I18nManager 初始化完成後再初始化 FeedbackApp
        async function initializeApp() {
            const sessionId = '{{ session_id }}';

            // 確保 I18nManager 已經初始化
            if (window.i18nManager) {
                await window.i18nManager.init();
            }

            // 初始化 FeedbackApp
            window.feedbackApp = new FeedbackApp(sessionId);
        }

        // 頁面載入完成後初始化
        if (document.readyState === 'loading') {
            document.addEventListener('DOMContentLoaded', initializeApp);
        } else {
            initializeApp();
        }
    </script>
</body>
</html> 