// EwoooC - 比價爬蟲系統資料

const EWOOOC_DATA = {
  // 商品監控總覽（對應截圖的「商品監控概況」）
  monitorStats: {
    total: 7057,
    todayAdded: 4,
    weekGrowth: 92,
    weekChanged: 850,
    stableCount: 869,
  },

  // 今日價格動態
  priceDynamics: {
    priceUp: 39,
    priceDown: 60,
    delisted: 0,
    avgUp: 244,
    avgDown: -131,
    activity: 1.4,
    activeCount: 99,
    hottestCategory: '私密保養推薦品牌',
    hottestCount: 17,
    biggestChange: { product: '【LA MER 海洋拉娜】緊緻精華霜 ...', amount: 1200 },
  },

  // 排程狀態
  schedule: {
    lastRun: '12:54:23',
    scanned: 1569,
    added: 0,
    status: 'success',
  },

  // 商品列表（對應截圖商品列表）
  products: [
    { id: '5465944',       category: '止汗體香', name: '【kiret】腋下止汗貼腋下專用吸汗貼 30入(吸汗速乾 腋下貼 吸汗貼)', price: 299, yesterdayChange: null, weekChange: -80, updatedAt: '04-30 14:00', listedAt: '01-07 18:24', emoji: '🧴' },
    { id: '14333992',      category: '止汗體香', name: '【NOOSA BASICS】任選1款植萃體香滾珠 50ml(檀香/玫瑰乳香/檸檬香桃木/甜橙薰衣草-國...', price: 468, yesterdayChange: null, weekChange: -97, updatedAt: '04-30 14:00', listedAt: '04-14 10:12', emoji: '🌿' },
    { id: '14305052',      category: '止汗體香', name: '【NIVEA 妮維雅】男士止汗爽身乳液50ml 瞬間酷涼系列x3入(麝香/柑橘止汗滾珠/涼感)', price: 419, yesterdayChange: null, weekChange: -10, updatedAt: '04-30 14:00', listedAt: '04-10 10:49', emoji: '💧' },
    { id: 'TP00022180001470',category: '止汗體香', name: '【ban 盼】滾珠式體香劑103ml/體香膏73g (原味花香/爽身粉香/沐浴清香/無香)', price: 169, yesterdayChange: null, weekChange: null, updatedAt: '04-30 14:00', listedAt: '04-03 10:47', emoji: '🛁' },
    { id: '13723381',      category: '止汗體香', name: '【GATSBY】止汗體香滾珠50ml(4款任選)', price: 139, yesterdayChange: null, weekChange: null, updatedAt: '04-30 14:00', listedAt: '01-18 17:19', emoji: '🧪' },
    { id: '12894521',      category: '美妝保養', name: '【LA MER 海洋拉娜】緊緻精華霜 30ml(明星商品 限量組)', price: 14800, yesterdayChange: 1200, weekChange: 1200, updatedAt: '04-30 14:00', listedAt: '03-22 09:15', emoji: '✨' },
    { id: '11203847',      category: '美妝保養', name: '【SK-II】青春露 230ml 神仙水', price: 5980, yesterdayChange: -120, weekChange: -380, updatedAt: '04-30 14:00', listedAt: '02-14 11:22', emoji: '💎' },
    { id: '15672891',      category: '美妝保養', name: '【ESTÉE LAUDER 雅詩蘭黛】小棕瓶肌透修護精華 50ml', price: 4280, yesterdayChange: 280, weekChange: 480, updatedAt: '04-30 14:00', listedAt: '03-08 14:50', emoji: '🍂' },
    { id: '14598732',      category: '保健食品', name: '【善存】銀寶善存 50+ 100錠', price: 899, yesterdayChange: null, weekChange: -45, updatedAt: '04-30 14:00', listedAt: '04-21 16:33', emoji: '💊' },
    { id: '13284756',      category: '生活雜貨', name: '【3M】百利菜瓜布 廚房去油專用 6片裝', price: 89, yesterdayChange: null, weekChange: null, updatedAt: '04-30 14:00', listedAt: '01-05 10:00', emoji: '🧽' },
  ],

  // 廠商缺貨清單
  outOfStock: [
    { vendor: 'momo購物網', count: 12, lastSeen: '04-30 13:42' },
    { vendor: 'PChome 24h', count: 8, lastSeen: '04-30 13:22' },
    { vendor: '蝦皮商城', count: 23, lastSeen: '04-30 12:58' },
    { vendor: 'Yahoo 購物中心', count: 5, lastSeen: '04-30 11:17' },
  ],

  // 30 天價格走勢（用於彈窗圖表）
  priceHistory: Array.from({ length: 30 }, (_, i) => ({
    date: `04-${String(i+1).padStart(2,'0')}`,
    price: 280 + Math.round(Math.sin(i / 3) * 30 + Math.random() * 30 + i * 1.5),
  })),

  // ===== 活動看板資料 =====
  campaigns: {
    flash: {
      id: 'flash',
      name: '限時搶購',
      icon: '🔥',
      time: '活動時間：04/30 18:00~04/30 21:59',
      lastUpdate: '2026-04-30 19:05',
      total: 310,
      schedule: { lastRun: '2026-04-30 19:06:34', anomalies: 107, status: 'success' },
      timeSlots: [
        { time: '00:00', count: 32 },
        { time: '07:00', count: 34 },
        { time: '11:00', count: 19 },
        { time: '14:00', count: 0 },
        { time: '18:00', count: 39 },
        { time: '22:00', count: 26, active: true },
      ],
      stats: { listed: 54, new: 27, up: 0, down: 0, delisted: 29 },
      products: [
        { id: '13135914', cat: '精萃液',           name: '蘭蔻 小黑瓶PRO50ml',         price: 4092,  emoji: '🧪', new: true,  off: '55折', limit: 200 },
        { id: '13062545', cat: '底妝_隔離霜',      name: '肌膚之鑰 妝前凝霜',           price: 1199,  emoji: '🧴', new: true,  off: '57折', limit: 250 },
        { id: '13233302', cat: '嬰幼身體保養品牌旗艦', name: '凡士林 精華凝乳3入',         price: 529,   emoji: '🍼', new: true,  off: '44折', limit: 300 },
        { id: '9135192',  cat: '嬰幼身體保養品牌旗艦', name: 'SEBAMED 潔膚露2入',         price: 688,   emoji: '🍼', off: '下架', limit: 380, delisted: true },
        { id: '14511798', cat: '未分類',           name: 'TAKASHIMA 高島 筋負 五行美體養生椅', price: 29999, emoji: '🪑', new: true, off: '5折',  limit: 18 },
        { id: '15087322', cat: '未分類',           name: 'BGYM H动 G55 純纖綁徒陪式步機－發山老技手版 (DD01/原版/水双纤维)', price: 18900, emoji: '🚲', new: true, off: '6折', limit: 12 },
      ],
    },
    festival: {
      id: 'festival',
      name: '1.1狂歡購物節',
      icon: '🔥',
      time: '1.1狂歡購物節',
      lastUpdate: '2026-04-30 17:55',
      total: 226,
      schedule: { lastRun: '2026-04-30 19:13:11', anomalies: 0, status: 'success' },
      categories: [
        { name: 'mo+商城', count: 10, active: true },
        { name: '今日限定 偽低狂殺', count: 12 },
        { name: '口腔護理', count: 10 },
        { name: '專櫃精選', count: 6 },
        { name: '專櫃彩妝', count: 10 },
        { name: '探索更多分類', count: 6 },
        { name: '新品速報 搶先入手', count: 3 },
        { name: '最強寵愛攻略', count: 3 },
        { name: '沙龍洗沐', count: 10 },
        { name: '洗沐美髮', count: 9 },
        { name: '流行彩妝', count: 10 },
        { name: '焦點大牌 強檔鉅獻', count: 48 },
        { name: '狂歡夯品 優惠爆發', count: 10 },
        { name: '獨家活動 強勢登場', count: 2 },
        { name: '話題強牌 精選推薦', count: 12 },
        { name: '超值大組 買多省多', count: 10 },
        { name: '醫美修護', count: 10 },
        { name: '開架保養', count: 10 },
        { name: '香水香氛', count: 10 },
        { name: '驚喜獻禮 首選必buy', count: 10 },
      ],
      stats: { listed: 10, new: 10, up: 1, down: 0, delisted: 0 },
      products: [
        { id: 'TP00007400000083', cat: '未分類', name: '達特仕 水樹酸棉片2罐',       price: 5948, emoji: '🧴', new: true,  status: '活動中' },
        { id: 'TP00080550000244', cat: '未分類', name: 'Medicube 美容儀',           price: 4999, emoji: '💆', new: true,  status: '活動中' },
        { id: 'TP00056060000035', cat: '未分類', name: '艾沛膚AD水潤露沐浴組',       price: 1630, oldPrice: 1287, change: 343, changePct: 27, emoji: '🧴', up: true, status: '活動中' },
        { id: 'TP00018590000010', cat: '未分類', name: '茶碳光感上色亮髮乳',         price: 1399, emoji: '💇', new: true,  status: '活動中' },
        { id: 'TP00042310000058', cat: '未分類', name: 'Olay 玻尿酸保濕霜 50ml',     price: 899,  emoji: '🧴', new: true,  status: '活動中' },
        { id: 'TP00071230000091', cat: '未分類', name: 'KOSE 雪肌精化妝水 200ml',    price: 1280, emoji: '💧', new: true,  status: '活動中' },
      ],
    },
    mothers: {
      id: 'mothers',
      name: '母親節',
      icon: '🔥',
      time: '活動時間：母親節超值限時購',
      lastUpdate: '2026-04-30 19:30',
      total: 278,
      schedule: { lastRun: '2026-04-30 19:06:34', anomalies: 107, status: 'success' },
      categories: [
        { name: 'moPro專屬版', count: 9, active: true },
        { name: '今日主打', count: 122 },
        { name: '品牌鉅獻', count: 8 },
        { name: '夯品特開', count: 13 },
        { name: '樂購mo店+', count: 27 },
        { name: '母親節搶先開賣', count: 18 },
        { name: '熱搜清單', count: 20 },
        { name: '爆殺神券', count: 1 },
        { name: '生活超市', count: 13 },
        { name: '精選情實好物', count: 9 },
        { name: '送禮嚴選', count: 11 },
        { name: '點點頭計畫', count: 21 },
      ],
      stats: { listed: 9, new: 0, up: 0, down: 0, delisted: 0 },
      products: [
        { id: '15093144', cat: '素然氪', name: '【西西露】 韓國面膜',  price: 69,    emoji: '🧖', new: true, status: '活動中' },
        { id: '14118016', cat: '未分類', name: '【亞梭】 CS-Black椅',  price: 29388, emoji: '🪑', new: true, status: '活動中' },
        { id: '15052867', cat: '未分類', name: '【Shark】 涼感頂霧扇', price: 4099,  emoji: '🌀', new: true, status: '活動中' },
        { id: '14896469', cat: '未分類', name: '【舒潔】 衛生紙',      price: 688,   emoji: '🧻', new: true, status: '活動中' },
        { id: '14260664', cat: '未分類', name: '【味丹】 多喝水',      price: 638,   emoji: '💧', new: true, status: '活動中' },
        { id: '15123887', cat: '未分類', name: '【金門高梁】 58度 600ml', price: 599, emoji: '🥃', new: true, status: '活動中' },
      ],
    },
    valentine: {
      id: 'valentine',
      name: '520情人節',
      icon: '💖',
      time: '活動時間：520情人節限定',
      lastUpdate: '2026-04-30 18:00',
      total: 184,
      schedule: { lastRun: '2026-04-30 19:00:00', anomalies: 12, status: 'success' },
      categories: [
        { name: '情侶禮物', count: 24, active: true },
        { name: '香水香氛', count: 18 },
        { name: '飾品配件', count: 32 },
        { name: '巧克力禮盒', count: 15 },
      ],
      stats: { listed: 24, new: 8, up: 2, down: 1, delisted: 0 },
      products: [
        { id: '17234561', cat: '飾品配件', name: 'Tiffany 經典項鍊', price: 28800, emoji: '💎', new: true, status: '活動中' },
        { id: '17234562', cat: '香水香氛', name: 'Chanel No.5 50ml', price: 4280,  emoji: '🌹', new: true, status: '活動中' },
        { id: '17234563', cat: '巧克力禮盒', name: 'GODIVA 心型禮盒', price: 1580, emoji: '🍫', new: true, status: '活動中' },
      ],
    },
    laborday: {
      id: 'laborday',
      name: '勞動節',
      icon: '🛠️',
      time: '活動時間：勞動節 04/30~05/01',
      lastUpdate: '2026-04-30 17:00',
      total: 96,
      schedule: { lastRun: '2026-04-30 18:30:00', anomalies: 3, status: 'success' },
      categories: [
        { name: '家電特賣', count: 28, active: true },
        { name: '工具用品', count: 22 },
        { name: '居家修繕', count: 18 },
      ],
      stats: { listed: 28, new: 4, up: 0, down: 3, delisted: 0 },
      products: [
        { id: '18234561', cat: '家電特賣', name: 'Dyson V12 無線吸塵器', price: 18800, emoji: '🧹', new: true, status: '活動中' },
        { id: '18234562', cat: '工具用品', name: 'Bosch 18V 電鑽組',     price: 4280,  emoji: '🔧', status: '活動中' },
      ],
    },
  },

  // KPI 卡片（給 dashboard 用）
  kpis: [
    { id: 'monitor', label: 'MONITORED',  zhLabel: '監控總數', value: '7,057',  delta: 1.32, deltaLabel: '本週 +92', icon: 'package' },
    { id: 'change',  label: 'PRICE CHANGES', zhLabel: '今日變動', value: '99',  delta: 1.4,  deltaLabel: '活躍度',     icon: 'trendUp' },
    { id: 'up',      label: 'PRICE UP',    zhLabel: '漲價商品', value: '39',   delta: 244,   deltaLabel: '平均 +$244',  icon: 'arrowUp', tone: 'danger' },
    { id: 'down',    label: 'PRICE DOWN',  zhLabel: '降價商品', value: '60',   delta: -131,  deltaLabel: '平均 -$131',  icon: 'arrowDown', tone: 'success' },
  ],
};

const STATUS_MAP = {
  success: { label: '成功', tone: 'success' },
  running: { label: '掃描中', tone: 'info' },
  failed:  { label: '失敗', tone: 'danger' },
};

// 為了相容舊 page-orders/page-products 等檔案的引用，保留別名
window.MOMO_DATA = EWOOOC_DATA;
window.EWOOOC_DATA = EWOOOC_DATA;
window.STATUS_MAP = STATUS_MAP;
