// team-icons.jsx — AI 金融團隊：七位部門長手繪半身像
// 沿 node-icons 線條風：48×48 viewBox、細線 stroke、round cap、單色 currentColor。
// 每位一件職業道具：數據=碟片堆、設計=印章、工程=扳手、策略=羅盤、
// 品保=放大鏡、量化交易=K線小旗、行政=毛筆。42 位專員不畫像，用部門色圓章 monogram。

function _LeadBase({ size, color, strokeWidth, style, children }) {
  return (
    <svg width={size} height={size} viewBox="0 0 48 48" fill="none" style={style}
         stroke={color} strokeWidth={strokeWidth} strokeLinecap="round" strokeLinejoin="round">
      {/* 共同半身：頭+肩線+領口 */}
      <circle cx="24" cy="15" r="8" />
      <path d="M8 42 Q10 29 24 29 Q38 29 40 42" />
      <path d="M20 30 L24 35 L28 30" strokeWidth={strokeWidth * 0.85} />
      {children}
    </svg>
  );
}

// A · 數據 Lead — 懷抱碟片堆（資料庫）
function LeadDataIcon(p) {
  const { size = 40, color = 'currentColor', strokeWidth = 1.4, style } = p;
  return (
    <_LeadBase size={size} color={color} strokeWidth={strokeWidth} style={style}>
      <ellipse cx="37" cy="34" rx="6" ry="2.4" />
      <path d="M31 34 L31 40 Q31 42.4 37 42.4 Q43 42.4 43 40 L43 34" />
      <path d="M31 37 Q31 39.4 37 39.4 Q43 39.4 43 37" strokeWidth={strokeWidth * 0.8} />
    </_LeadBase>
  );
}

// B · 設計 Lead — 手持印章（品牌章）
function LeadDesignIcon(p) {
  const { size = 40, color = 'currentColor', strokeWidth = 1.4, style } = p;
  return (
    <_LeadBase size={size} color={color} strokeWidth={strokeWidth} style={style}>
      <path d="M35 28 L39 28 L39 34 L35 34 Z" transform="rotate(8 37 31)" />
      <path d="M33.5 36 L41 37.2 L40.6 40 L33.1 38.8 Z" />
      <path d="M36 31 L38 31.3" strokeWidth={strokeWidth * 0.7} />
    </_LeadBase>
  );
}

// C · 工程 Lead — 肩上扳手
function LeadEngIcon(p) {
  const { size = 40, color = 'currentColor', strokeWidth = 1.4, style } = p;
  return (
    <_LeadBase size={size} color={color} strokeWidth={strokeWidth} style={style}>
      <path d="M34 42 L41 32" />
      <path d="M40 29 Q38 29 37.6 31 Q37.4 33 39.4 33.6 Q41.6 34 42.6 32 L44 33.6 Q43 36.4 40 36.2 Q36 36 35.4 32.4 Q35 29 38 27.6 Z" strokeWidth={strokeWidth * 0.85} />
    </_LeadBase>
  );
}

// D · 量化 Lead — 手持羅盤（策略定向）
function LeadQuantIcon(p) {
  const { size = 40, color = 'currentColor', strokeWidth = 1.4, style } = p;
  return (
    <_LeadBase size={size} color={color} strokeWidth={strokeWidth} style={style}>
      <circle cx="38" cy="36" r="5.6" />
      <circle cx="38" cy="36" r="1" fill={color} stroke="none" />
      <path d="M38 31.6 L38 33 M38 39 L38 40.4 M33.6 36 L35 36 M41 36 L42.4 36" strokeWidth={strokeWidth * 0.75} />
      <path d="M40.4 33.6 L36.4 38.2" strokeWidth={strokeWidth * 0.85} />
    </_LeadBase>
  );
}

// E · 品保 Lead — 放大鏡審視
function LeadQaIcon(p) {
  const { size = 40, color = 'currentColor', strokeWidth = 1.4, style } = p;
  return (
    <_LeadBase size={size} color={color} strokeWidth={strokeWidth} style={style}>
      <circle cx="36.5" cy="33" r="4.6" />
      <path d="M40 36.5 L44 41" />
      <path d="M34.6 32 Q36 30.8 37.8 31.6" strokeWidth={strokeWidth * 0.7} opacity="0.7" />
    </_LeadBase>
  );
}

// F · 量化交易 Lead — 舉K線小旗（進出場號令）
function LeadTradeIcon(p) {
  const { size = 40, color = 'currentColor', strokeWidth = 1.4, style } = p;
  return (
    <_LeadBase size={size} color={color} strokeWidth={strokeWidth} style={style}>
      <path d="M37 42 L37 27" />
      <path d="M37 27 L45 29.5 L37 32.5" />
      <path d="M39.5 28.6 L39.5 30.6 M41.6 29 L41.6 30.4" strokeWidth={strokeWidth * 0.7} />
    </_LeadBase>
  );
}

// G · 行政 Lead — 執毛筆（文書調度）
function LeadAdminIcon(p) {
  const { size = 40, color = 'currentColor', strokeWidth = 1.4, style } = p;
  return (
    <_LeadBase size={size} color={color} strokeWidth={strokeWidth} style={style}>
      <path d="M36 42 L42 28" />
      <path d="M42 28 L43.6 24.4" strokeWidth={strokeWidth * 1.5} />
      <path d="M35 44 Q36.4 43.4 36.6 42 L35.2 41.4 Q34.6 42.8 35 44 Z" fill={color} stroke="none" opacity="0.85" />
    </_LeadBase>
  );
}

// 組織章：The Firm 圓形印（刊頭裝飾）
function FirmSealIcon({ size = 52, color = 'currentColor', strokeWidth = 1.3, style }) {
  return (
    <svg width={size} height={size} viewBox="0 0 48 48" fill="none" style={style}
         stroke={color} strokeWidth={strokeWidth} strokeLinecap="round" strokeLinejoin="round">
      <circle cx="24" cy="24" r="20" />
      <circle cx="24" cy="24" r="15.5" strokeWidth={strokeWidth * 0.7} />
      {/* 七芒點：七個部門 */}
      {[0, 1, 2, 3, 4, 5, 6].map(i => {
        const a = -Math.PI / 2 + i * 2 * Math.PI / 7;
        return <circle key={i} cx={24 + Math.cos(a) * 17.7} cy={24 + Math.sin(a) * 17.7} r="1" fill="currentColor" stroke="none" />;
      })}
      <path d="M15 24 L21 24 L23 19 L26 29 L28 24 L33 24" strokeWidth={strokeWidth * 0.9} />
    </svg>
  );
}

const TEAM_LEAD_ICONS = {
  'data': LeadDataIcon, 'design': LeadDesignIcon, 'engineering': LeadEngIcon,
  'quant': LeadQuantIcon, 'qa': LeadQaIcon, 'quant-trade': LeadTradeIcon, 'admin': LeadAdminIcon,
};
window.TEAM_LEAD_ICONS = TEAM_LEAD_ICONS;
window.FirmSealIcon = FirmSealIcon;
