/* ── 新原型自带图标集(含交通工具)── */
function GIc({ d, size = 18, sw = 1.7, fill = "none", style }) {
  return (
    <svg width={size} height={size} viewBox="0 0 24 24" fill={fill} stroke="currentColor"
      strokeWidth={sw} strokeLinecap="round" strokeLinejoin="round" style={style}>{d}</svg>
  );
}

const GKIND = {
  sight:  { label: "景点", color: "var(--c-sight)" },
  food:   { label: "美食", color: "var(--c-food)" },
  cafe:   { label: "咖啡", color: "var(--c-cafe)" },
  photo:  { label: "拍照", color: "var(--c-photo)" },
  stay:   { label: "住宿", color: "var(--c-stay)" },
  nature: { label: "自然", color: "var(--c-nature)" },
};

function GKindIcon({ kind, size = 16, sw = 1.7 }) {
  const p = {
    sight: <><path d="M3 21h18" /><path d="M5 21V9l7-5 7 5v12" /><path d="M9 21v-6h6v6" /></>,
    food: <><path d="M5 3v8a2 2 0 0 0 2 2v8" /><path d="M9 3v6" /><path d="M17 3c-1.5 0-3 1.8-3 5s1 4 2 4v8" /></>,
    cafe: <><path d="M5 8h12v4a5 5 0 0 1-5 5H10a5 5 0 0 1-5-5V8Z" /><path d="M17 9h2a2 2 0 0 1 0 4h-2" /><path d="M8 3v2M12 3v2" /></>,
    photo: <><rect x="3" y="7" width="18" height="13" rx="3" /><path d="M8 7l1.5-2.5h5L16 7" /><circle cx="12" cy="13" r="3.2" /></>,
    stay: <><path d="M3 18v-6a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v6" /><path d="M3 18h18" /><path d="M7 10V7a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v3" /></>,
    nature: <><path d="M12 3 5 13h4l-3 5h12l-3-5h4L12 3Z" /><path d="M12 18v3" /></>,
  };
  return <GIc d={p[kind] || p.sight} size={size} sw={sw} />;
}

function TransportIcon({ mode, size = 15, sw = 1.7 }) {
  const p = {
    walk: <><circle cx="13" cy="4.5" r="1.6" /><path d="M13 8l-2 4 3 2 1 5M11 12l-3 2-1 4M13 9l3 1" /></>,
    bike: <><circle cx="6" cy="17" r="3.2" /><circle cx="18" cy="17" r="3.2" /><path d="M6 17l4-7h5M10 10l3 7M14 7h3" /></>,
    bus: <><rect x="4" y="4" width="16" height="13" rx="2" /><path d="M4 11h16M8 17v2M16 17v2" /><circle cx="8" cy="14" r=".6" fill="currentColor" /><circle cx="16" cy="14" r=".6" fill="currentColor" /></>,
    car: <><path d="M4 13l1.8-5a2 2 0 0 1 1.9-1.3h8.6a2 2 0 0 1 1.9 1.3L20 13v5a1 1 0 0 1-1 1h-1a1 1 0 0 1-1-1v-1H7v1a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1Z" /><path d="M4 13h16" /><circle cx="7.5" cy="16" r=".7" fill="currentColor" /><circle cx="16.5" cy="16" r=".7" fill="currentColor" /></>,
  };
  return <GIc d={p[mode] || p.walk} size={size} sw={sw} />;
}

const GClock = (p) => <GIc {...p} d={<><circle cx="12" cy="12" r="9" /><path d="M12 7v5l3 2" /></>} />;
const GPin = (p) => <GIc {...p} d={<><path d="M12 21s7-6.2 7-11a7 7 0 1 0-14 0c0 4.8 7 11 7 11Z" /><circle cx="12" cy="10" r="2.5" /></>} />;
const GClose = (p) => <GIc {...p} d={<><path d="M6 6l12 12M18 6 6 18" /></>} />;
const GNav = (p) => <GIc {...p} d={<path d="M21 3 3 10.5l7 2.5 2.5 7L21 3Z" />} />;
const GHeart = (p) => <GIc {...p} d={<path d="M12 20s-7-4.6-7-9.7A4 4 0 0 1 12 7a4 4 0 0 1 7 3.3C19 15.4 12 20 12 20Z" />} />;
const GStar = (p) => <GIc {...p} fill="currentColor" sw={0} d={<path d="M12 3.5l2.4 5 5.5.7-4 3.8 1 5.4-4.9-2.7-4.9 2.7 1-5.4-4-3.8 5.5-.7Z" />} />;
const GChevL = (p) => <GIc {...p} d={<path d="M15 5l-7 7 7 7" />} />;
const GChevR = (p) => <GIc {...p} d={<path d="M9 5l7 7-7 7" />} />;
const GUtensils = (p) => <GIc {...p} d={<><path d="M5 3v7M8 3v7M6.5 10v11M5 6.5h3" /><path d="M16 3c-1.3 0-2 1.5-2 4s.7 3.5 2 3.5V21" /></>} />;
const GExpand = (p) => <GIc {...p} d={<><path d="M4 9V4h5M20 15v5h-5M4 15v5h5M20 9V4h-5" /></>} />;

Object.assign(window, {
  GIc, GKIND, GKindIcon, TransportIcon,
  GClock, GPin, GClose, GNav, GHeart, GStar, GChevL, GChevR, GUtensils, GExpand,
});
