Forráskód Böngészése

feat: internationalize UI components and add multilingual support across admin and user views

jerry 1 hónapja
szülő
commit
8e54730cbd

+ 4 - 3
src/app/create-order/[id]/page.tsx

@@ -12,13 +12,14 @@ const PRODUCT_MAP: Record<string, string> = {
 };
 
 export default function CreateOrderPage({ params }: { params: { id: string } }) {
-  const { t } = useLanguage();
+  const { t, lang } = useLanguage();
   const [productName, setProductName] = useState(t('common.loading'));
 
   useEffect(() => {
-    const name = PRODUCT_MAP[params.id] || `VAS Product #${params.id}`;
+    const zhName = PRODUCT_MAP[params.id];
+    const name = zhName ? (lang === 'zh' ? zhName : `Service #${params.id}`) : `Product #${params.id}`;
     setProductName(name);
-  }, [params.id, t]); 
+  }, [params.id, t, lang]); 
 
   return (
     <div className="min-h-screen bg-neutral-100 py-6 px-4 md:py-10 md:px-6">

+ 1 - 1
src/components/BindEmailModal.tsx

@@ -211,7 +211,7 @@ export default function BindEmailModal({ isOpen, onClose, onSuccess }: BindEmail
                   onClick={() => setStep(1)} 
                   className="px-3 py-2.5 bg-neutral-100 border-2 border-black text-black font-mono font-bold text-xs shadow-[2px_2px_0px_#000] hover:bg-neutral-200 transition active:translate-x-0.5 active:translate-y-0.5 active:shadow-none flex items-center gap-1"
                 >
-                  <ArrowLeft size={14} /> [ 重改邮箱 ]
+                  <ArrowLeft size={14} /> [ {t('bind_email.change_email_btn') || '修改邮箱'} ]
                 </button>
                 <button 
                   type="submit" 

+ 1 - 1
src/components/Navbar.tsx

@@ -139,7 +139,7 @@ export default function Navbar() {
                   title={t('nav.logout') || '退出登录'}
                 >
                   <LogOut size={13} />
-                  <span>[ 登出 ]</span>
+                  <span>[ {t('nav.logout') || '退出'} ]</span>
                 </button>
               </div>
             ) : (

+ 36 - 7
src/components/PaymentProcessor.tsx

@@ -11,7 +11,8 @@ import {
   CheckCircle2, 
   AlertCircle,
   TrendingUp,
-  TrendingDown
+  TrendingDown,
+  Receipt
 } from 'lucide-react';
 import { useLanguage } from '@/lib/i18n/LanguageContext';
 import LocalTime from '@/components/common/LocalTime';
@@ -234,7 +235,7 @@ export default function PaymentProcessor({ orderId }: PaymentProcessorProps) {
           {/* 支付通道列表 */}
           <div className="space-y-3">
             <div className="text-xs font-black uppercase tracking-wider text-black">
-              [ 请选择受理支付通道 / SELECT GATEWAY ]:
+              [ {t('payment.select_method') || '请选择受理支付通道'} / SELECT GATEWAY ]:
             </div>
 
             {availableProviders.length === 0 ? (
@@ -262,11 +263,24 @@ export default function PaymentProcessor({ orderId }: PaymentProcessorProps) {
                       </div>
                     )}
                     <span className="font-black text-black text-sm sm:text-base">{p.title || p.name}</span>
-                    {p.currency && (
-                      <span className="text-[10px] bg-neutral-100 px-2 py-0.5 border border-black text-neutral-600 font-bold">
-                        CURRENCY: {p.currency}
-                      </span>
-                    )}
+                    <div className="flex flex-wrap items-center justify-center gap-1.5 mt-0.5">
+                      {p.currency && (
+                        <span className="text-[10px] bg-neutral-100 px-2 py-0.5 border border-black text-neutral-600 font-bold">
+                          {p.currency}
+                        </span>
+                      )}
+                      {p.config?.fee_rate !== undefined && (
+                        Number(p.config.fee_rate) > 0 ? (
+                          <span className="text-[10px] bg-amber-100 px-2 py-0.5 border border-black text-amber-900 font-bold">
+                            {p.config.fee_label || `+${(Number(p.config.fee_rate) * 100).toFixed(1)}% ${t('payment.gateway_fee_badge') || '手续费'}`}
+                          </span>
+                        ) : (
+                          <span className="text-[10px] bg-emerald-100 px-2 py-0.5 border border-black text-emerald-800 font-bold">
+                            {t('payment.fee_free') || '免手续费'}
+                          </span>
+                        )
+                      )}
+                    </div>
                   </button>
                 ))}
               </div>
@@ -332,6 +346,21 @@ export default function PaymentProcessor({ orderId }: PaymentProcessorProps) {
                 </div>
               )}
 
+              {paymentData.fee_amount !== undefined && paymentData.fee_amount > 0 && (
+                <div className="flex justify-between items-center bg-amber-50 border border-black p-2 text-amber-950 font-bold">
+                  <span className="flex items-center gap-1">
+                    <Receipt size={14} className="text-amber-800" />
+                    <span>
+                      {t('payment.gateway_fee') || '通道结算手续费'}
+                      {paymentData.fee_rate ? ` (${(Number(paymentData.fee_rate) * 100).toFixed(1)}%)` : ''}
+                    </span>
+                  </span>
+                  <span className="font-bold font-mono">
+                    +{formatMoney(paymentData.fee_amount, paymentData.currency)}
+                  </span>
+                </div>
+              )}
+
               {paymentData.random_offset !== 0 && (
                 <div className="flex justify-between items-center bg-rose-50 border border-black text-rose-900 p-2 font-bold">
                   <span className="flex items-center gap-1">

+ 3 - 3
src/components/ServiceList.tsx

@@ -284,7 +284,7 @@ export default function ServiceList() {
                                     }
                                   }}
                                   className="inline-flex items-center gap-1.5 px-3 py-1 bg-amber-50 hover:bg-amber-100 text-black border-2 border-black font-mono text-xs font-bold shadow-[2px_2px_0px_#000] hover:translate-x-0.5 hover:translate-y-0.5 active:shadow-none transition-all cursor-pointer"
-                                  title="在新标签页中打开官方外部使用指南"
+                                  title={t('services.open_guide_tooltip') || '在新标签页中打开官方外部使用指南'}
                                 >
                                   <ExternalLink size={12} />
                                   <span>[ {tutorial?.button_text || tutorial?.link_text || pillText || (lang === 'zh' ? '查阅使用指引 ↗' : 'View Guide ↗')} ]</span>
@@ -303,7 +303,7 @@ export default function ServiceList() {
                                       ? 'bg-amber-300 text-black'
                                       : 'bg-amber-50 hover:bg-amber-100 text-black'
                                   }`}
-                                  title={isTutorialExpanded ? '收起内嵌使用指引' : '展开内嵌使用指引'}
+                                  title={isTutorialExpanded ? (t('tutorial.collapse_tooltip') || '收起内嵌使用指引') : (t('tutorial.expand_tooltip') || '展开内嵌使用指引')}
                                 >
                                   {isTutorialExpanded ? <ChevronUp size={12} /> : <ChevronDown size={12} />}
                                   <span>
@@ -344,7 +344,7 @@ export default function ServiceList() {
                                       target="_blank"
                                       rel="noopener noreferrer"
                                       className="inline-flex items-center gap-1.5 px-3 py-1 bg-white hover:bg-neutral-100 text-black border-2 border-black font-mono text-xs font-bold shadow-[2px_2px_0px_#000] hover:translate-x-0.5 hover:translate-y-0.5 active:shadow-none transition-all cursor-pointer"
-                                      title="在新标签页中打开官方文档"
+                                      title={t('services.open_docs_tooltip') || '在新标签页中打开官方文档'}
                                     >
                                       <ExternalLink size={12} />
                                       <span>[ {tutorial?.link_text || (lang === 'zh' ? '官方文档 ↗' : 'Docs ↗')} ]</span>

+ 23 - 0
src/components/admin/payments/ProviderList.tsx

@@ -138,6 +138,23 @@ export default function ProviderList({
     </span>
   );
 
+  const renderFeeBadge = (p: Provider) => {
+    const cfg = p.config;
+    if (!cfg || cfg.fee_rate === undefined) return null;
+    const rate = Number(cfg.fee_rate);
+    const fixed = Number(cfg.fee_fixed || 0);
+    const isFree = rate === 0 && fixed === 0;
+    return isFree ? (
+      <span className="inline-flex items-center gap-1 px-2 py-0.5 border border-black bg-emerald-100 text-[10px] font-bold text-emerald-900">
+        免手续费
+      </span>
+    ) : (
+      <span className="inline-flex items-center gap-1 px-2 py-0.5 border border-black bg-amber-100 text-[10px] font-bold text-amber-950">
+        手续费: {cfg.fee_label || `${(rate * 100).toFixed(1)}%`}
+      </span>
+    );
+  };
+
   return (
     <div className="space-y-4 font-mono">
       {/* 顶部工具栏 */}
@@ -269,6 +286,7 @@ export default function ProviderList({
                   <div className="pt-2 border-t border-dashed border-neutral-300 flex items-center gap-1.5 flex-wrap">
                     {renderChannelBadge(p.channel)}
                     {renderCurrencyBadge(p.currency)}
+                    {renderFeeBadge(p)}
                   </div>
                 </div>
 
@@ -322,6 +340,7 @@ export default function ProviderList({
                   <th className="px-4 py-3">[ 服务商 / 标识 ]</th>
                   <th className="px-4 py-3">[ 通道类型 ]</th>
                   <th className="px-4 py-3">[ 结算货币 ]</th>
+                  <th className="px-4 py-3">[ 交易手续费 ]</th>
                   <th className="px-4 py-3">[ 状态 ]</th>
                   <th className="px-4 py-3 text-right">[ 操作 ]</th>
                 </tr>
@@ -351,6 +370,10 @@ export default function ProviderList({
                         {renderCurrencyBadge(p.currency)}
                       </td>
 
+                      <td className="px-4 py-3 whitespace-nowrap">
+                        {renderFeeBadge(p)}
+                      </td>
+
                       <td className="px-4 py-3 whitespace-nowrap">
                         <button
                           onClick={() => handleToggle(p)}

+ 137 - 6
src/components/admin/payments/ProviderModal.tsx

@@ -8,7 +8,8 @@ import {
   CreditCard, 
   QrCode, 
   Globe, 
-  Layers
+  Layers,
+  Receipt
 } from 'lucide-react';
 import { Provider } from '@/types';
 import { toast } from 'react-hot-toast';
@@ -31,6 +32,9 @@ const PAYMENT_PRESETS = [
     channel: 'qr_static',
     currency: 'CNY',
     icon: DEFAULT_PAYMENT_ICONS.wechat,
+    feeRatePercent: '0',
+    feeFixed: '0',
+    feeLabel: '免手续费'
   },
   {
     name: 'alipay',
@@ -38,6 +42,9 @@ const PAYMENT_PRESETS = [
     channel: 'qr_static',
     currency: 'CNY',
     icon: DEFAULT_PAYMENT_ICONS.alipay,
+    feeRatePercent: '0',
+    feeFixed: '0',
+    feeLabel: '免手续费'
   },
   {
     name: 'creem',
@@ -45,6 +52,9 @@ const PAYMENT_PRESETS = [
     channel: 'online_link',
     currency: 'USD',
     icon: DEFAULT_PAYMENT_ICONS.creem,
+    feeRatePercent: '3.5',
+    feeFixed: '0',
+    feeLabel: '3.5%'
   },
   {
     name: 'stripe',
@@ -52,6 +62,9 @@ const PAYMENT_PRESETS = [
     channel: 'online_link',
     currency: 'USD',
     icon: DEFAULT_PAYMENT_ICONS.stripe,
+    feeRatePercent: '3.5',
+    feeFixed: '0.30',
+    feeLabel: '3.5% + $0.30'
   },
   {
     name: 'paypal',
@@ -59,6 +72,9 @@ const PAYMENT_PRESETS = [
     channel: 'online_link',
     currency: 'USD',
     icon: DEFAULT_PAYMENT_ICONS.paypal,
+    feeRatePercent: '4.4',
+    feeFixed: '0.30',
+    feeLabel: '4.4% + $0.30'
   },
   {
     name: 'usdt_trc20',
@@ -66,6 +82,9 @@ const PAYMENT_PRESETS = [
     channel: 'qr_static',
     currency: 'USD',
     icon: DEFAULT_PAYMENT_ICONS.usdt_trc20,
+    feeRatePercent: '0',
+    feeFixed: '0',
+    feeLabel: '免手续费'
   },
   {
     name: 'bank_transfer',
@@ -73,6 +92,9 @@ const PAYMENT_PRESETS = [
     channel: 'qr_static',
     currency: 'CNY',
     icon: DEFAULT_PAYMENT_ICONS.bank_transfer,
+    feeRatePercent: '0',
+    feeFixed: '0',
+    feeLabel: '免手续费'
   }
 ];
 
@@ -84,7 +106,10 @@ export default function ProviderModal({ isOpen, onClose, provider, onSubmit }: P
     icon: '',
     currency: 'CNY',
     channel: 'qr_static',
-    enabled: 1
+    enabled: 1,
+    feeRatePercent: '0',
+    feeFixed: '0',
+    feeLabel: ''
   });
 
   const isEditing = Boolean(provider?.id);
@@ -92,13 +117,19 @@ export default function ProviderModal({ isOpen, onClose, provider, onSubmit }: P
   useEffect(() => {
     if (isOpen) {
       if (provider) {
+        const cfg = provider.config || {};
+        const ratePct = cfg.fee_rate !== undefined ? String(Number(cfg.fee_rate) * 100) : '0';
+        const fixedUnit = cfg.fee_fixed !== undefined ? String(Number(cfg.fee_fixed) / 100) : '0';
         setForm({
           name: provider.name || '',
           title: provider.title || '',
           icon: getPaymentProviderIcon(provider.name, provider.icon),
           currency: provider.currency || 'CNY',
           channel: provider.channel || 'qr_static',
-          enabled: Number(provider.enabled ?? 1)
+          enabled: Number(provider.enabled ?? 1),
+          feeRatePercent: ratePct,
+          feeFixed: fixedUnit,
+          feeLabel: cfg.fee_label || ''
         });
       } else {
         setForm({
@@ -107,7 +138,10 @@ export default function ProviderModal({ isOpen, onClose, provider, onSubmit }: P
           icon: '',
           currency: 'CNY',
           channel: 'qr_static',
-          enabled: 1
+          enabled: 1,
+          feeRatePercent: '0',
+          feeFixed: '0',
+          feeLabel: ''
         });
       }
     }
@@ -120,7 +154,10 @@ export default function ProviderModal({ isOpen, onClose, provider, onSubmit }: P
       title: preset.title,
       icon: preset.icon,
       channel: preset.channel,
-      currency: preset.currency
+      currency: preset.currency,
+      feeRatePercent: preset.feeRatePercent,
+      feeFixed: preset.feeFixed,
+      feeLabel: preset.feeLabel
     }));
   };
 
@@ -143,9 +180,35 @@ export default function ProviderModal({ isOpen, onClose, provider, onSubmit }: P
 
     const finalIcon = form.icon || getPaymentProviderIcon(form.name);
 
+    const rateDecimal = (parseFloat(form.feeRatePercent) || 0) / 100;
+    const fixedCents = Math.round((parseFloat(form.feeFixed) || 0) * 100);
+
+    let autoLabel = form.feeLabel.trim();
+    if (!autoLabel) {
+      if (rateDecimal > 0 && fixedCents > 0) {
+        autoLabel = `${(rateDecimal * 100).toFixed(1)}% + ${(fixedCents / 100).toFixed(2)} ${form.currency}`;
+      } else if (rateDecimal > 0) {
+        autoLabel = `${(rateDecimal * 100).toFixed(1)}%`;
+      } else {
+        autoLabel = '免手续费';
+      }
+    }
+
+    const nextConfig = {
+      ...(provider?.config || {}),
+      fee_rate: rateDecimal,
+      fee_fixed: fixedCents,
+      fee_label: autoLabel,
+    };
+
     setLoading(true);
     try {
-      await onSubmit({ ...form, icon: finalIcon, id: provider?.id });
+      await onSubmit({
+        ...form,
+        config: nextConfig,
+        icon: finalIcon,
+        id: provider?.id
+      });
       onClose();
     } catch {
       // ignore
@@ -269,6 +332,74 @@ export default function ProviderModal({ isOpen, onClose, provider, onSubmit }: P
             />
           </div>
 
+          {/* 手续费配置卡片 */}
+          <div className="bg-amber-50/60 p-3.5 border-2 border-black shadow-[2px_2px_0px_#000] space-y-3">
+            <div className="flex items-center justify-between border-b border-black/20 pb-1.5">
+              <span className="text-xs font-black text-black uppercase flex items-center gap-1.5">
+                <Receipt size={14} className="text-amber-800" />
+                <span>[ 06 // 交易手续费配置 (转嫁用户承担) ]</span>
+              </span>
+              <span className="text-[10px] text-neutral-500 font-mono">
+                BASE CURRENCY: {form.currency}
+              </span>
+            </div>
+
+            <div className="grid grid-cols-1 sm:grid-cols-2 gap-3 text-xs">
+              <div className="space-y-1">
+                <label className="font-bold text-black uppercase flex items-center justify-between">
+                  <span>比例费率 (Percent %)</span>
+                  <span className="text-[10px] text-neutral-500">如: 3.5</span>
+                </label>
+                <div className="relative flex items-center">
+                  <input
+                    type="number"
+                    step="0.01"
+                    min="0"
+                    placeholder="0"
+                    value={form.feeRatePercent}
+                    onChange={(e) => setForm({ ...form, feeRatePercent: e.target.value })}
+                    className="w-full border-2 border-black bg-white p-2 text-xs font-mono font-bold focus:bg-amber-50 outline-none text-black pr-8 shadow-[2px_2px_0px_#000]"
+                  />
+                  <span className="absolute right-2.5 text-xs font-black text-neutral-500">%</span>
+                </div>
+              </div>
+
+              <div className="space-y-1">
+                <label className="font-bold text-black uppercase flex items-center justify-between">
+                  <span>每笔固定费 ({form.currency})</span>
+                  <span className="text-[10px] text-neutral-500">如: 0.30</span>
+                </label>
+                <input
+                  type="number"
+                  step="0.01"
+                  min="0"
+                  placeholder="0.00"
+                  value={form.feeFixed}
+                  onChange={(e) => setForm({ ...form, feeFixed: e.target.value })}
+                  className="w-full border-2 border-black bg-white p-2 text-xs font-mono font-bold focus:bg-amber-50 outline-none text-black shadow-[2px_2px_0px_#000]"
+                />
+              </div>
+            </div>
+
+            <div className="space-y-1 text-xs">
+              <label className="font-bold text-black uppercase flex items-center justify-between">
+                <span>自定义前端标签 (可选)</span>
+                <span className="text-[10px] text-neutral-500">留空自动根据费率生成</span>
+              </label>
+              <input
+                type="text"
+                placeholder={
+                  parseFloat(form.feeRatePercent) > 0 || parseFloat(form.feeFixed) > 0
+                    ? `例如: ${form.feeRatePercent}%${parseFloat(form.feeFixed) > 0 ? ` + ${form.feeFixed} ${form.currency}` : ''}`
+                    : '例如: 免手续费'
+                }
+                value={form.feeLabel}
+                onChange={(e) => setForm({ ...form, feeLabel: e.target.value })}
+                className="w-full border-2 border-black bg-white p-2 text-xs font-sans focus:bg-amber-50 outline-none text-black shadow-[2px_2px_0px_#000]"
+              />
+            </div>
+          </div>
+
 
           <div className="pt-2 flex justify-end gap-3 border-t-2 border-dashed border-neutral-300">
             <button

+ 431 - 58
src/components/admin/products/ProductModal.tsx

@@ -23,6 +23,10 @@ import {
   Trash2,
   HelpCircle,
   Compass,
+  Sliders,
+  RotateCcw,
+  ChevronDown,
+  ChevronUp,
 } from 'lucide-react';
 import { SchemaItem, ProductTutorialConfig, TutorialStep, ProductCardConfig, PluginItem } from '@/types';
 
@@ -230,6 +234,172 @@ const TUTORIAL_TEMPLATES = [
   },
 ];
 
+export const DEFAULT_TUTORIAL_SYSTEM_PROMPT = `You are an expert e-commerce operations specialist for international visa, embassy, and appointment booking services.
+Your primary mission is to generate a MANDATORY PRE-ORDER PREREQUISITE CHECKLIST (下单前置必备条件与门槛说明) for customers before they can purchase this service.
+
+CORE EMPHASIS:
+The single most important purpose of this guide is establishing the HARD PRE-CONDITIONS required BEFORE placing an order. Customers must satisfy these prerequisites first; otherwise, their automated booking order cannot proceed and will fail.
+
+CORE WRITING STYLE:
+1. PREREQUISITE-FIRST & ULTRA-CONCISE: Focus exclusively on what the buyer MUST have ready before paying. Avoid generic website tutorials or fluffy disclaimers. Every word must count.
+2. ALL ENGLISH: Regardless of input language, generate crisp, authoritative, professional English.
+
+JSON SCHEMA:
+{
+  "display_type": "both", // Allowed: "both", "modal", "link", "embedded"
+  "button_text": "⚠️ Mandatory Pre-Order Checklist", // Short warning/checklist label (3-5 words with emoji)
+  "modal_title": "Mandatory Prerequisites Before Placing Order", // Clear pre-order gate title (5-8 words)
+  "link_url": "https://...", // Official portal URL if mentioned, else ""
+  "link_text": "Official Portal ↗", // Short label (2-3 words)
+  "badge_text": "Mandatory Prerequisite", // Badge indicating required pre-order gate (1-3 words)
+  "summary": "...", // STRICTLY 1-2 punchy sentences warning the buyer what MUST be ready before ordering (under 30 words).
+  "steps": [
+    {
+      "step_no": 1,
+      "title": "Action Title", // 2-4 words (e.g. "Activated Portal Account", "Valid Passport Scan", "Cancel Prior Bookings")
+      "desc": "One crisp sentence explaining the exact prerequisite required before order (strictly under 20 words)."
+    }
+  ],
+  "content": "..." // Max 2 critical FAQs addressing pre-order blockers (e.g. can I order first without account? overlapping bookings?). Format: **Q: ...?**\\nA: One crisp sentence.
+}
+
+CRITICAL RULES:
+1. FOCUS ON PRE-CONDITIONS: Every single step MUST be a prerequisite task completed BEFORE ordering.
+2. MAX 3 STEPS: Each step's description MUST be strictly 1 single, compact sentence (< 20 words).
+3. SUMMARY: Strictly 1 to 2 sentences max (< 35 words total).
+4. FAQ: Strictly 2 questions maximum, with direct 1-sentence answers.
+5. Output STRICT JSON only without Markdown wrappers or greetings.`;
+
+/**
+ * 结构化解析并规范化 AI 返回的教程数据,进行全字段多别名兼容与类型兜底,确保精准映射到各个输入框
+ */
+export function normalizeTutorialResponse(raw: any): ProductTutorialConfig {
+  const data =
+    raw?.data?.tutorial_config ||
+    raw?.tutorial_config ||
+    raw?.data?.tutorial ||
+    raw?.tutorial ||
+    raw?.data ||
+    raw;
+
+  // display_type: 'both' | 'modal' | 'link' | 'embedded'
+  let displayType: 'modal' | 'link' | 'both' | 'embedded' = 'both';
+  const rawType = String(data?.display_type || '').toLowerCase();
+  if (rawType.includes('modal') && !rawType.includes('link') && !rawType.includes('both')) {
+    displayType = 'modal';
+  } else if (rawType.includes('link') && !rawType.includes('modal') && !rawType.includes('both')) {
+    displayType = 'link';
+  } else if (rawType.includes('embed')) {
+    displayType = 'embedded';
+  } else {
+    displayType = 'both';
+  }
+
+  // button_text (触发按钮文案)
+  const buttonText =
+    data?.button_text ||
+    data?.button_label ||
+    data?.btn_text ||
+    data?.btn_title ||
+    '📖 Guide: Prepare Your Account';
+
+  // modal_title (教程弹窗/卡片大标题)
+  const modalTitle =
+    data?.modal_title ||
+    data?.title ||
+    data?.guide_title ||
+    data?.header ||
+    data?.name ||
+    'Official Portal Registration & Booking Guide';
+
+  // link_url (外部教程/官网 URL)
+  const linkUrl =
+    data?.link_url ||
+    data?.url ||
+    data?.link ||
+    data?.href ||
+    data?.portal_url ||
+    '';
+
+  // link_text (超链接文字)
+  const linkText =
+    data?.link_text ||
+    data?.url_text ||
+    data?.link_label ||
+    data?.btn_link_text ||
+    'Open Official Portal ↗';
+
+  // badge_text (角标标签)
+  const badgeText =
+    data?.badge_text ||
+    data?.badge ||
+    data?.tag ||
+    'Prerequisite Guide';
+
+  // summary (核心摘要 / 账号准备提示)
+  const summary =
+    data?.summary ||
+    data?.overview ||
+    data?.description ||
+    data?.notice ||
+    data?.prerequisites ||
+    '';
+
+  // steps (分步指导清单)
+  let rawSteps = data?.steps;
+  if (!Array.isArray(rawSteps) && typeof rawSteps === 'string') {
+    rawSteps = rawSteps.split('\n').map((s) => s.trim()).filter(Boolean);
+  }
+  const steps: TutorialStep[] = [];
+  if (Array.isArray(rawSteps)) {
+    rawSteps.forEach((s: any, idx: number) => {
+      if (typeof s === 'string' && s.trim()) {
+        steps.push({
+          step_no: idx + 1,
+          title: `Step ${idx + 1}`,
+          desc: s.trim(),
+        });
+      } else if (s && typeof s === 'object') {
+        steps.push({
+          step_no: Number(s.step_no || s.step || s.order || idx + 1),
+          title: s.title || s.step_title || s.name || `Step ${idx + 1}`,
+          desc: s.desc || s.description || s.content || s.detail || s.instruction || s.text || '',
+        });
+      }
+    });
+  }
+
+  // content (常见问答 FAQ / Markdown 长文本)
+  let content = data?.content || data?.faq_content || data?.details || '';
+  if (!content && data?.faq) {
+    if (typeof data.faq === 'string') {
+      content = data.faq;
+    } else if (Array.isArray(data.faq)) {
+      content = data.faq
+        .map((item: any, i: number) => {
+          if (typeof item === 'string') return item;
+          const q = item.question || item.q || item.title || `Question ${i + 1}`;
+          const a = item.answer || item.a || item.desc || item.content || '';
+          return `**Q${i + 1}. ${q}**\n${a}`;
+        })
+        .join('\n\n');
+    }
+  }
+
+  return {
+    enabled: true,
+    display_type: displayType,
+    button_text: buttonText,
+    modal_title: modalTitle,
+    link_url: linkUrl,
+    link_text: linkText,
+    badge_text: badgeText,
+    summary,
+    steps,
+    content,
+  };
+}
+
 export default function ProductModal({
   isOpen,
   onClose,
@@ -292,6 +462,12 @@ export default function ProductModal({
     steps: [],
   });
 
+  // AI 智能解析教程自然语言状态
+  const [aiPrompt, setAiPrompt] = useState<string>('');
+  const [aiLoading, setAiLoading] = useState<boolean>(false);
+  const [customSystemPrompt, setCustomSystemPrompt] = useState<string>(DEFAULT_TUTORIAL_SYSTEM_PROMPT);
+  const [showPromptTuning, setShowPromptTuning] = useState<boolean>(false);
+
   // 前台卡片包装与海报定制状态
   const [cardConfig, setCardConfig] = useState<ProductCardConfig>({
     banner_url: '',
@@ -398,7 +574,7 @@ export default function ProductModal({
 
         setIsCustomVisaType(
           Boolean(product.visa_type) &&
-            !VISA_OPTIONS.some((o) => o.value.toLowerCase() === (product.visa_type || '').toLowerCase())
+          !VISA_OPTIONS.some((o) => o.value.toLowerCase() === (product.visa_type || '').toLowerCase())
         );
 
         if (product.extra_fields?.tutorial) {
@@ -602,6 +778,28 @@ export default function ProductModal({
     toast.success(`已应用模版: ${tpl.name}`);
   };
 
+  const handleAiParseTutorial = async () => {
+    if (!aiPrompt.trim()) {
+      toast.error('请先输入自然语言教程要求描述');
+      return;
+    }
+    setAiLoading(true);
+    try {
+      const res = await productService.parseTutorialWithLlm(
+        aiPrompt.trim(),
+        undefined,
+        customSystemPrompt.trim() || undefined
+      );
+      const normalized = normalizeTutorialResponse(res);
+      setTutorialConfig(normalized);
+      toast.success('✨ AI 教程解析完成,已精准填充至下方各个字段!');
+    } catch (e: any) {
+      toast.error('AI 解析失败: ' + (e.response?.data?.message || e.message || '网络或接口超时'));
+    } finally {
+      setAiLoading(false);
+    }
+  };
+
   const handleSubmit = async (e: React.FormEvent) => {
     e.preventDefault();
     if (!form.title.trim()) return toast.error('请输入商品标题');
@@ -667,7 +865,7 @@ export default function ProductModal({
   return (
     <div className="fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-grayscale p-0 sm:p-4 font-mono">
       <div className="bg-neutral-50 w-full h-full sm:h-auto sm:max-h-[90vh] sm:max-w-4xl border-2 border-black shadow-[8px_8px_0px_#000] flex flex-col overflow-hidden animate-in zoom-in-95 duration-200">
-        
+
         {/* Header */}
         <div className="px-5 py-3.5 border-b-2 border-black flex justify-between items-center bg-neutral-200 text-black select-none shrink-0">
           <div className="flex items-center gap-2">
@@ -687,7 +885,7 @@ export default function ProductModal({
         {/* Modal Scrollable Body */}
         <div className="flex-1 overflow-y-auto p-5 space-y-4 bg-white text-xs">
           <form id="product-modal-form" onSubmit={handleSubmit} className="space-y-4">
-            
+
             {/* 1. 基本信息卡片 */}
             <div className="bg-neutral-50 border-2 border-black p-4 shadow-[2px_2px_0px_#000] space-y-3">
               <span className="text-[10px] font-black uppercase text-black block border-b-2 border-black pb-1">
@@ -738,11 +936,10 @@ export default function ProductModal({
                       key={ctry}
                       type="button"
                       onClick={() => setForm((prev) => ({ ...prev, country: ctry }))}
-                      className={`px-2 py-0.5 border border-black text-[10px] font-bold uppercase transition ${
-                        form.country === ctry
+                      className={`px-2 py-0.5 border border-black text-[10px] font-bold uppercase transition ${form.country === ctry
                           ? 'bg-amber-300 text-black shadow-[1px_1px_0px_#000]'
                           : 'bg-white text-black hover:bg-neutral-100'
-                      }`}
+                        }`}
                     >
                       {ctry}
                     </button>
@@ -1023,11 +1220,10 @@ export default function ProductModal({
                         key={pvd}
                         type="button"
                         onClick={() => setForm((prev) => ({ ...prev, provider: pvd }))}
-                        className={`px-2 py-0.5 border border-black text-[10px] font-mono font-bold ${
-                          form.provider === pvd
+                        className={`px-2 py-0.5 border border-black text-[10px] font-mono font-bold ${form.provider === pvd
                             ? 'bg-black text-white'
                             : 'bg-white text-black hover:bg-neutral-100'
-                        }`}
+                          }`}
                       >
                         {pvd}
                       </button>
@@ -1079,9 +1275,8 @@ export default function ProductModal({
                           return (
                             <span
                               key={k}
-                              className={`inline-flex items-center gap-0.5 px-1.5 py-0.5 border border-black text-[10px] ${
-                                isReq ? 'bg-amber-300 text-black font-black' : 'bg-white text-black'
-                              }`}
+                              className={`inline-flex items-center gap-0.5 px-1.5 py-0.5 border border-black text-[10px] ${isReq ? 'bg-amber-300 text-black font-black' : 'bg-white text-black'
+                                }`}
                             >
                               {v.title || k}
                               {isReq && <span>*</span>}
@@ -1231,6 +1426,167 @@ export default function ProductModal({
                 </label>
               </div>
 
+              {/* 🤖 AI 智能解析与教程自动生成面板 */}
+              <div className="bg-gradient-to-r from-amber-100 via-orange-50 to-amber-50 border-2 border-black p-3.5 shadow-[2px_2px_0px_#000] space-y-2.5">
+                <div className="flex flex-wrap items-center justify-between gap-2">
+                  <div className="flex items-center gap-1.5 font-black text-xs uppercase text-black">
+                    <Sparkles size={14} className="text-amber-600 animate-pulse" />
+                    <span>[ 🤖 AI 智能解析与文案一键生成 // DEEPSEEK COPILOT ]</span>
+                  </div>
+                  <span className="text-[10px] bg-black text-amber-300 px-1.5 py-0.5 font-mono font-bold uppercase shadow-[1px_1px_0px_#000]">
+                    NATURAL LANGUAGE TO ENGLISH GUIDE
+                  </span>
+                </div>
+
+                <p className="text-[11px] text-neutral-600 font-sans leading-relaxed">
+                  输入自然语言要求,AI 将以<strong>下单必须满足的硬性前置条件(Prerequisites)</strong>为核心,提炼极简精炼的英文门槛清单、前置条件步骤(每步限1句精炼短句)及阻碍下单的常见疑问,避免客户未备齐条件盲目下单导致任务失败。
+                </p>
+
+                <div className="space-y-1.5">
+                  <textarea
+                    rows={3}
+                    placeholder="在此粘贴或输入你的自然语言教程要求,例如:这是意大利旅游签证预约,用户必须提前在VFS官网注册账号并激活,准备好护照原件;抢到名额后我们会发邮件通知在使馆官网付款。展示形式用弹窗+外链..."
+                    value={aiPrompt}
+                    onChange={(e) => setAiPrompt(e.target.value)}
+                    className="w-full border-2 border-black bg-white p-2.5 text-xs font-sans text-black outline-none shadow-[2px_2px_0px_#000] focus:bg-amber-50/50"
+                  />
+                </div>
+
+                {/* 快捷示例标签 */}
+                <div className="flex flex-wrap items-center gap-1.5 text-[10px] font-mono">
+                  <span className="font-bold text-neutral-500">[ 快捷填入示例 ]:</span>
+                  <button
+                    type="button"
+                    onClick={() => setAiPrompt('法国申根签证预约。申请人必须提前在 France-Visas 官方网站注册个人账号并查收邮件激活,准备好有效期6个月以上的护照首页扫描件。由于名额极度稀缺,我们系统锁定位子后需在5分钟内配合输入手机短信验证码完成使馆付款。需弹窗并附带 France-Visas 官网超链接,生成详细的3个准备步骤和常见问题解答。')}
+                    className="px-2 py-0.5 bg-white hover:bg-neutral-100 border border-black text-black font-bold shadow-[1px_1px_0px_#000] active:translate-x-0.5 active:translate-y-0.5"
+                  >
+                    🇫🇷 法国签证代刷
+                  </button>
+                  <button
+                    type="button"
+                    onClick={() => setAiPrompt('意大利签证VFS中心预约。用户需要自备已在VFS Global激活的登录账号,若有旧预约需先取消。步骤:1. 前往VFS官网注册并激活;2. 核对护照号与姓名拼写无误;3. 授权我们巡检刷位,出签前保持电话畅通。生成弹窗+外部文档链接,并附带账号被锁怎么办等FAQ。')}
+                    className="px-2 py-0.5 bg-white hover:bg-neutral-100 border border-black text-black font-bold shadow-[1px_1px_0px_#000] active:translate-x-0.5 active:translate-y-0.5"
+                  >
+                    🇮🇹 意大利VFS预约
+                  </button>
+                  <button
+                    type="button"
+                    onClick={() => setAiPrompt('美国签证CGI/AVITS面签预约加急。客户需先自行填写完成DS-160表格并缴纳使馆签证费,获取收据编号(MRV Fee Receipt)。我们提供全天候代抢更早面签档期。内嵌卡片形式展示,步骤包括填DS-160、缴费绑定收据、等待档期更新通知。')}
+                    className="px-2 py-0.5 bg-white hover:bg-neutral-100 border border-black text-black font-bold shadow-[1px_1px_0px_#000] active:translate-x-0.5 active:translate-y-0.5"
+                  >
+                    🇺🇸 美签面签加急
+                  </button>
+                </div>
+
+                {/* ⚙️ Prompt 微调折叠面板 (支持查看默认提示词、自由微调、一键重置) */}
+                <div className="border border-amber-300 bg-white/80 p-2.5 shadow-[1px_1px_0px_#000] space-y-2">
+                  <div
+                    onClick={() => setShowPromptTuning(!showPromptTuning)}
+                    className="flex items-center justify-between cursor-pointer select-none"
+                  >
+                    <div className="flex items-center gap-2">
+                      <Sliders size={13} className="text-black" />
+                      <span className="text-xs font-black text-black uppercase">
+                        [ ⚙️ 微调 AI 提示词与输出规范 (Prompt Tuning) ]
+                      </span>
+                      {customSystemPrompt !== DEFAULT_TUTORIAL_SYSTEM_PROMPT && (
+                        <span className="text-[10px] bg-amber-300 text-black px-1.5 py-0.2 border border-black font-mono font-bold">
+                          已自定义微调
+                        </span>
+                      )}
+                    </div>
+                    <div className="flex items-center gap-2">
+                      {customSystemPrompt !== DEFAULT_TUTORIAL_SYSTEM_PROMPT && (
+                        <button
+                          type="button"
+                          onClick={(e) => {
+                            e.stopPropagation();
+                            setCustomSystemPrompt(DEFAULT_TUTORIAL_SYSTEM_PROMPT);
+                            toast.success('已恢复为默认官方提示词');
+                          }}
+                          className="text-[11px] font-bold text-amber-800 hover:text-black underline flex items-center gap-1"
+                        >
+                          <RotateCcw size={11} />
+                          <span>恢复默认</span>
+                        </button>
+                      )}
+                      <span className="text-xs font-bold text-neutral-600 flex items-center gap-0.5">
+                        {showPromptTuning ? (
+                          <>
+                            <span>收起</span>
+                            <ChevronUp size={12} />
+                          </>
+                        ) : (
+                          <>
+                            <span>展开微调</span>
+                            <ChevronDown size={12} />
+                          </>
+                        )}
+                      </span>
+                    </div>
+                  </div>
+
+                  {showPromptTuning && (
+                    <div className="pt-2 border-t border-amber-200 space-y-2">
+                      <p className="text-[11px] text-neutral-600 font-sans leading-relaxed">
+                        系统预置了高精度规范提示词(强制要求英文输出、结构化 JSON、专业步骤与真实 FAQ)。您可在此直接编辑微调提示词规则、约束字段结构或增删业务偏好,AI 解析时将优先以此提示词为准:
+                      </p>
+                      <textarea
+                        rows={7}
+                        value={customSystemPrompt}
+                        onChange={(e) => setCustomSystemPrompt(e.target.value)}
+                        className="w-full border-2 border-black bg-amber-50/40 p-2 font-mono text-[11px] text-neutral-900 leading-relaxed outline-none focus:bg-white"
+                        placeholder="输入自定义 System Prompt..."
+                      />
+                      <div className="flex items-center justify-between text-[10px] font-mono text-neutral-600">
+                        <span>字符数: {customSystemPrompt.length} 字</span>
+                        <button
+                          type="button"
+                          onClick={() => {
+                            setCustomSystemPrompt(DEFAULT_TUTORIAL_SYSTEM_PROMPT);
+                            toast.success('已重置为系统默认 Prompt');
+                          }}
+                          className="px-2 py-0.5 bg-white hover:bg-neutral-100 border border-black text-black font-bold shadow-[1px_1px_0px_#000] active:translate-x-0.5 active:translate-y-0.5 flex items-center gap-1"
+                        >
+                          <RotateCcw size={10} />
+                          <span>重置为默认 Prompt</span>
+                        </button>
+                      </div>
+                    </div>
+                  )}
+                </div>
+
+                <div className="flex items-center justify-end gap-2 pt-1">
+                  {aiPrompt && (
+                    <button
+                      type="button"
+                      onClick={() => setAiPrompt('')}
+                      className="px-2.5 py-1.5 bg-white hover:bg-neutral-100 text-black border border-black text-xs font-bold shadow-[1px_1px_0px_#000] active:translate-x-0.5 active:translate-y-0.5 uppercase"
+                    >
+                      清空输入
+                    </button>
+                  )}
+                  <button
+                    type="button"
+                    onClick={handleAiParseTutorial}
+                    disabled={aiLoading || !aiPrompt.trim()}
+                    className="px-4 py-1.5 bg-amber-400 hover:bg-amber-300 text-black border-2 border-black text-xs font-black shadow-[2px_2px_0px_#000] active:translate-x-0.5 active:translate-y-0.5 transition uppercase disabled:opacity-50 flex items-center gap-1.5"
+                  >
+                    {aiLoading ? (
+                      <>
+                        <Loader2 size={13} className="animate-spin text-black" />
+                        <span>AI 深度理解与结构化生成中...</span>
+                      </>
+                    ) : (
+                      <>
+                        <Sparkles size={13} className="text-black" />
+                        <span>[ ⚡ 开始 AI 智能解析并自动填入 ]</span>
+                      </>
+                    )}
+                  </button>
+                </div>
+              </div>
+
               {tutorialConfig.enabled ? (
                 <div className="space-y-4">
                   {/* 快捷模板一键套用 */}
@@ -1290,11 +1646,10 @@ export default function ProductModal({
                                 display_type: item.type as any,
                               }))
                             }
-                            className={`p-2.5 border-2 border-black cursor-pointer text-left transition select-none ${
-                              isSelected
+                            className={`p-2.5 border-2 border-black cursor-pointer text-left transition select-none ${isSelected
                                 ? 'bg-amber-300 shadow-[2px_2px_0px_#000]'
                                 : 'bg-white hover:bg-neutral-100 shadow-[1px_1px_0px_#000]'
-                            }`}
+                              }`}
                           >
                             <div className="text-xs font-black text-black">{item.label}</div>
                             <div className="text-[10px] text-neutral-600 font-sans mt-0.5">
@@ -1307,14 +1662,14 @@ export default function ProductModal({
                   </div>
 
                   {/* 基础文案配置 */}
-                  <div className="grid grid-cols-1 sm:grid-cols-2 gap-3">
+                  <div className="grid grid-cols-1 sm:grid-cols-3 gap-3">
                     <div className="space-y-1">
                       <label className="font-bold text-black uppercase block">
                         触发按钮文案 (前台按钮文字)
                       </label>
                       <input
                         type="text"
-                        placeholder="如: 📖 查看 VFS 账号准备教程"
+                        placeholder="如: 📖 Guide: Prepare Your Account"
                         className="w-full border-2 border-black bg-white px-3 py-1.5 text-xs text-black outline-none shadow-[2px_2px_0px_#000]"
                         value={tutorialConfig.button_text}
                         onChange={(e) =>
@@ -1328,7 +1683,7 @@ export default function ProductModal({
                       </label>
                       <input
                         type="text"
-                        placeholder="如: VFS 官方预约账号注册与授权使用指南"
+                        placeholder="如: Official Portal Registration & Booking Guide"
                         className="w-full border-2 border-black bg-white px-3 py-1.5 text-xs text-black outline-none shadow-[2px_2px_0px_#000]"
                         value={tutorialConfig.modal_title}
                         onChange={(e) =>
@@ -1336,44 +1691,58 @@ export default function ProductModal({
                         }
                       />
                     </div>
+                    <div className="space-y-1">
+                      <label className="font-bold text-black uppercase block">
+                        角标徽标文案 (Badge Tag)
+                      </label>
+                      <input
+                        type="text"
+                        placeholder="如: Prerequisite Guide / 申请人必读"
+                        className="w-full border-2 border-black bg-white px-3 py-1.5 text-xs text-black outline-none shadow-[2px_2px_0px_#000]"
+                        value={tutorialConfig.badge_text || ''}
+                        onChange={(e) =>
+                          setTutorialConfig((prev) => ({ ...prev, badge_text: e.target.value }))
+                        }
+                      />
+                    </div>
                   </div>
 
                   {/* 超链接配置 (当选中 link / both / embedded 时) */}
                   {(tutorialConfig.display_type === 'link' ||
                     tutorialConfig.display_type === 'both' ||
                     tutorialConfig.display_type === 'embedded') && (
-                    <div className="grid grid-cols-1 sm:grid-cols-3 gap-3 p-3 bg-white border border-black shadow-[1px_1px_0px_#000]">
-                      <div className="sm:col-span-2 space-y-1">
-                        <label className="font-bold text-black uppercase block flex items-center gap-1">
-                          <ExternalLink size={12} />
-                          <span>外部图文教程 / 文档超链接 URL</span>
-                        </label>
-                        <input
-                          type="url"
-                          placeholder="如: https://your-wiki-feishu.com/guide/vfs-account"
-                          className="w-full border-2 border-black bg-white px-3 py-1.5 text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
-                          value={tutorialConfig.link_url}
-                          onChange={(e) =>
-                            setTutorialConfig((prev) => ({ ...prev, link_url: e.target.value }))
-                          }
-                        />
-                      </div>
-                      <div className="space-y-1">
-                        <label className="font-bold text-black uppercase block">
-                          超链接按钮文字
-                        </label>
-                        <input
-                          type="text"
-                          placeholder="如: 打开官方图文文档 ↗"
-                          className="w-full border-2 border-black bg-white px-3 py-1.5 text-xs text-black outline-none shadow-[2px_2px_0px_#000]"
-                          value={tutorialConfig.link_text}
-                          onChange={(e) =>
-                            setTutorialConfig((prev) => ({ ...prev, link_text: e.target.value }))
-                          }
-                        />
+                      <div className="grid grid-cols-1 sm:grid-cols-3 gap-3 p-3 bg-white border border-black shadow-[1px_1px_0px_#000]">
+                        <div className="sm:col-span-2 space-y-1">
+                          <label className="font-bold text-black uppercase block flex items-center gap-1">
+                            <ExternalLink size={12} />
+                            <span>外部图文教程 / 文档超链接 URL</span>
+                          </label>
+                          <input
+                            type="url"
+                            placeholder="如: https://your-wiki-feishu.com/guide/vfs-account"
+                            className="w-full border-2 border-black bg-white px-3 py-1.5 text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000]"
+                            value={tutorialConfig.link_url}
+                            onChange={(e) =>
+                              setTutorialConfig((prev) => ({ ...prev, link_url: e.target.value }))
+                            }
+                          />
+                        </div>
+                        <div className="space-y-1">
+                          <label className="font-bold text-black uppercase block">
+                            超链接按钮文字
+                          </label>
+                          <input
+                            type="text"
+                            placeholder="如: 打开官方图文文档 ↗"
+                            className="w-full border-2 border-black bg-white px-3 py-1.5 text-xs text-black outline-none shadow-[2px_2px_0px_#000]"
+                            value={tutorialConfig.link_text}
+                            onChange={(e) =>
+                              setTutorialConfig((prev) => ({ ...prev, link_text: e.target.value }))
+                            }
+                          />
+                        </div>
                       </div>
-                    </div>
-                  )}
+                    )}
 
                   {/* 核心摘要与准备说明 */}
                   <div className="space-y-1">
@@ -1455,13 +1824,18 @@ export default function ProductModal({
 
                   {/* 详细长文本 / FAQ 补充 */}
                   <div className="space-y-1">
-                    <label className="font-bold text-black uppercase block">
-                      常见疑问解答 (FAQ) 或详细补充长文本
-                    </label>
+                    <div className="flex items-center justify-between">
+                      <label className="font-bold text-black uppercase block">
+                        常见疑问解答 (FAQ) 或详细补充长文本
+                      </label>
+                      <span className="text-[10px] bg-neutral-100 text-neutral-700 px-1.5 py-0.2 border border-black font-mono font-bold">
+                        ✦ 支持完整 Markdown 格式渲染
+                      </span>
+                    </div>
                     <textarea
-                      rows={3}
-                      placeholder="如: 安全提示、防风控策略、验证码接收说明等详细事项..."
-                      className="w-full border-2 border-black bg-white px-3 py-2 text-xs font-sans text-black outline-none shadow-[2px_2px_0px_#000]"
+                      rows={4}
+                      placeholder="支持标准 Markdown 格式,例如:&#10;**Q: 需要提前注册账号吗?**&#10;A: 必须提前注册并激活..."
+                      className="w-full border-2 border-black bg-white px-3 py-2 text-xs font-mono text-black outline-none shadow-[2px_2px_0px_#000] focus:bg-amber-50/30"
                       value={tutorialConfig.content}
                       onChange={(e) =>
                         setTutorialConfig((prev) => ({ ...prev, content: e.target.value }))
@@ -1597,9 +1971,8 @@ export default function ProductModal({
                           key={c.color}
                           type="button"
                           onClick={() => setCardConfig((prev) => ({ ...prev, poster_accent_color: c.color }))}
-                          className={`px-2.5 py-1 text-[11px] font-bold border border-black flex items-center gap-1.5 shadow-[1px_1px_0px_#000] ${
-                            cardConfig.poster_accent_color === c.color ? 'ring-2 ring-black font-black bg-neutral-100' : 'bg-white'
-                          }`}
+                          className={`px-2.5 py-1 text-[11px] font-bold border border-black flex items-center gap-1.5 shadow-[1px_1px_0px_#000] ${cardConfig.poster_accent_color === c.color ? 'ring-2 ring-black font-black bg-neutral-100' : 'bg-white'
+                            }`}
                         >
                           <span className="w-2.5 h-2.5 rounded-full" style={{ backgroundColor: c.color }} />
                           <span>{c.label}</span>

+ 7 - 2
src/components/admin/settlement/SettlementEngineTab.tsx

@@ -584,7 +584,7 @@ export default function SettlementEngineTab() {
                       <th className="px-3 py-2 font-bold">[ 渠道 ]</th>
                       <th className="px-3 py-2 font-bold">[ 对接人 ]</th>
                       <th className="px-3 py-2 font-bold">[ 技术归属人 ]</th>
-                      <th className="px-3 py-2 font-bold">[ 实收金额 ]</th>
+                      <th className="px-3 py-2 font-bold">[ 实收净额 ]</th>
                       <th className="px-3 py-2 font-bold">[ 单均耗材 ]</th>
                       <th className="px-3 py-2 font-bold">[ 单笔净利 ]</th>
                       <th className="px-3 py-2 font-bold text-blue-700">[ 技术20% ]</th>
@@ -629,7 +629,12 @@ export default function SettlementEngineTab() {
                             )}
                           </td>
                           <td className="px-3 py-2 font-bold font-mono">
-                            {sym}{(d.order_amount / 100).toFixed(2)}
+                            <div>{sym}{(d.order_amount / 100).toFixed(2)}</div>
+                            {Boolean(d.fee_amount && d.fee_amount > 0) && (
+                              <div className="text-[10px] text-amber-800 font-sans font-normal whitespace-nowrap">
+                                (流水 {sym}{(((d.gross_amount ?? (d.order_amount + d.fee_amount))) / 100).toFixed(2)} - 费 {sym}{(d.fee_amount / 100).toFixed(2)})
+                              </div>
+                            )}
                           </td>
                           <td className="px-3 py-2 text-rose-600 font-mono">-{sym}{(d.avg_cost / 100).toFixed(2)}</td>
                           <td className="px-3 py-2 font-black text-black font-mono">{sym}{(d.net_profit / 100).toFixed(2)}</td>

+ 6 - 1
src/components/admin/settlement/SettlementPeriodDetailModal.tsx

@@ -193,7 +193,12 @@ export default function SettlementPeriodDetailModal({ isOpen, onClose, period }:
                           {d.developer_name ? `${d.developer_name} (${d.developer_id})` : (d.developer_id || '-')}
                         </td>
                         <td className="px-3 py-1.5 font-bold font-mono">
-                          {sym}{(d.order_amount / 100).toFixed(2)}
+                          <div>{sym}{(d.order_amount / 100).toFixed(2)}</div>
+                          {Boolean(d.fee_amount && d.fee_amount > 0) && (
+                            <div className="text-[10px] text-amber-800 font-sans font-normal whitespace-nowrap">
+                              (流水 {sym}{(((d.gross_amount ?? (d.order_amount + d.fee_amount))) / 100).toFixed(2)} - 费 {sym}{(d.fee_amount / 100).toFixed(2)})
+                            </div>
+                          )}
                         </td>
                         <td className="px-3 py-1.5 text-rose-600 font-mono">-{sym}{(d.avg_cost / 100).toFixed(2)}</td>
                         <td className="px-3 py-1.5 font-black text-black font-mono">{sym}{(d.net_profit / 100).toFixed(2)}</td>

+ 4 - 2
src/components/common/ConfirmModal.tsx

@@ -1,6 +1,7 @@
 'use client';
 
 import { X } from 'lucide-react';
+import { useLanguage } from '@/lib/i18n/LanguageContext';
 
 interface ConfirmModalProps {
   isOpen: boolean;
@@ -11,6 +12,7 @@ interface ConfirmModalProps {
 }
 
 export default function ConfirmModal({ isOpen, onCancel, onConfirm, message, title }: ConfirmModalProps) {
+  const { t } = useLanguage();
   if (!isOpen) return null;
 
   return (
@@ -44,7 +46,7 @@ export default function ConfirmModal({ isOpen, onCancel, onConfirm, message, tit
             onClick={onCancel}
             className="px-4 py-2 border-2 border-black bg-white text-black font-bold text-xs shadow-[2px_2px_0px_#000] hover:bg-neutral-50 transition active:translate-x-0.5 active:translate-y-0.5 active:shadow-none"
           >
-            [ 取消 ]
+            [ {t('common.cancel') || '取消'} ]
           </button>
           <button 
             onClick={() => {
@@ -53,7 +55,7 @@ export default function ConfirmModal({ isOpen, onCancel, onConfirm, message, tit
             }}
             className="px-6 py-2 bg-amber-300 hover:bg-amber-400 text-black border-2 border-black font-black text-xs shadow-[2px_2px_0px_#000] transition active:translate-x-0.5 active:translate-y-0.5 active:shadow-none"
           >
-            [ 确认提交 → ]
+            [ {t('common.confirm_submit') || '确认提交 →'} ]
           </button>
         </div>
       </div>

+ 87 - 43
src/components/common/ProductTutorialBanner.tsx

@@ -2,6 +2,7 @@
 'use client';
 
 import React, { useState } from 'react';
+import { useLanguage } from '@/lib/i18n/LanguageContext';
 import {
   BookOpen,
   ExternalLink,
@@ -13,8 +14,58 @@ import {
   FileText,
   Compass,
 } from 'lucide-react';
+import ReactMarkdown from 'react-markdown';
+import remarkGfm from 'remark-gfm';
 import { ProductTutorialConfig } from '@/types';
 
+/**
+ * 专为教程与 FAQ 设计的 Markdown 渲染器 (完美融入 Neo-brutalism 黑边框设计风格)
+ */
+function TutorialMarkdown({ content, className = '' }: { content: string; className?: string }) {
+  if (!content) return null;
+  return (
+    <div className={`tutorial-markdown font-sans text-xs leading-relaxed space-y-1.5 ${className}`}>
+      <ReactMarkdown
+        remarkPlugins={[remarkGfm]}
+        components={{
+          p: ({ children }) => <p className="leading-relaxed mb-1.5 last:mb-0 text-neutral-800">{children}</p>,
+          strong: ({ children }) => <strong className="font-black text-black">{children}</strong>,
+          em: ({ children }) => <em className="italic">{children}</em>,
+          ul: ({ children }) => <ul className="list-disc list-outside ml-4 space-y-1 my-1.5 text-neutral-800">{children}</ul>,
+          ol: ({ children }) => <ol className="list-decimal list-outside ml-4 space-y-1 my-1.5 text-neutral-800">{children}</ol>,
+          li: ({ children }) => <li className="leading-relaxed">{children}</li>,
+          h1: ({ children }) => <h1 className="font-black text-sm text-black mt-2 mb-1 uppercase tracking-wide border-b border-neutral-300 pb-0.5">{children}</h1>,
+          h2: ({ children }) => <h2 className="font-black text-xs text-black mt-2 mb-1 uppercase tracking-wide border-b border-neutral-200 pb-0.5">{children}</h2>,
+          h3: ({ children }) => <h3 className="font-bold text-xs text-neutral-900 mt-1.5 mb-0.5">{children}</h3>,
+          blockquote: ({ children }) => (
+            <blockquote className="border-l-2 border-black pl-2.5 py-1 my-1.5 bg-amber-50 text-[11px] font-mono italic text-neutral-800">
+              {children}
+            </blockquote>
+          ),
+          code: ({ children }) => (
+            <code className="px-1 py-0.5 bg-neutral-100 border border-neutral-300 text-[11px] font-mono font-bold text-neutral-900">
+              {children}
+            </code>
+          ),
+          a: ({ href, children }) => (
+            <a
+              href={href}
+              target="_blank"
+              rel="noopener noreferrer"
+              className="text-sky-700 underline font-bold hover:text-black inline-flex items-center gap-0.5"
+            >
+              <span>{children}</span>
+              <ExternalLink size={10} className="inline ml-0.5" />
+            </a>
+          ),
+        }}
+      >
+        {content}
+      </ReactMarkdown>
+    </div>
+  );
+}
+
 interface ProductTutorialBannerProps {
   tutorial?: ProductTutorialConfig | null;
   productTitle?: string;
@@ -32,6 +83,7 @@ export default function ProductTutorialBanner({
   onCloseModal,
   hideBanner = false,
 }: ProductTutorialBannerProps) {
+  const { t, lang } = useLanguage();
   const [isModalOpen, setIsModalOpen] = useState(defaultOpenModal);
   const [isEmbeddedExpanded, setIsEmbeddedExpanded] = useState(true);
 
@@ -47,10 +99,10 @@ export default function ProductTutorialBanner({
   if (!tutorial || !tutorial.enabled) return null;
 
   const displayType = tutorial.display_type || 'modal';
-  const modalTitle = tutorial.modal_title || '商品使用教程与资料准备指引';
-  const badgeText = tutorial.badge_text || '申请人必读指引';
-  const buttonText = tutorial.button_text || '📖 查看使用教程与账号准备说明';
-  const linkText = tutorial.link_text || '打开完整图文文档 ↗';
+  const modalTitle = tutorial.modal_title || t('tutorial.default_modal_title') || '商品使用教程与资料准备指引';
+  const badgeText = tutorial.badge_text || t('tutorial.default_badge') || '申请人必读指引';
+  const buttonText = tutorial.button_text || (lang === 'zh' ? '📖 查看使用教程与账号准备说明' : t('tutorial.default_btn') || '📖 View Guide');
+  const linkText = tutorial.link_text || t('tutorial.default_link') || '打开完整图文文档 ↗';
   const linkUrl = tutorial.link_url?.trim();
   const summary = tutorial.summary?.trim();
   const content = tutorial.content?.trim();
@@ -97,14 +149,14 @@ export default function ProductTutorialBanner({
                     target="_blank"
                     rel="noopener noreferrer"
                     className="px-3 py-1 bg-amber-300 hover:bg-amber-400 text-black border border-black text-xs font-black uppercase shadow-[2px_2px_0px_#000] active:translate-x-0.5 active:translate-y-0.5 transition flex items-center gap-1.5 cursor-pointer"
-                    title="在新窗口打开外部详细图文教程"
+                    title={t('tutorial.open_external') || '在新窗口打开外部详细图文教程'}
                   >
                     <ExternalLink size={12} />
                     <span>{buttonText || linkText}</span>
                   </a>
                 ) : (
                   <span className="px-2 py-0.5 bg-neutral-200 border border-neutral-400 text-neutral-500 text-[10px] font-bold">
-                    [ 外部链接未配置 ]
+                    [ {t('tutorial.no_link_configured') || '外部链接未配置'} ]
                   </span>
                 )
               )}
@@ -127,7 +179,7 @@ export default function ProductTutorialBanner({
                       target="_blank"
                       rel="noopener noreferrer"
                       className="px-3 py-1 bg-white hover:bg-neutral-100 text-black border border-black text-xs font-black uppercase shadow-[2px_2px_0px_#000] active:translate-x-0.5 active:translate-y-0.5 transition flex items-center gap-1.5 cursor-pointer"
-                      title="在新窗口打开外部详细图文教程"
+                      title={t('tutorial.open_external') || '在新窗口打开外部详细图文教程'}
                     >
                       <ExternalLink size={12} />
                       <span>{linkText}</span>
@@ -145,7 +197,7 @@ export default function ProductTutorialBanner({
                       target="_blank"
                       rel="noopener noreferrer"
                       className="px-3 py-1 bg-white hover:bg-neutral-100 text-black border border-black text-xs font-black uppercase shadow-[2px_2px_0px_#000] active:translate-x-0.5 active:translate-y-0.5 transition flex items-center gap-1.5 cursor-pointer"
-                      title="在新窗口打开外部详细图文教程"
+                      title={t('tutorial.open_external') || '在新窗口打开外部详细图文教程'}
                     >
                       <ExternalLink size={12} />
                       <span>{linkText}</span>
@@ -155,9 +207,9 @@ export default function ProductTutorialBanner({
                     type="button"
                     onClick={() => setIsEmbeddedExpanded(!isEmbeddedExpanded)}
                     className="px-2 py-1 bg-amber-300 hover:bg-amber-400 border border-black text-xs font-bold shadow-[1px_1px_0px_#000] flex items-center gap-1 cursor-pointer"
-                    title={isEmbeddedExpanded ? '收起内嵌步骤与内容' : '展开内嵌步骤与内容'}
+                    title={isEmbeddedExpanded ? (t('tutorial.collapse_tooltip') || '收起内嵌步骤与内容') : (t('tutorial.expand_tooltip') || '展开内嵌步骤与内容')}
                   >
-                    <span>{isEmbeddedExpanded ? '收起指引' : '展开指引'}</span>
+                    <span>{isEmbeddedExpanded ? (t('tutorial.collapse_guide') || '收起指引') : (t('tutorial.expand_guide') || '展开指引')}</span>
                     {isEmbeddedExpanded ? <ChevronUp size={14} /> : <ChevronDown size={14} />}
                   </button>
                 </>
@@ -169,7 +221,9 @@ export default function ProductTutorialBanner({
           {summary && (
             <div className="flex items-start gap-2 text-xs text-neutral-800 font-sans leading-relaxed">
               <Info size={14} className="text-sky-700 shrink-0 mt-0.5" />
-              <p className="font-medium">{summary}</p>
+              <div className="font-medium flex-1">
+                <TutorialMarkdown content={summary} />
+              </div>
             </div>
           )}
 
@@ -178,10 +232,10 @@ export default function ProductTutorialBanner({
             <div className="bg-white border-2 border-black p-3 shadow-[2px_2px_0px_#000] flex flex-col sm:flex-row sm:items-center justify-between gap-2.5">
               <div>
                 <span className="font-black text-black uppercase text-xs block font-mono">
-                  [ 官方在线图文知识库与账号指引 ]
+                  [ {t('tutorial.online_kb_title') || '官方在线图文知识库与账号指引'} ]
                 </span>
                 <p className="text-[11px] text-neutral-600 font-sans mt-0.5">
-                  本服务详细教程由官方在外部文档库持续更新维护,支持直接跳转查阅
+                  {t('tutorial.online_kb_desc') || '本服务详细教程由官方在外部文档库持续更新维护,支持直接跳转查阅'}
                 </p>
               </div>
               <a
@@ -203,7 +257,7 @@ export default function ProductTutorialBanner({
               {steps.length > 0 && (
                 <div className="space-y-2">
                   <span className="text-[10px] font-bold text-neutral-500 uppercase block font-mono">
-                    [ 准备与操作步骤 // STEPS ({steps.length}) ]:
+                    [ {t('tutorial.prep_steps_title') || '准备与操作步骤'} // STEPS ({steps.length}) ]:
                   </span>
                   <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2.5">
                     {steps.map((step, idx) => (
@@ -217,9 +271,7 @@ export default function ProductTutorialBanner({
                           </span>
                           <span className="text-xs font-black text-black">{step.title}</span>
                         </div>
-                        <p className="text-[11px] text-neutral-700 font-sans leading-relaxed whitespace-pre-wrap">
-                          {step.desc}
-                        </p>
+                        <TutorialMarkdown content={step.desc} className="text-[11px] text-neutral-700" />
                       </div>
                     ))}
                   </div>
@@ -231,11 +283,9 @@ export default function ProductTutorialBanner({
                 <div className="bg-white border-2 border-black p-3.5 shadow-[2px_2px_0px_#000] space-y-2">
                   <span className="font-black text-black uppercase text-xs block border-b border-neutral-200 pb-1 flex items-center gap-1.5">
                     <FileText size={13} />
-                    <span>[ 详细说明与常见疑问 FAQ ]</span>
+                    <span>[ {t('tutorial.faq_title') || '详细说明与常见疑问 FAQ'} ]</span>
                   </span>
-                  <div className="text-neutral-800 font-sans text-xs leading-relaxed whitespace-pre-wrap">
-                    {content}
-                  </div>
+                  <TutorialMarkdown content={content} />
                 </div>
               )}
 
@@ -244,10 +294,10 @@ export default function ProductTutorialBanner({
                 <div className="bg-sky-100 border-2 border-black p-3 shadow-[2px_2px_0px_#000] flex flex-col sm:flex-row sm:items-center justify-between gap-2.5">
                   <div>
                     <span className="font-black text-black uppercase text-xs block">
-                      官方在线图文知识库 / 外部文档
+                      {t('tutorial.external_doc_label') || '官方在线图文知识库 / 外部文档'}
                     </span>
                     <p className="text-[11px] text-neutral-600 font-sans mt-0.5">
-                      支持在浏览器中查阅带图截屏与更详细的官方说明
+                      {t('tutorial.external_doc_subtext') || '支持在浏览器中查阅带图截屏与更详细的官方说明'}
                     </p>
                   </div>
                   <a
@@ -282,7 +332,7 @@ export default function ProductTutorialBanner({
                   </h3>
                   {productTitle && (
                     <p className="text-[10px] text-neutral-500 font-bold font-sans">
-                      适用商品: {productTitle}
+                      {t('tutorial.applicable_product') || '适用商品'}: {productTitle}
                     </p>
                   )}
                 </div>
@@ -303,13 +353,11 @@ export default function ProductTutorialBanner({
               {summary && (
                 <div className="bg-amber-50 border-2 border-black p-3.5 shadow-[2px_2px_0px_#000] flex items-start gap-2.5">
                   <AlertTriangle size={16} className="text-amber-800 shrink-0 mt-0.5" />
-                  <div>
-                    <span className="font-black text-black uppercase text-[11px] block">
-                      [ 核心填报与账号要求说明 ]
+                  <div className="flex-1">
+                    <span className="font-black text-black uppercase text-[11px] block mb-0.5">
+                      [ {t('tutorial.core_requirements') || '核心填报与账号要求说明'} ]
                     </span>
-                    <p className="text-neutral-800 font-sans text-xs mt-0.5 leading-relaxed font-medium">
-                      {summary}
-                    </p>
+                    <TutorialMarkdown content={summary} />
                   </div>
                 </div>
               )}
@@ -318,7 +366,7 @@ export default function ProductTutorialBanner({
               {steps.length > 0 && (
                 <div className="space-y-3">
                   <span className="font-black text-black uppercase text-xs block border-b-2 border-black pb-1">
-                    [ 操作指南与准备步骤 // STEP-BY-STEP GUIDE ({steps.length}) ]
+                    [ {t('tutorial.instructions_steps') || '操作指南与准备步骤'} // STEP-BY-STEP GUIDE ({steps.length}) ]
                   </span>
                   <div className="space-y-2.5">
                     {steps.map((step, idx) => (
@@ -329,13 +377,11 @@ export default function ProductTutorialBanner({
                         <div className="w-6 h-6 bg-black text-white font-black text-xs flex items-center justify-center shrink-0 mt-0.5">
                           {String(step.step_no || idx + 1).padStart(2, '0')}
                         </div>
-                        <div className="space-y-1">
+                        <div className="space-y-1 flex-1">
                           <h4 className="font-black text-black text-xs font-sans uppercase">
                             {step.title}
                           </h4>
-                          <p className="text-neutral-700 font-sans text-xs leading-relaxed whitespace-pre-wrap">
-                            {step.desc}
-                          </p>
+                          <TutorialMarkdown content={step.desc} className="text-neutral-700" />
                         </div>
                       </div>
                     ))}
@@ -348,11 +394,9 @@ export default function ProductTutorialBanner({
                 <div className="bg-neutral-50 border-2 border-black p-4 shadow-[2px_2px_0px_#000] space-y-2">
                   <span className="font-black text-black uppercase text-xs block border-b border-neutral-300 pb-1 flex items-center gap-1.5">
                     <FileText size={13} />
-                    <span>[ 详细说明与常见疑问 FAQ ]</span>
+                    <span>[ {t('tutorial.faq_title') || '详细说明与常见疑问 FAQ'} ]</span>
                   </span>
-                  <div className="text-neutral-800 font-sans text-xs leading-relaxed whitespace-pre-wrap">
-                    {content}
-                  </div>
+                  <TutorialMarkdown content={content} />
                 </div>
               )}
 
@@ -361,10 +405,10 @@ export default function ProductTutorialBanner({
                 <div className="bg-sky-50 border-2 border-black p-3.5 shadow-[2px_2px_0px_#000] flex flex-col sm:flex-row sm:items-center justify-between gap-3">
                   <div>
                     <span className="font-black text-black uppercase text-xs block">
-                      官方在线图文知识库 / 外部文档
+                      {t('tutorial.external_doc_label') || '官方在线图文知识库 / 外部文档'}
                     </span>
                     <p className="text-[11px] text-neutral-600 font-sans mt-0.5">
-                      支持在电脑或手机浏览器中完整查阅带图截屏与更详细的说明
+                      {t('tutorial.external_doc_subtext') || '支持在电脑或手机浏览器中完整查阅带图截屏与更详细的说明'}
                     </p>
                   </div>
                   <a
@@ -383,14 +427,14 @@ export default function ProductTutorialBanner({
             {/* Modal Footer */}
             <div className="bg-neutral-200 border-t-2 border-black p-3.5 px-5 flex items-center justify-between">
               <span className="text-[10px] text-neutral-600 font-bold">
-                * 建议仔细核对账号密码,以确保自动化工单能顺畅通过官网风控验证
+                {t('tutorial.security_note') || '* 建议仔细核对账号密码,以确保自动化工单能顺畅通过官网风控验证'}
               </span>
               <button
                 type="button"
                 onClick={handleCloseModal}
                 className="px-4 py-1.5 bg-black hover:bg-neutral-800 text-white font-black text-xs uppercase shadow-[2px_2px_0px_#000] active:translate-x-0.5 active:translate-y-0.5 transition cursor-pointer"
               >
-                [ 我已阅读并了解 ]
+                [ {t('tutorial.understood_btn') || '我已阅读并了解'} ]
               </button>
             </div>
           </div>

+ 1 - 1
src/components/dashboard/ChangePasswordModal.tsx

@@ -205,7 +205,7 @@ export default function ChangePasswordModal({ isOpen, onClose }: ChangePasswordM
               onChange={(e) => setConfirmPassword(e.target.value)}
             />
             {confirmPassword && newPassword !== confirmPassword && (
-              <p className="text-[10px] text-rose-600 font-bold mt-1">[ ! 两次输入的密码不一致 ]</p>
+              <p className="text-[10px] text-rose-600 font-bold mt-1">[ ! {t('settings.password_mismatch') || '两次输入的密码不一致'} ]</p>
             )}
           </div>
 

+ 2 - 2
src/components/dashboard/OrderList.tsx

@@ -81,14 +81,14 @@ export default function OrderList({ onRequestTicket, onViewDetail, openTicketsMa
     if (s === 'pending' || s === 'created') {
       return (
         <span className="px-2.5 py-0.5 bg-neutral-100 text-black border-2 border-black font-mono font-bold text-[10px] uppercase">
-          ⏳ {t(`order.status_${s}`) || '待支付'}
+          ⏳ {t(`order.status_${s}`) || status}
         </span>
       );
     }
     if (s === 'completed') {
       return (
         <span className="px-2.5 py-0.5 bg-emerald-200 text-black border-2 border-black font-mono font-black text-[10px] uppercase shadow-[1px_1px_0px_#000]">
-          ✓ {t(`order.status_${s}`) || '已完成'}
+          ✓ {t(`order.status_${s}`) || status}
         </span>
       );
     }

+ 1 - 1
src/components/dashboard/TicketList.tsx

@@ -161,7 +161,7 @@ export default function TicketList({ onViewDetail, refreshTrigger }: TicketListP
                     [{ticket.type.toUpperCase()}] {ticket.reason.slice(0, 40)}
                   </h3>
                   <p className="text-xs text-neutral-600 font-sans line-clamp-2 leading-relaxed">
-                    {ticket.reason || '无补充描述信息'}
+                    {ticket.reason || t('ticket.no_reason') || '无补充描述信息'}
                   </p>
                 </div>
 

+ 13 - 12
src/components/dashboard/UserTicketDetailModal.tsx

@@ -90,7 +90,7 @@ export default function UserTicketDetailModal({ isOpen, onClose, ticket }: UserT
     if (fileInputRef.current) fileInputRef.current.value = '';
 
     if (file.size > 1 * 1024 * 1024) {
-      showMessage('图片大小不能超过 1MB', 'error');
+      showMessage(t('ticket.image_size_limit') || '图片大小不能超过 1MB', 'error');
       return;
     }
 
@@ -100,7 +100,7 @@ export default function UserTicketDetailModal({ isOpen, onClose, ticket }: UserT
       setAttachedImages(prev => [...prev, res.url]);
     } catch (err: any) {
       console.error("Image upload failed", err);
-      const errText = err.response?.data?.message || err.message || '图片上传失败,请重试';
+      const errText = err.response?.data?.message || err.message || t('ticket.image_upload_failed') || '图片上传失败,请重试';
       showMessage(errText, 'error');
     } finally {
       setUploadingImage(false);
@@ -115,7 +115,8 @@ export default function UserTicketDetailModal({ isOpen, onClose, ticket }: UserT
     e.preventDefault();
     if ((!replyContent.trim() && attachedImages.length === 0) || !ticket) return;
 
-    const contentToSend = replyContent.trim() || (attachedImages.length > 0 ? '[图片附件]' : '');
+    const attachmentLabel = t('ticket.image_attachment') || '[图片附件]';
+    const contentToSend = replyContent.trim() || (attachedImages.length > 0 ? attachmentLabel : '');
     const imagesToSend = [...attachedImages];
 
     // 1. 乐观更新(立即上屏,解决发送消息时白屏闪烁与顿挫问题)
@@ -208,14 +209,14 @@ export default function UserTicketDetailModal({ isOpen, onClose, ticket }: UserT
           {/* 工单初始描述气泡 */}
           <div className="bg-white border-2 border-black p-4 shadow-[3px_3px_0px_#000] space-y-2">
             <div className="flex items-center justify-between border-b border-black pb-1.5 text-[11px] font-bold text-neutral-600">
-              <span>[ 初始提交工单描述 ]</span>
+              <span>[ {t('ticket.initial_reason_title') || '初始提交工单描述'} ]</span>
               <LocalTime date={ticket.created_at} />
             </div>
             <div className="font-black text-black text-sm font-sans">
               [{ticket.type.toUpperCase()}] {ticket.reason.slice(0, 50)}
             </div>
             <p className="text-xs text-neutral-800 font-sans leading-relaxed whitespace-pre-line">
-              {ticket.reason || '无补充描述'}
+              {ticket.reason || t('ticket.no_reason') || '无补充描述'}
             </p>
           </div>
 
@@ -244,7 +245,7 @@ export default function UserTicketDetailModal({ isOpen, onClose, ticket }: UserT
                 <div key={msg.id} className={`flex ${isMe ? 'justify-end' : 'justify-start'}`}>
                   <div className={`max-w-[85%] space-y-1 ${isMe ? 'text-right' : 'text-left'}`}>
                     <div className="text-[10px] text-neutral-500 font-mono px-1">
-                      {isMe ? 'ME // 申请人' : 'AGENT // 专属顾问'} • <LocalTime date={msg.created_at} options={{ hour: '2-digit', minute: '2-digit' }} />
+                      {isMe ? `ME // ${t('ticket.applicant_label') || '申请人'}` : `AGENT // ${t('ticket.agent_label') || '专属顾问'}`} • <LocalTime date={msg.created_at} options={{ hour: '2-digit', minute: '2-digit' }} />
                     </div>
                     
                     <div className={`p-3.5 text-xs font-sans border-2 border-black ${
@@ -252,13 +253,13 @@ export default function UserTicketDetailModal({ isOpen, onClose, ticket }: UserT
                         ? 'bg-amber-300 text-black shadow-[3px_3px_0px_#000] text-left' 
                         : 'bg-white text-black shadow-[3px_3px_0px_#000] text-left'
                     }`}>
-                      {msg.content && msg.content !== '[图片附件]' && (
+                      {msg.content && msg.content !== '[图片附件]' && msg.content !== '[Image Attachment]' && (
                         <p className="leading-relaxed whitespace-pre-wrap break-words">{msg.content}</p>
                       )}
 
                       {/* 图片附件展示 */}
                       {imgs.length > 0 && (
-                        <div className={`flex flex-wrap gap-2 ${msg.content && msg.content !== '[图片附件]' ? 'mt-2.5 pt-2 border-t border-black/20' : ''}`}>
+                        <div className={`flex flex-wrap gap-2 ${msg.content && msg.content !== '[图片附件]' && msg.content !== '[Image Attachment]' ? 'mt-2.5 pt-2 border-t border-black/20' : ''}`}>
                           {imgs.map((imgUrl, idx) => (
                             <a
                               key={idx}
@@ -274,7 +275,7 @@ export default function UserTicketDetailModal({ isOpen, onClose, ticket }: UserT
                               />
                               <div className="absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 flex items-center justify-center transition text-white text-[10px] font-bold">
                                 <ExternalLink size={12} className="mr-1" />
-                                <span>原图</span>
+                                <span>{t('ticket.view_original') || '原图'}</span>
                               </div>
                             </a>
                           ))}
@@ -302,7 +303,7 @@ export default function UserTicketDetailModal({ isOpen, onClose, ticket }: UserT
                     type="button"
                     onClick={() => handleRemoveImage(idx)}
                     className="absolute -top-1.5 -right-1.5 w-4 h-4 bg-rose-500 hover:bg-rose-600 text-white rounded-full flex items-center justify-center text-[10px] font-bold shadow"
-                    title="移除图片"
+                    title={t('ticket.remove_image') || '移除图片'}
                   >
                     ✕
                   </button>
@@ -327,7 +328,7 @@ export default function UserTicketDetailModal({ isOpen, onClose, ticket }: UserT
               disabled={uploadingImage || sending}
               onClick={() => fileInputRef.current?.click()}
               className="p-2.5 bg-neutral-100 hover:bg-amber-100 text-black border-2 border-black shadow-[2px_2px_0px_#000] transition active:translate-x-0.5 active:translate-y-0.5 disabled:opacity-50 shrink-0"
-              title="本地上传图片附件 (最大 1MB)"
+              title={t('ticket.upload_image_title') || '本地上传图片附件 (最大 1MB)'}
             >
               {uploadingImage ? (
                 <Loader2 size={16} className="animate-spin text-amber-600" />
@@ -357,7 +358,7 @@ export default function UserTicketDetailModal({ isOpen, onClose, ticket }: UserT
               disabled={sending || (!replyContent.trim() && attachedImages.length === 0)}
               className="px-5 py-2.5 bg-amber-300 hover:bg-amber-400 text-black border-2 border-black font-black text-xs shadow-[3px_3px_0px_#000] transition active:translate-x-0.5 active:translate-y-0.5 active:shadow-none disabled:opacity-50 flex items-center justify-center gap-1 uppercase shrink-0"
             >
-              {sending ? <Loader2 className="animate-spin w-4 h-4" /> : <><Send size={13} /> <span>[ 发送 ]</span></>}
+              {sending ? <Loader2 className="animate-spin w-4 h-4" /> : <><Send size={13} /> <span>[ {t('ticket.send_reply') || '发送'} ]</span></>}
             </button>
           </form>
         </div>

+ 15 - 9
src/components/payment/PaymentConfirmCard.tsx

@@ -4,6 +4,7 @@ import { useEffect, useState, useRef } from 'react';
 import { useSearchParams, useRouter } from 'next/navigation';
 import { Loader2, ArrowLeft } from 'lucide-react';
 import { paymentService } from '@/lib/services';
+import { useLanguage } from '@/lib/i18n/LanguageContext';
 
 export function PaymentConfirmFallback() {
   return (
@@ -17,11 +18,12 @@ export function PaymentConfirmFallback() {
 export default function PaymentConfirmCard() {
   const searchParams = useSearchParams();
   const router = useRouter();
+  const { t } = useLanguage();
 
   const hasFetched = useRef(false);
 
   const [status, setStatus] = useState<'loading' | 'success' | 'error'>('loading');
-  const [message, setMessage] = useState('正在验证支付核销记录...');
+  const [message, setMessage] = useState(() => t('payment_confirm.verifying') || '正在验证支付核销记录...');
   const [paymentId, setPaymentId] = useState<string>('');
 
   useEffect(() => {
@@ -30,7 +32,7 @@ export default function PaymentConfirmCard() {
 
     if (!pid || !token) {
       setStatus('error');
-      setMessage('参数校验缺失:URL 中必须包含 payment_id 与 token 校验参数');
+      setMessage(t('payment_confirm.param_missing') || '参数校验缺失:URL 中必须包含 payment_id 与 token 校验参数');
       return;
     }
 
@@ -44,17 +46,17 @@ export default function PaymentConfirmCard() {
         await paymentService.checkConfirm(Number(pid));
 
         setStatus('success');
-        setMessage('支付已成功确认核销!自动化监控系统已启动后续流程。');
+        setMessage(t('payment_confirm.success_msg') || '支付已成功确认核销!自动化监控系统已启动后续流程。');
       } catch (error: any) {
         console.error(error);
         setStatus('error');
-        const errorMsg = error.response?.data?.message || error.message || '未知异常';
-        setMessage(`核销确认失败: ${errorMsg}`);
+        const errorMsg = error.response?.data?.message || error.message || t('payment_confirm.unknown_error') || '未知异常';
+        setMessage(`${t('payment_confirm.failed_prefix') || '核销确认失败: '}${errorMsg}`);
       }
     };
 
     confirmPayment();
-  }, [searchParams]);
+  }, [searchParams, t]);
 
   return (
     <div className="bg-white border-2 border-black shadow-[8px_8px_0px_#000] w-full max-w-md overflow-hidden font-mono">
@@ -93,10 +95,14 @@ export default function PaymentConfirmCard() {
         {/* 标题与描述 */}
         <div>
           <h1 className="text-lg font-black text-black uppercase">
-            {status === 'loading' ? '[ 正在验证中... ]' : status === 'success' ? '[ 支付核销成功 ]' : '[ 核销失败 ]'}
+            {status === 'loading' 
+              ? `[ ${t('payment_confirm.badge_verifying') || '正在验证中...'} ]`
+              : status === 'success' 
+              ? `[ ${t('payment_confirm.badge_success') || '支付核销成功'} ]` 
+              : `[ ${t('payment_confirm.badge_failed') || '核销失败'} ]`}
           </h1>
           <p className="text-xs text-neutral-600 font-sans mt-2 leading-relaxed">
-            {message}
+            {message || (t('payment_confirm.verifying') || '正在验证支付核销记录...')}
           </p>
         </div>
 
@@ -107,7 +113,7 @@ export default function PaymentConfirmCard() {
             className="w-full py-3 bg-neutral-100 hover:bg-amber-300 text-black border-2 border-black font-black text-xs shadow-[3px_3px_0px_#000] transition active:translate-x-0.5 active:translate-y-0.5 active:shadow-none flex items-center justify-center gap-2 uppercase"
           >
             <ArrowLeft size={14} />
-            <span>[ 返回控制台查看订单 ]</span>
+            <span>[ {t('payment_confirm.back_to_dashboard') || '返回控制台查看订单'} ]</span>
           </button>
         </div>
       </div>

+ 3 - 1
src/components/services/ServicePoster.tsx

@@ -4,6 +4,7 @@
 import React from 'react';
 import { Product } from '@/types';
 import { Plane, ShieldCheck, Compass, Globe2, Sparkles } from 'lucide-react';
+import { useLanguage } from '@/lib/i18n/LanguageContext';
 
 interface ServicePosterProps {
   product: Product;
@@ -11,6 +12,7 @@ interface ServicePosterProps {
 }
 
 export default function ServicePoster({ product, className = '' }: ServicePosterProps) {
+  const { t } = useLanguage();
   // 如果商品配置了自定义海报图,优先展示
   const cardConfig = product.extra_fields?.card_config;
   const customBanner = cardConfig?.banner_url || product.extra_fields?.banner_url || product.extra_fields?.banner_image;
@@ -265,7 +267,7 @@ export default function ServicePoster({ product, className = '' }: ServicePoster
 
       {/* 底部微信息与水印 */}
       <div className="flex items-center justify-between text-[9px] font-mono text-neutral-500 z-10 pt-1 border-t border-neutral-300">
-        <span className="truncate font-bold">官方通道直连 · 失败全退</span>
+        <span className="truncate font-bold">{t('services.guarantee_badge') || '官方通道直连 · 失败全退'}</span>
         <span className="font-bold text-black">{theme.watermark}</span>
       </div>
     </div>

+ 6 - 1
src/components/slots/SlotGrid.tsx

@@ -3,6 +3,7 @@
 import { RefreshCw, Search } from 'lucide-react';
 import CitySlotCard from '@/components/slots/CitySlotCard';
 import { SlotSnapshot } from '@/types';
+import { useLanguage } from '@/lib/i18n/LanguageContext';
 
 interface SlotGridProps {
   loading: boolean;
@@ -15,6 +16,8 @@ export default function SlotGrid({
   snapshots,
   selectedCity,
 }: SlotGridProps) {
+  const { t } = useLanguage();
+
   if (loading && snapshots.length === 0) {
     return (
       <div className="text-center py-20 bg-white border-2 border-black shadow-[4px_4px_0px_#000] font-mono">
@@ -31,7 +34,9 @@ export default function SlotGrid({
           <Search size={20} />
         </div>
         <h3 className="text-sm font-black text-black uppercase">[ NO MONITORING TELEMETRY RECORDED ]</h3>
-        <p className="text-xs text-neutral-600 font-sans">当前中心城市未检索到活跃的使馆放号监控工单</p>
+        <p className="text-xs text-neutral-600 font-sans">
+          {t('slots.no_monitoring') || '当前中心城市未检索到活跃的使馆放号监控工单'}
+        </p>
       </div>
     );
   }

+ 56 - 0
src/lib/i18n/locales/en.ts

@@ -41,6 +41,7 @@ export const en = {
     apply_support: '[ Request Support ]',
     go_to_payment: '[ Go to Payment → ]',
     view_ticket_detail: '[ View Details ]',
+    confirm_submit: 'Confirm Submit →',
   },
   auth: {
     welcome_back: 'Welcome Back',
@@ -103,6 +104,7 @@ export const en = {
     alert_code_length: 'Please enter 6-digit code',
     success: 'Email bound successfully!',
     failed: 'Bind failed',
+    force_bind_success: 'Email bound successfully! All console features unlocked.',
   },
   settings: {
     title: 'Account Settings',
@@ -184,6 +186,7 @@ export const en = {
     create_failed: 'Order creation failed',
     fill_form_hint: 'Please fill in the information carefully, as it will be used for your application.',
     no_extra_info_needed: 'No extra information needed, please proceed.',
+    quick_checkout: 'No extra materials · Fast dispatch',
     submit_and_pay: 'Submit & Pay',
     confirm_submit_msg: 'Please verify your information. It cannot be easily changed after submission.',
     no_events: 'No events have been logged for this order yet.',
@@ -265,6 +268,17 @@ export const en = {
     already_has_open_ticket: 'An open ticket already exists for this order. You cannot submit duplicate tickets.',
     view_existing_ticket: 'View Active Ticket',
     ticket_in_progress: 'Ticket In Progress',
+    image_size_limit: 'Image size cannot exceed 1MB',
+    image_upload_failed: 'Image upload failed, please retry',
+    image_attachment: '[Image Attachment]',
+    initial_reason_title: 'Initial Ticket Description',
+    no_reason: 'No additional description',
+    view_original: 'Original',
+    remove_image: 'Remove image',
+    upload_image_title: 'Upload local image attachment (max 1MB)',
+    send_reply: 'Send',
+    applicant_label: 'APPLICANT',
+    agent_label: 'SPECIALIST',
     types: {
       refund: 'Refund Request',
       dispute: 'Dispute',
@@ -374,6 +388,9 @@ export const en = {
     sales_prefix: 'Live Monitoring · Delivered',
     city_prefix: 'Jurisdiction',
     status_ready: 'Online',
+    guarantee_badge: 'Official Channel · Full Refund on Failure',
+    open_guide_tooltip: 'Open external guide in a new tab',
+    open_docs_tooltip: 'Open official documentation in a new tab',
     no_services_title: 'No Active Services Available',
     no_services_desc: 'Official services are undergoing channel testing and will be launched soon. Stay tuned.',
     refresh_services: 'Refresh Catalog',
@@ -455,6 +472,8 @@ export const en = {
     stale_data: 'Stale Data (Updating)',
     no_open_slots: 'No Open Slots',
     node_monitor: 'Node Monitor',
+    no_direct_link: 'No direct embassy link',
+    no_monitoring: 'No active embassy slot monitoring task recorded for this center',
   },
   pagination: {
     prev: 'Previous',
@@ -554,6 +573,9 @@ export const en = {
     confirm_info: 'Confirm Payment',
     original_amount: 'Original Amount',
     exchange_rate: 'Exchange Rate',
+    gateway_fee: 'Processing Fee',
+    gateway_fee_badge: 'Fee',
+    fee_free: 'Fee Free',
     random_discount: 'Random Discount',
     actual_pay: 'Total to Pay',
     go_to_pay: 'Pay Now',
@@ -590,5 +612,39 @@ export const en = {
     section2_item2_desc: 'Used to remember your language preferences.',
     section3_title: '3. Managing Cookies',
     section3_desc: 'You can control and manage cookies through your browser settings. However, disabling cookies may affect some website functionalities.',
+  },
+  payment_confirm: {
+    verifying: 'Verifying payment receipt and verification record...',
+    param_missing: 'Missing parameter: URL must contain payment_id and token verification parameters',
+    success_msg: 'Payment confirmed and verified successfully! Automated workflow has started.',
+    failed_prefix: 'Verification failed: ',
+    badge_verifying: 'VERIFYING...',
+    badge_success: 'PAYMENT VERIFIED',
+    badge_failed: 'VERIFICATION FAILED',
+    back_to_dashboard: 'Return to Console / Orders',
+    unknown_error: 'Unknown error',
+  },
+  tutorial: {
+    default_modal_title: 'Service Tutorial & Preparation Guide',
+    default_badge: 'Essential Guide',
+    default_btn: '📖 View Guide & Account Preparation',
+    default_link: 'Open Full Documentation ↗',
+    open_external: 'Open external documentation in a new window',
+    no_link_configured: 'External link not configured',
+    collapse_guide: 'Collapse Guide',
+    expand_guide: 'Expand Guide',
+    collapse_tooltip: 'Collapse embedded steps & content',
+    expand_tooltip: 'Expand embedded steps & content',
+    online_kb_title: 'Official Knowledge Base & Account Guide',
+    online_kb_desc: 'Detailed tutorial is maintained in our online documentation. Click to open.',
+    prep_steps_title: 'Preparation & Operational Steps',
+    faq_title: 'Detailed Notes & FAQ',
+    external_doc_label: 'Official Knowledge Base / External Docs',
+    external_doc_subtext: 'Read full step-by-step screenshots and guides in your browser',
+    applicable_product: 'Applicable Service',
+    core_requirements: 'Core Submission & Account Requirements',
+    instructions_steps: 'Step-by-Step Guide',
+    security_note: '* Please verify account credentials carefully to pass official risk verification smoothly',
+    understood_btn: 'I Have Read & Understood',
   }
 };

+ 61 - 0
src/lib/i18n/locales/zh.ts

@@ -41,6 +41,7 @@ export const zh = {
     apply_support: '[ 申请客服支持 ]',
     go_to_payment: '[ 前往收银台支付 → ]',
     view_ticket_detail: '[ 查阅工单明细 ]',
+    confirm_submit: '确认提交 →',
   },
   auth: {
     welcome_back: '欢迎回来',
@@ -103,6 +104,7 @@ export const zh = {
     alert_code_length: '请输入6位验证码',
     success: '账号绑定成功!',
     failed: '绑定失败',
+    force_bind_success: '邮箱绑定成功!已为您解锁全部控制台功能。',
   },
   settings: {
     title: '账户设置',
@@ -184,6 +186,7 @@ export const zh = {
     create_failed: '创建订单失败',
     fill_form_hint: '请仔细填写以下申请信息,这将直接用于您的签证申请。',
     no_extra_info_needed: '无需填写额外信息,请直接提交。',
+    quick_checkout: '免附加材料 · 极速签批',
     submit_and_pay: '提交订单并支付',
     confirm_submit_msg: '请核对填写的信息是否准确,提交后将无法直接修改。',
     no_events: '该订单暂无事件记录。',
@@ -265,6 +268,17 @@ export const zh = {
     already_has_open_ticket: '该订单已有正在处理中的工单,无法重复发起',
     view_existing_ticket: '查看处理中工单',
     ticket_in_progress: '工单处理中',
+    image_size_limit: '图片大小不能超过 1MB',
+    image_upload_failed: '图片上传失败,请重试',
+    image_attachment: '[图片附件]',
+    initial_reason_title: '初始提交工单描述',
+    no_reason: '无补充描述',
+    view_original: '原图',
+    remove_image: '移除图片',
+    upload_image_title: '本地上传图片附件 (最大 1MB)',
+    send_reply: '发送',
+    applicant_label: '申请人',
+    agent_label: '专属顾问',
     types: {
       refund: '退款申请',
       dispute: '交易纠纷',
@@ -313,6 +327,11 @@ export const zh = {
   refund: {
     title: '退款政策 & 服务条款',
     subtitle: '为了保障您的权益,请仔细阅读以下条款',    
+    full_refund_title: '全额退款申请条件',
+    full_refund_desc: '在以下情况下,您可以申请全额退款:',
+    full_refund_item_1: '您已支付订单,但系统尚未启动任何预约监控操作(状态为待处理)。',
+    full_refund_item_2: '因 STRATA 系统故障导致的重复扣费。',
+    full_refund_item_3: '在承诺的服务周期内未能成功锁定有效席位。',
     standard_refund_title: "退款规则与手续费说明",
     fee_notice_title: "重要:第三方支付网关手续费",
     fee_notice_desc: "因支付渠道不同,部分第三方支付网关在订单支付成功时会收取不可退还的手续费或管理费。符合退款条件的订单,实际退款金额将根据您下单时使用的支付方式扣除相应的费用:",
@@ -368,6 +387,9 @@ export const zh = {
     sales_prefix: '实时监控中 · 已售',
     city_prefix: '适用领区',
     status_ready: '直连就绪',
+    guarantee_badge: '官方通道直连 · 失败全退',
+    open_guide_tooltip: '在新标签页中打开官方外部使用指南',
+    open_docs_tooltip: '在新标签页中打开官方文档',
     no_services_title: '暂无已上线的成熟服务',
     no_services_desc: '官方服务正在陆续完成通道测试并准入上架,敬请期待。',
     refresh_services: '刷新展厅服务',
@@ -449,6 +471,8 @@ export const zh = {
     stale_data: '数据超时待更新',
     no_open_slots: '暂无开放名额',
     node_monitor: '监控节点',
+    no_direct_link: '使馆暂无直达链接',
+    no_monitoring: '当前中心城市未检索到活跃的使馆放号监控工单',
   },
   pagination: {
     prev: '上一页',
@@ -548,6 +572,9 @@ export const zh = {
     confirm_info: '确认支付信息',
     original_amount: '原始金额',
     exchange_rate: '参考汇率',
+    gateway_fee: '通道结算手续费',
+    gateway_fee_badge: '手续费',
+    fee_free: '免手续费',
     random_discount: '随机立减',
     actual_pay: '实际需付',
     go_to_pay: '前往支付',
@@ -584,5 +611,39 @@ export const zh = {
     section2_item2_desc: '用于记住您的语言偏好设置。',
     section3_title: '3. 如何管理 Cookie',
     section3_desc: '您可以通过浏览器设置禁用 Cookie,但这可能会影响网站的部分功能。',
+  },
+  payment_confirm: {
+    verifying: '正在验证支付核销记录...',
+    param_missing: '参数校验缺失:URL 中必须包含 payment_id 与 token 校验参数',
+    success_msg: '支付已成功确认核销!自动化监控系统已启动后续流程。',
+    failed_prefix: '核销确认失败: ',
+    badge_verifying: '正在验证中...',
+    badge_success: '支付核销成功',
+    badge_failed: '核销失败',
+    back_to_dashboard: '返回控制台查看订单',
+    unknown_error: '未知异常',
+  },
+  tutorial: {
+    default_modal_title: '商品使用教程与资料准备指引',
+    default_badge: '申请人必读指引',
+    default_btn: '📖 查看使用教程与账号准备说明',
+    default_link: '打开完整图文文档 ↗',
+    open_external: '在新窗口打开外部详细图文教程',
+    no_link_configured: '外部链接未配置',
+    collapse_guide: '收起指引',
+    expand_guide: '展开指引',
+    collapse_tooltip: '收起内嵌步骤与内容',
+    expand_tooltip: '展开内嵌步骤与内容',
+    online_kb_title: '官方在线图文知识库与账号指引',
+    online_kb_desc: '本服务详细教程由官方在外部文档库持续更新维护,支持直接跳转查阅',
+    prep_steps_title: '准备与操作步骤',
+    faq_title: '详细说明与常见疑问 FAQ',
+    external_doc_label: '官方在线图文知识库 / 外部文档',
+    external_doc_subtext: '支持在电脑或手机浏览器中完整查阅带图截屏与更详细的说明',
+    applicable_product: '适用商品',
+    core_requirements: '核心填报与账号要求说明',
+    instructions_steps: '操作指南与准备步骤',
+    security_note: '* 建议仔细核对账号密码,以确保自动化工单能顺畅通过官网风控验证',
+    understood_btn: '我已阅读并了解',
   }
 };

+ 12 - 0
src/lib/services/productService.ts

@@ -184,4 +184,16 @@ export const productService = {
     });
     return res.data;
   },
+
+  /**
+   * AI 智能解析并生成商品使用教程配置
+   */
+  async parseTutorialWithLlm(prompt: string, model?: string, systemPrompt?: string) {
+    const res = await api.post('/api/vas/llm/parse_tutorial', { 
+      prompt, 
+      model, 
+      system_prompt: systemPrompt 
+    });
+    return res.data;
+  },
 };

+ 3 - 0
src/types/payment.ts

@@ -56,6 +56,7 @@ export interface PaymentProvider {
   title?: string;
   description?: string;
   enabled?: boolean;
+  config?: Record<string, any>;
 }
 
 /**
@@ -96,6 +97,8 @@ export interface PaymentResult {
   amount: number;
   currency: string;
   random_offset?: number;
+  fee_amount?: number;
+  fee_rate?: number;
   exchange_rate?: number;
   adjustment_delta?: number;
   

+ 3 - 1
src/types/settlement.ts

@@ -121,7 +121,9 @@ export interface SettlementOrderDetail {
   handler_name?: string | null;
   developer_id?: string | null;
   developer_name?: string | null;
-  order_amount: number; // 订单实收(分)
+  order_amount: number; // 订单分润净额(分, 已剔除通道手续费)
+  gross_amount?: number; // 用户实付流水总额(分)
+  fee_amount?: number; // 扣除的通道手续费(分)
   currency?: string; // 实际交易流水币种代码 (如 'EUR', 'CNY')
   original_amount?: number; // 原始标价/支付金额(分)
   original_currency?: string; // 原始币种代码 (如 'EUR', 'USD', 'CNY')