// 线性 SVG 图标组件 · lucide 风 1.5px stroke

const Icon = ({ name, size = 18, stroke = 1.6, color = "currentColor", ...rest }) => {
  const common = {
    width: size,
    height: size,
    viewBox: "0 0 24 24",
    fill: "none",
    stroke: color,
    strokeWidth: stroke,
    strokeLinecap: "round",
    strokeLinejoin: "round",
    style: { flexShrink: 0, ...(rest.style || {}) },
  };
  const paths = {
    chat: <g>
      <path d="M21 12a8 8 0 0 1-11.6 7.1L4 20l1-4.4A8 8 0 1 1 21 12Z" />
    </g>,
    star: <path d="M12 3.5l2.6 5.3 5.9.9-4.2 4.1 1 5.8L12 16.9 6.7 19.6l1-5.8L3.5 9.7l5.9-.9L12 3.5Z" />,
    heart: <path d="M12 20s-7-4.5-7-10a4 4 0 0 1 7-2.6A4 4 0 0 1 19 10c0 5.5-7 10-7 10Z" />,
    "heart-fill": <path d="M12 20s-7-4.5-7-10a4 4 0 0 1 7-2.6A4 4 0 0 1 19 10c0 5.5-7 10-7 10Z" fill={color} />,
    calendar: <g>
      <rect x="3.5" y="5" width="17" height="15" rx="2.5" />
      <path d="M3.5 10h17" />
      <path d="M8 3v4M16 3v4" />
    </g>,
    settings: <g>
      <circle cx="12" cy="12" r="2.8" />
      <path d="M19.4 14.4a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V20a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H4a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H10a1.7 1.7 0 0 0 1-1.5V4a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V10a1.7 1.7 0 0 0 1.5 1H20a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1Z" />
    </g>,
    stats: <g>
      <path d="M4 20V10" />
      <path d="M10 20V4" />
      <path d="M16 20v-7" />
      <path d="M22 20H2" />
    </g>,
    home: <g>
      <path d="M3 11.5 12 4l9 7.5" />
      <path d="M5 10.5V20h14V10.5" />
      <path d="M10 20v-5h4v5" />
    </g>,
    "arrow-left": <g>
      <path d="M19 12H5" />
      <path d="m12 19-7-7 7-7" />
    </g>,
    "arrow-up": <g>
      <path d="M12 19V5" />
      <path d="m5 12 7-7 7 7" />
    </g>,
    refresh: <g>
      <path d="M3 12a9 9 0 0 1 15.5-6.3L21 8" />
      <path d="M21 3v5h-5" />
      <path d="M21 12a9 9 0 0 1-15.5 6.3L3 16" />
      <path d="M3 21v-5h5" />
    </g>,
    copy: <g>
      <rect x="9" y="9" width="11" height="11" rx="2.5" />
      <path d="M5 15H4a1.5 1.5 0 0 1-1.5-1.5V4A1.5 1.5 0 0 1 4 2.5h9.5A1.5 1.5 0 0 1 15 4v1" />
    </g>,
    plus: <g><path d="M12 5v14" /><path d="M5 12h14" /></g>,
    close: <g><path d="M18 6 6 18" /><path d="m6 6 12 12" /></g>,
    "chev-left": <path d="m15 18-6-6 6-6" />,
    "chev-right": <path d="m9 18 6-6-6-6" />,
    "chev-down": <path d="m6 9 6 6 6-6" />,
    sun: <g>
      <circle cx="12" cy="12" r="4" />
      <path d="M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41" />
    </g>,
    moon: <path d="M21 12.8A9 9 0 1 1 11.2 3 7 7 0 0 0 21 12.8Z" />,
    cloud: <path d="M17.5 19a4.5 4.5 0 0 0 0-9 6 6 0 0 0-11.6 1.7A4 4 0 0 0 6.5 19Z" />,
    pin: <g>
      <path d="M12 22s7-7.5 7-13a7 7 0 1 0-14 0c0 5.5 7 13 7 13Z" />
      <circle cx="12" cy="9" r="2.5" />
    </g>,
    sparkle: <path d="M12 3v6M12 15v6M3 12h6M15 12h6M5.5 5.5l4 4M14.5 14.5l4 4M18.5 5.5l-4 4M9.5 14.5l-4 4" />,
    upload: <g>
      <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
      <path d="m17 8-5-5-5 5" />
      <path d="M12 3v12" />
    </g>,
    download: <g>
      <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
      <path d="m7 10 5 5 5-5" />
      <path d="M12 15V3" />
    </g>,
    edit: <g>
      <path d="M12 20h9" />
      <path d="M16.5 3.5a2.1 2.1 0 1 1 3 3L7 19l-4 1 1-4Z" />
    </g>,
    quote: <g>
      <path d="M6 17h3l2-4V7H5v6h3l-2 4Z" />
      <path d="M14 17h3l2-4V7h-6v6h3l-2 4Z" />
    </g>,
    check: <path d="m5 12 5 5L20 7" />,
    cat: <g>
      <path d="M5 8c0-2 1-5 2-5l3 3c.7-.1 1.3-.1 2-.1s1.3 0 2 .1l3-3c1 0 2 3 2 5 .6 1 1 2.2 1 3.5 0 4.4-4 7.5-8 7.5s-8-3.1-8-7.5C4 10.2 4.4 9 5 8Z" />
      <circle cx="9.5" cy="12" r="0.6" fill="currentColor" stroke="none" />
      <circle cx="14.5" cy="12" r="0.6" fill="currentColor" stroke="none" />
      <path d="M11 15h2" />
      <path d="M10.5 16.5c.5.4 1 .5 1.5.5s1-.1 1.5-.5" />
      <path d="M8 13c-.5.5-1.5.7-2.5.5M16 13c.5.5 1.5.7 2.5.5" />
    </g>,
    dog: <g>
      <path d="M7 5C5 5 4 6.5 4 8.5c0 1 .3 1.8.8 2.4" />
      <path d="M17 5c2 0 3 1.5 3 3.5 0 1-.3 1.8-.8 2.4" />
      <path d="M5 11c0-3 3-6 7-6s7 3 7 6c.8.7 1.5 1.6 1.5 2.8 0 1.4-1 2.2-2.5 2.2 0 2.2-2.5 4-6 4s-6-1.8-6-4c-1.5 0-2.5-.8-2.5-2.2 0-1.2.7-2.1 1.5-2.8Z" />
      <circle cx="9.5" cy="12" r="0.6" fill="currentColor" stroke="none" />
      <circle cx="14.5" cy="12" r="0.6" fill="currentColor" stroke="none" />
      <path d="M11.5 15h1l-.5.7L11.5 15Z" fill="currentColor" stroke="none" />
      <path d="M10 17c.7.5 1.3.6 2 .6s1.3-.1 2-.6" />
    </g>,
  };
  return <svg {...common} aria-hidden="true">{paths[name] || null}</svg>;
};

window.Icon = Icon;
